> The phrase about calling a Pentium 4 a PIC killer > is not as ridiculous as it may seems at a glance now, > in my opinion. Industrial Pentium 4 based single board > computers (SBCs)are getting smaller and cheaper, power > consumption is dropping too. If you want to control > complex industrial devices, not toys, you should think > many times before choosing PIC direction, even if the > computational power is not needed right now. Here's a genuine real world example. About two weeks ago a customer had a gizmo that had a digital input for when a diesel engine was on, and when it was being abused by being run too fast. Among other things, this gizmo sends a message to a central office via satellite when certain events occur, like the engine being abused. The problem was that this now needed to be hooked up to an engine that didn't provide these outputs. The only thing available was a tachometer signal generated by a magnitized coil in close proximity to teeth on the flywheel. This is an AC analog signal that produces 127 cycles per engine revolution. The amplitude is anywhere from a few 100mV to tens of volts p-p. The job was to design and build two prototype quick and dirty converters from the tachometer signal to the existing digital inputs. They don't want the engine abused signal asserted until the engine has been over the speed limit continuously for 5 seconds. They don't want a satellite message for every short vrooom of the gas pedal, just for sustained excessive speed. The exact engine speed theshold isn't known. The unit will somehow have to be adjusted when installed. And of course, these two prototype units need to be their hands yesterday. +12V, +5V, and ground are available. Each unit needs to have two channels (two tach in signals, two sets of engine on and abused output signals). I did this with an LM324 front end to convert the tach signal into a nice 0-5V digital signal using a little filtering and hysterisis. Then I programmed a 12F629 to run with its internal 4MHz oscillator and compute the period between tach pulses, then filter that a little to make a reasonably solid 16 bit value internally. A momentary pushbutton was tied between ground and a PIC pin with passive pullup. The current tach period becomes the high/low speed threshold when pressed. At installation time, you run the engine at wherever you want the speed threshold to be, then press the button. This value gets saved in EEPROM, so it doesn't get lost on power down. Two pins drive the two inputs of the original gizmo. I also added two LEDs driven from PIC pins with resistors to +5V. One lit when the engine was considered on (tach period didn't overflow the 16 bit internal value), and the other lit when the instantaneous speed was over the threshold. The LEDs are only for the field installers. The whole unit will be in a sealed box and never seen by the end user. For two channels I simply used two 12F629, and still had two unused opamps left of the four in the LM324. A technician built 2 of these simple circuits on two small pieces of perfboard. Problem solved. OK Mike, I'm really eager to hear how a single board computer would have somehow solved this problem better. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body