Hi everyone,
I want to write a program on an ignition system for a 125cc four stroke engine.The purpose of my program is to produce a variable time delay for spark to occur in the ignition system. As the engine starts, pulses from the alternator assembly via the pulser coil(positioned at 36degree BTDC) will be collected. The time from the 1st and 2nd pulse will determined the speed of the engine. By using the speed of the engine, the program will call a suitable delay value for spark to occur. This means that spark will only be produce after the 2nd pulse and one spark is wasted.
Its been 2 weeks since ive started the project, learning about the ignition system and how to program a PIC using c or assembly. Ive decided to program PIC16F84 with Wiz-C by using assembly language because it is quite easy to understand. So far i was able to do simple task such as flashing LED with a push button.
*** Details on the ignition system
Ideally a mixture of air and fuel needs to be burn exactly at the top dead centre(TDC) of the combustion chamber. In reality, a fixed quantity of air and fuel needs a particular time to combust. Although this can be solve by allowing the spark to occur before TDC say at 36 degrees before TDC, the engine however have a range of operating speed. Thus there needs to be a variable delay system(depends on the speed of the engine) where combustion occur before TDC.
*** Information about my program
Assume that the engine can run up to 8000rpm.
At engine speed of 1200 RPM;
1200 / 60 = 20 revs per second
1 / 20 = 50mS per rev
1 rev = 360 degrees
36 degrees at 1200 RPM = (36 / 360) X 50 = 5mS
So at max rpm, delay = 0, spark will occur at the instant the pulser is at 36 degrees BTDC.
at min rpm( 0-1200rpm), delay should be lower than 5mS say 4mS
The program have 8 set of delay values(just an example, it should be about 100).
8000rpm= 0mS
7000rpm=0.5mS
6000rpm=1mS
5000rpm=0.5mS
4000rpm=2mS
3000rpm=2.5mS
2000rpm=3mS
1200rpm or lower =fixed at 4mS
I came across a website that has an assembly code which is similar to the one that i want. I cant really follow the logic of the code and was wondering if someone can give me a simple assembly code example plus explanation on how to use timers to calculate rpm and use data tables to retrieve corresponding delay output using assembly language. I know this is too much but i really appreciate all the help that i can get.
www.transmic.net
I want to write a program on an ignition system for a 125cc four stroke engine.The purpose of my program is to produce a variable time delay for spark to occur in the ignition system. As the engine starts, pulses from the alternator assembly via the pulser coil(positioned at 36degree BTDC) will be collected. The time from the 1st and 2nd pulse will determined the speed of the engine. By using the speed of the engine, the program will call a suitable delay value for spark to occur. This means that spark will only be produce after the 2nd pulse and one spark is wasted.
Its been 2 weeks since ive started the project, learning about the ignition system and how to program a PIC using c or assembly. Ive decided to program PIC16F84 with Wiz-C by using assembly language because it is quite easy to understand. So far i was able to do simple task such as flashing LED with a push button.
*** Details on the ignition system
Ideally a mixture of air and fuel needs to be burn exactly at the top dead centre(TDC) of the combustion chamber. In reality, a fixed quantity of air and fuel needs a particular time to combust. Although this can be solve by allowing the spark to occur before TDC say at 36 degrees before TDC, the engine however have a range of operating speed. Thus there needs to be a variable delay system(depends on the speed of the engine) where combustion occur before TDC.
*** Information about my program
Assume that the engine can run up to 8000rpm.
At engine speed of 1200 RPM;
1200 / 60 = 20 revs per second
1 / 20 = 50mS per rev
1 rev = 360 degrees
36 degrees at 1200 RPM = (36 / 360) X 50 = 5mS
So at max rpm, delay = 0, spark will occur at the instant the pulser is at 36 degrees BTDC.
at min rpm( 0-1200rpm), delay should be lower than 5mS say 4mS
The program have 8 set of delay values(just an example, it should be about 100).
8000rpm= 0mS
7000rpm=0.5mS
6000rpm=1mS
5000rpm=0.5mS
4000rpm=2mS
3000rpm=2.5mS
2000rpm=3mS
1200rpm or lower =fixed at 4mS
I came across a website that has an assembly code which is similar to the one that i want. I cant really follow the logic of the code and was wondering if someone can give me a simple assembly code example plus explanation on how to use timers to calculate rpm and use data tables to retrieve corresponding delay output using assembly language. I know this is too much but i really appreciate all the help that i can get.
www.transmic.net