Ken, Jim.Ernest, Kevin, and others, Thanks to all
you professional programmers for your comments about my one line of code.
I guess if the professionals have also found that "one more line of code"
gotcha, I don't feel as "unprofessional".
I can understand why if you did it for a living, it might lose its
charm factor. But, being an amateur - its a fascinating field that
enables you to design and make all sorts of fascinating devices - fairly cheaply
- compared to trying to do the same with an Analog design approach.
My old analog EFI Fuel monitor I designed and built several years ago
worked just fine, but it could only provide fuel flow and fuel total.
Furthermore it had over 7 major chips (counters, gates, inverters) not to
mention the resistors and capacitors. It had a larger foot print appro 3 x
6" and the components total cost was much more than a microchip and its relative
few supporting components. I tried 3 different redesigns to give it more
capability and finally decided it was just too limiting for the amount of effort
- so decided to jump into the digital world.
But, I will admit at times wrestling with the code, I was not certain
I had made the right choice to go digital. Fortunately after slowly
getting started with the assembly language coding, I found a Pascal Compiler
designed for the Microchip PIC chips - Heaven sent - I could code in English
(more or less), plus it a library of many of the basic
I/O functions I needed. However, it did not have floating point
nor even integer math operations larger than a word (2 byte) size. I was
dealing with numbers as large as 60,000,000 (clock counts). So
I had to write most of the math routines I needed in assembly including such
basic things as putting a decimal in a number at the right location.
But, it was truly education (and I must admit very fun and satisfying when
it finally worked like I had designed it t). Going out this morning with
that offending line of code removed and the two modules I have built test and
retest.
The only difference in the two modules is one has an LM9040
Lambda (O2) amplifier and the other one just reads the voltage from the 02
sensor directly - wanted to see if the LM9040 did anything for the Air Fuel
Indication - basically all it does is expand (amplify) the 0 -1volt O2 sensor
output to 0 -5 volts for the CMOS chip. I thought that might provide more
"sensitivity" through the chips A/D circuit - but as Tracy commented why
worry about sensitivity when we are just using it for a "relative
indication:.
Actually, I have coded a screen that shows the O2 sensor output in
volts (millivolts), but decided that a visual indication of lean rich didn't
require any mental manipulation of the voltage to A/F, so went with a visual
indication on the LCD display.
Onward!
Ed