Old tests and informations about serial communication are to be found here:
MembersPage/NicolasGobet/SerialCommunication/PremierJet
Go over this checklist, and document your measurements.
-> thanks, I answered all the Q. I hope you can help me to deduce something from all these values ;-)
- verify your com-port by looping back the PC's serial cable DSUB9 pin2 and pin3 with a small wire, and type something in TerminalProgram. You'll see it echoed back. When you remove the small wire, it will not be echoed back.
-> It works great, I get my signal back when loopbacked (small wire on the end of my serial cable, it also means that my cable is ok)
-> Computer configuration, com port number are ok
- make sure ECU is not connected to PC, do a serial loopback, this time on the ECU (DSUB9 pin2 and pin3), during powerup. Leave the power on, remove the loopback and connect to the PC so you can try communication (eg. in TerminalProgram)
-> serial communication doesn't work
- try 19200,8n1 is the serial baudrate after you (or the default baudrate when instructing the firmware to go to bootloader)
- 38400,8n1 is unlikely to work
- measure the voltage on serial input and output. You can also try to pull the signal (eg. 1 .. 10k resistor) up to 5V or down to 0V and see if it changes. An output should NOT change much, while a (high impedance) input changes to appr 5V / 0V respectively.
-> Ok I measured voltage between SV2 pins and GND:
ECU SV2 pin# | DSUB pin# | DSUB function | Voltage between GND and SV2 pin |
1 | 3 | RD | 0V |
2 | 2 | TD | -8,48V |
-> the same, with a wire pulling down SV2 pin# to GDN:
ECU SV2 pin# | DSUB pin# | DSUB function | Voltage between GND and SV2 pin |
1 | 3 | RD | 0V |
2 | 2 | TD | 0V |
-> wire pulling up to +4,99V (uC power)
ECU SV2 pin# | DSUB pin# | DSUB function | Voltage between GND and SV2 pin |
1 | 3 | RD | 4,9V |
2 | 2 | TD | 4,87V |
I also tried different things on the uC:
- checked that all uC GND are connected with each other : OK (pin-22-53-63)
- checked voltage between all uC Vcc (pin-21-52-64) and gnd: I get 4,92V
- you can also measure the max232 pins, you should find +8V on one pin and -8V on another
pin number# | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
voltage between GND and pin# | +4,92V | 0V | -8,55V | 0V | +4,92 | +3,8V | +3,81V | +4,92V | +6,8V | +8,89V | +2,3V | +4,42V | -4,51V | -8,57V | -8,57V | 0V |
- measure DC voltage on the xtal pins (should be near 2.5V)
If all else fails, you can try if you can get ISP communications to the processor as on GenBoard/Firmware/Upload. The ISP is a simple, short 5pin "stk200" cable connected to parallelport (DSUB25). avrdude is the most frequently used application (uisp is another option). The ISP should work if the microcontroller gets supply and not blown. in avrdude -c stk200 -p m128 -t try some commands like (just examples by memory, see avrdude manual and try to capture in file)
- dump flash 0 0x800
- dump flash 0x1f800 0x800
- dump efuse 0 1
- dump lfuse 0 1
- dump hfuse 0 1
The bootloader communications also requires the xtal, the max232 (and it's connections) and the fuses inside the avr, and bootloader flash-area (0x1f800 .. 0x1fff0) inside the AVR (which is unlikely to damage: possible eg. by replacing the processor with a new one ;-)
-> I had already built the cable, using the information found on MembersPage/MattiasSandgren/NickesBMW/AvrBootCode.
So here is the cable schematics:
AVR pin command | ISP header # | Parallel port pin | Notes |
AVR /RESET | 5 | 7 | Yellow |
AVR SCK (clock input) | 3 | 8 | Black |
AVR PDI (RXD) (instruction in) | 4 | 9 | Red |
AVR PDO (TXD) (data out) | 1 | 10 | Orange |
Signal Ground | 6 | 18 | Brown |
I also checked that each pin of JP_ISPI is connected to the matching pin on the uC. and drew this schematic:
So it doesn't work.