Hi,
I am using an atmega128 for developing an ignition system for a 3/4 cylinder engine (needs to be usable for both).
I have things working great at a fixed rpm. Even if I change rpm all I need to do is reset and pulses for ignition fire correctly.
The problem is that I cant reset. I need this to work during transient times as well as at a fixed rpm. If it cant then it will not work on start up, etc.
I am using ICP on timer 1 to catch the "long tooth" portion of the signal from the cam sensor. I developed an external board to convert the cam signal (Hall effect sensor) to a digital pulse. The long tooth indicates cylinder #1. Once I have detected this I start timer 2 which counts the pulses from the cam sensor digital signal on the falling edge starting with the long tooth as 0. And I turn off the ICP sense switching (initially it comes in on both the rising and falling edges in order to calculate pulse width). The reason I turn off the ICP is that I was having interrupt conflicts as T2 counts on the falling edge as well. after I start T2, it counts up on falling edge and ICP catches the rising edge so we have no conflicts. But because I am doing this I have no way to calculate the pulse width and the delay time calculation for time to fire before top dead center is dependent on this. Thus, I have the issue of not being able to operate when the rpm is changing. I can provide more detail which I think will be necessary if someone thinks they can help.
Any thoughts or ideas will help immensely as I am really stuck.
Thanks
I am using an atmega128 for developing an ignition system for a 3/4 cylinder engine (needs to be usable for both).
I have things working great at a fixed rpm. Even if I change rpm all I need to do is reset and pulses for ignition fire correctly.
The problem is that I cant reset. I need this to work during transient times as well as at a fixed rpm. If it cant then it will not work on start up, etc.
I am using ICP on timer 1 to catch the "long tooth" portion of the signal from the cam sensor. I developed an external board to convert the cam signal (Hall effect sensor) to a digital pulse. The long tooth indicates cylinder #1. Once I have detected this I start timer 2 which counts the pulses from the cam sensor digital signal on the falling edge starting with the long tooth as 0. And I turn off the ICP sense switching (initially it comes in on both the rising and falling edges in order to calculate pulse width). The reason I turn off the ICP is that I was having interrupt conflicts as T2 counts on the falling edge as well. after I start T2, it counts up on falling edge and ICP catches the rising edge so we have no conflicts. But because I am doing this I have no way to calculate the pulse width and the delay time calculation for time to fire before top dead center is dependent on this. Thus, I have the issue of not being able to operate when the rpm is changing. I can provide more detail which I think will be necessary if someone thinks they can help.
Any thoughts or ideas will help immensely as I am really stuck.
Thanks