I think you project is neat! Would you be willing to share your code (just for personal non-commercial use). tks Mike Montaigne montaignem@aecl.ca >---------- >From: N STEENKAMP [M.ING E&E][SMTP:STEENKMP@FIRGA.SUN.AC.ZA] >Sent: Tuesday, January 13, 1998 4:58 AM >To: PICLIST@MITVMA.MIT.EDU >Subject: Re: pic tachometer... > >Hi, > >> Once again I'm drawing upon the infinite wisdom of the PICLIST... >> >> I'm building a simple pic-based automotive tachometer and would like >> to count pulses from the primary lead of the ignition coil and display >> the RPM on an LCD. For peace-of-mind (and other reasons), I'd like to >> isolate the input pin of the pic with a 4N35 optoisolator. I can handle >> everything but the connection to the coil... >> >> I have 2 questions - >> >> 1. What is the maximum frequency that the 4N35 will reliably switch at >> (will it keep up with the pulse train from the coil)? >> >> 2. What do I need to do at the optoisolator's input to handle the >> ignition pulses? >> >Just a comment: >I have also constructed an automotive tachometer about a year ago. I >have found that counting pulses in a fixed period is not a very good >approach, since the frequency of pulses can be quite low. At 600 RPM it >is 20Hz for a 4cyl engine. That means that your counting period must be >quite long to be able to get sufficient accuracy, which means a >slow update rate of the display. The method I used was to time the >period between two pulses and calculate the RPM from that. I >wanted to keep the refresh rate between 5 and 10 times per second. Since >the higher the RPM's the shorter the period, I was also able to average >samples at higher RPM's for a stabler display. From 0 to 1200RPM's I >used 1 sample, from 1200 to 2400 I used 2 samples. From 2400 to 4800 I >used 4 samples and from 4800 upwards I used 8 samples. > >The project uses a 16C54 running at 20MHz and the display is a 16x2 LCD. >It has a resolution of 10RPM's. In the top line of the LCD I display the >RPM's in digits and in the bottom line I have a bargraph display (made by >using the programmable characters of the LCD). The display is >really fast and responsive. >I guess that using one of the PIC's with a capture and compare unit >would have been easier, but I wanted to see what I could do with a 54! > >Regards, >Niki >