To detect lengths of time elapsed you can use your TMR0 module. Figure out how long of a delay it is to signify the code is complete and watch for it. To get 1 & 2 to be 12, simply make code detect that sequence, there can only be a few error codes, so you could just code for each one if you wanted, to brush up on your assembly :) nick@veys.com | www.veys.com/nick > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Justin Fielding > Sent: Wednesday, June 20, 2001 8:04 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: 16F84 project for newbie.... > > > I am a newbie to Pic's (just got to the interrupts section in the > Easy Pic'n book) and have thought of a great little project. I > want to make a fault reader for my car's ECU. > > If the ECU detects a fault (can be simulated by disconnectiong > something) then it pops the warning light on. You can then (bit > of a quick hack) conect an LED accross two of the pins on the > diagnostics port and short two out and it will flash a code on the LED. > > It first flashes 1 2 to let you know it is working, then the > fault, say 2 6 and then 1 2 again. > > Trouble is it does this in a rather strange way, in the above > example it would. > > Flash the LED once > Short pause > Flash the LED Twice > Long pause (so the above was "1" then "2" but this should be read as 12) > Flash LED Twice > Short pause > Flash the LED six times > Long pause ( representing "2" then "6" or 26) > and so on..... > > I would like to use an F84 with an input from the ECU (from where > the LED goes) and then a LCD display to show what the fault is > (use a lookup table here). > > Problem is how do I know the difference between the long and > short pause (so I can stop counting flashes and move to the next > digit) AND the big how... How do I turn "1" & "2" into 12 (for > use in the lookup table)? > > Any help or tips from similar projects would be appreciated. > > Thanks. > > Justin. > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu