Charlie, I don't know how you are getting that table. Maybe your hall sensor degree setting is wrong? When I set all the advance curve to 0 I get the following table...
5333,0,0,0,0,0,0,0,0,0,0,0,0,0,0,272,293,314,335,3 56,377,398,419,440,461,482,503,524,
[...]
4997,5018,5039,5060,5081,5102,5123,5144,5165,5186, 5207,5228,5249,5270,5291,5312
These should be the max values for waiting all the way to TDC with 30 degree hall sensor placement.
Nyemi said:
> But RC Ignition uses a Hall input rising edge.
The hall sensor is active low, like in your picture. So the falling edge comes right as the magnet is hitting the sensor. That's why I figured on using the falling edge. If I used the rising edge I would be getting the interrupt right as the magnet leaves the sensor.
> In the code, you can also wait for the Hall input (GP2) signal when there is ignition timing delay is not ready?
The interrupt only triggers on the falling edge. So it will only produce one interrupt per rev. The rising edge will not trigger the interrupt, so we don't have to worry about it.
> above table the first value is 1448075. how is that usable?
It's not. You must have an error in the spreadsheet. Everyone should check their numbers. There should be nothing larger than 5333 in the table if you hall is at 30 deg. If you hall is at 40 deg. then you should have nothing above 7125.
> In this particular example that first number is an issue....
I should have mentioned this. The first number is actually table value 256.
I'm using an 8-bit variable for CurrentRev. In order to get double the resolution (128 instead of 256 uS) I'm using the low 8-bits of Timer1 to round up or down. So we can get 255 for CurrentRev, but then if it gets rounded up it will go to 256, which rolls over to 0 since we're using an 8-bit variable. So a CurrentRev of 256 will end up being 0.
I figured this was a pretty slick way to do things. A real CurrentRev of 0 can never happen, unless you were running at infinity RPMs. So I use table value 0 to get an extra table value out of the same space, and it accounts for the chance of the max value of 255 getting rounded up to 256 and rolled over to 0.
> If you look at the table I posted you will see that there are values bigger then what timer1 can hold.
If you email me the spreadsheet I'll take a look at it to see what's going on. It's easy to accidentally change a wrong cell in Excel and have it screw up the whole sheet.
I'm working on the spreadsheet and should have a new version today or tomorrow with the features people have asked for. People also kindly sent me some example spreadsheets that show a slick way to make a button generate the code. Keep the examples coming! It really helps me to learn the spreadsheet tricks.
In the future, the spreadsheet will generate all the code, or at least the whole "User Settings" section. I'll also write some documentation to help people figure things out, and hopefully I can figure out how to protect all the cells that shouldn't be changed.
On the website I'm also going to start putting up new versions each time instead of replacing the old ones. And I'm putting up a "Dev release" download section that will link to the files I'm currently working on at the moment.
If you want to help work on the spreadsheet use the dev version to add changes, and email it to me as soon as you can so that we don't get out of sync. I added another sheet for the new curve that adds more control points (every 500 RPM instead of every 1K). It isn't linked to the table values yet.
http://www.electrofunnel.com/CDI-2012/index.htm
-Jake