Re: HSERIN String reading
this will help , but maybe the serial data will need to be inverted
the pic chip expects the data line to idle " high"
Code:
mai var byte[16]
Lcdout $fe, 1
pause 200
main:
hserout ["ATI",13,10]
pauseus 300
HSerin 2000,main,[STR mai\16] ;>ati ELM327 v1.5
pause 2000
Lcdout $fe, 1
lcdout str mai\16
Re: HSERIN String reading
Looking at the garbled data I would first look at the interface levels and states. When I used one of these OBD interface chips quite a few years ago it was designed to be connected DIRECTLY to the PC. That means the signals are already inverted. To interface it to a PIC you will need to Re-invert the TX and RX signals before connecting it to the PIC. Look at the data sheet. I used an ELM322D OBD(VPW) device.
Re: HSERIN String reading
Some success comes after applying Richard's changes, thaks. Now I can read strings from ELM chip.
to: Dave, I don't need to Re-invert the TX and RX signals because the ELM327 is an PIC18F2480 MCU
and I connected the UART pins directly to PIC16F690 UART pins.
I think it's OK.