The ignition curve:
Ignition advance movie
Have you ever had one of those days when you have a brain fart and spend hours doing something only to realize the answer was staring you in the face? Of course you have, your a hobbyist. Well I had one and it related to the EEPROM. To check out the writing and reading of the EEPROM I created an ignition curve in Excel and saved it as a *.csv (comma separated values) file and using notepad I copied and pasted it into my code. During the setup routine I had the values programmed into the EEPROM from locations 0-99 for 100 values.
0,0,0,5,5,5,5,5,5,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40
Each one is a step of 100 RPM up to and including 10,000 RPM. Remember I was saying that the EEPROM stores values in HEX as 1 byte and everything else is 2 bytes? The problem with this is that the locations would not go up 1 at a time, it is more like 2 at a time. This is because unless you tell the firmware that you are using 8 bit bytes it treats the bytes as 16 bit taking up 2 locations. This creates 2 problems; one you use twice as many locations than you need and second you have to compensate in the code by jumping 2 locations for every read of the EEPROM. So if you want to store a single 8 bit byte then you have to use the 'uint8_t' as compared to the 'uint16_t' and I forgot this. Also I could not find anywhere that would explain this behavior properly. According to the datasheets the 328 mcu uses a 9 bit byte to allow for signed (+-) values. So if one doesn't say 'uint8_t' (unsigned integer) then it adds in a signed value and spills over into the next location. Also the 328mcu doesn't write 1 location at a time but, instead writes a whole page at a time, just some FYI.
Anyway does timing advance work, yes it does. On the scope I can see the input trigger pulse width get smaller, the output trigger stays the same 2 msec dwell, but, the distance between the input trigger and the output trigger changes with the RPM and the programmed advance timing. As the RPM goes up and the advance increases you can see the sudden decrease in distance. Less distance between them means more advance in the timing, less Hold-off time.
I made a video of the scope and computer screens to show the advance working away. The values I used were:
0,0,0,0,0,0,0,0,0,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40
no advance from 0-800, 20 degrees from 900-3,300, and 40 degrees 3,400-10,000 RPM. Actually in the video I hit @11,300 RPM. Sorry about the shaking and poor audio. Ok I think I'm ready for the ignition coil now, I think.
Cheers
Ray