Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reading OBD1 with a PIC

Status
Not open for further replies.

adaminc

New Member
Hello all,

This is my first big project, i'm going to be reading the analog outputs of the OBD1 connector in my 1994 Dodge Spirit, using the A/D on a 16f877A, and a 16 channel analog multiplexer.

Right now I have it set up, on several breadboards to read from various points on a simple voltage divider, my problem is that it will read the voltages fine and output to the LCD (4x20), but ever so often this random garbage comes up on the LCD, or weird values, and I'm wondering if its because of the breadboards?, or the connection from the microcontroller to the LCD? I've heard people say that breadboards can exhibit some capacitance and maybe that is effecting it? I dont know, I have attached some photo's so you can see what the LCD displays after first start, after 5 seconds, and after 1 minute, you can see that some of the data is misplaced and wonky!
 

Attachments

  • LCD_FirstStart.jpg
    LCD_FirstStart.jpg
    33.9 KB · Views: 282
  • LCD_After5Sec.jpg
    LCD_After5Sec.jpg
    34.2 KB · Views: 254
  • LCD_After1Min.jpg
    LCD_After1Min.jpg
    24 KB · Views: 250
It is obvious from what you have posted that CH1's data is displayed at the end of CH0.

I would say it is definitely not a noise problem. All the "wonky" characters are actual data like C,H, V and 0-9 with no other strange characters.

Looks more likely to be timing problem. Did you allow sufficient time for the LCD to return to the column 0 after issuing the commands? It will take longer than writing each character. Looks carefully at the timing requirement at the datasheet.
 
I agree it looks like CH1 data is being written in the wrong place. However, I disagree because I am not ruling out noise or signals not meeting TTL level requirements because of poor wiring.

Regardless of the cause, I would refresh the screen a different way from what you are doing. Since the screen is continously being updated. I would also write the blank areas with spaces. It does not take too much additional software to do this and "hardens" your program against noise, etc.

This way, the garbage written in one display refresh will be cleaned on the succeeding refreshes. Right now, any garbage written on the LCD remains there to accumulate over time.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top