Originally Posted by jjakes24
You know that's for a PIC Microcontroller right?
According to the first site, vag-com does the 5baud init like this :
IOCTL_SERIAL_SET_BREAK_ON
IOCTL_SERIAL_SET_RTS
IOCTL_SERIAL_CLR_DTR
IOCTL_SERIAL_SET_BREAK_OFF -> Start-Bit?
IOCTL_SERIAL_CLR_RTS
IOCTL_SERIAL_SET_BREAK_ON -> 0
IOCTL_SERIAL_SET_RTS
IOCTL_SERIAL_SET_BREAK_ON -> 0
IOCTL_SERIAL_SET_RTS
IOCTL_SERIAL_SET_BREAK_ON -> 0
IOCTL_SERIAL_SET_RTS
IOCTL_SERIAL_SET_BREAK_ON -> 0
IOCTL_SERIAL_SET_RTS
IOCTL_SERIAL_SET_BREAK_ON -> 0
IOCTL_SERIAL_SET_RTS
IOCTL_SERIAL_SET_BREAK_ON -> 0
IOCTL_SERIAL_SET_RTS
IOCTL_SERIAL_SET_BREAK_ON -> 0
IOCTL_SERIAL_SET_RTS
IOCTL_SERIAL_SET_BREAK_OFF -> 1
IOCTL_SERIAL_CLR_RTS
IOCTL_SERIAL_SET_DTR
Originally Posted by jjakes24
You know that's for a PIC Microcontroller right?
Yup, but its good for looking how to initialize connection to the ECUOriginally Posted by shotgunefx
But pretty much all that code is to set up the PIC's UART, not the ECU.Originally Posted by Maddog_rvo
The reason that most readers are slow, is there's a 20ms delay between queries. That's part of the specs I believe. If you could cut that down, then they would update faster. Wether this would cause problems on your vehicle, who knows.
Do you know what interface your car is using? Is it ISO 9141? That's K-Line.
Your best bet is to look at what docs are available for your specific interface.
Its iso 9141 indeed, i think with the current code the init succeeds, but i now get a framing error as soon as data is received, which crashes my app. Does anyone know what kind of error this is and how to solve it?Originally Posted by shotgunefx
Probably a timing error. There are certain timings that need to be adhered to ,etc. If you don't know learn what needs to be done, it's probably going to be extremely difficult to probe around until you happen to make something work.Originally Posted by Maddog_rvo
If you don't want to try and read up on the interface, take a look at freediag and see if you can grok enough of it to get something working.
Piece of text i received through the opendiag group :
You receive a OBD2 response 0x55-0x08-0x08 which indicates that
there is more than one ECU in this car - you probably send 0x33 as
adress.It also means that there must be 25mS - 50mS timeperiod
between responses for adressed ECUs.
Response 0x55-0x94-0x94 means that there is only one ECU that
would answer and time for response is from 0ms - 50mS.
If you want to connect to an OBD2-compliant car, do the following:
Send: 0x33
Receive: 0x55-0x08-0x08 ( or 0x55-0x94-0x94)
Send: 0xF7 (complement of second 0x08) OR send: 0x6B (complement of second 0x94)
Receive: 0xCC (complement of adress 0x33)
Initsequence is now finished, you can start diagnostic session by:
Send: 0x68-0x6A-0xF1-0x01-0x00-0xC4
Rcv: 0x48-0x6B-EcuAdress-0x41-0x00-A-B-C-D-ChkSum
Explanation and more info in: SAE9141, J1979 and ISO14230.
Bookmarks