Hello All,
I want to control Timing of a 2 cycle engine. What would be the best way to go about this. I tried some ideas,but they don't seem to work very well. I need to controll timing down to < 200 RPM and up to 4000. I am going from 5 degrees BTDC to 28 to 30 BTDC. Thanks. I am aware that I will need at least one timer maybe two. Maybe CCP?
Question
Moderators: David Barker, Jerry Messina
Hi everyone,
I have been reading up on CCP. http://ww1.microchip.com/downloads/en/D ... /ccpwm.pdf
I understand the capture part. Basically If I have the ccp pin to capture a falling edge every time the ccp pin sees a logic 0 the ccpL:ccpH register will be loaded with the timer1 value. Is this correct? The Compare mode is where I get a little lost. From what I am reading it seems that the ccp pin when timer1 value and ccpl:ccpH values match will toggle? Can I set up a interrupt on another pin? Using CCP seems the best way to go with this,but I am open to suggestions.
I have been reading up on CCP. http://ww1.microchip.com/downloads/en/D ... /ccpwm.pdf
I understand the capture part. Basically If I have the ccp pin to capture a falling edge every time the ccp pin sees a logic 0 the ccpL:ccpH register will be loaded with the timer1 value. Is this correct? The Compare mode is where I get a little lost. From what I am reading it seems that the ccp pin when timer1 value and ccpl:ccpH values match will toggle? Can I set up a interrupt on another pin? Using CCP seems the best way to go with this,but I am open to suggestions.
Running version 2.2.4.0 ICC 1.2.1.0
Regards CharlieM
Regards CharlieM
Hi Charlie,
You're on the right track. CCPM is the right way to do it.
You got the capture part right.
For the compare part, you can use any pin (e.g. INT0, INT1) to create an interrupt. In your INT routine just enable the compare mode and start timer 1. At match, CCPx will toggle and also creates an interrupt.
Matt
You're on the right track. CCPM is the right way to do it.
You got the capture part right.
Yes. That's correct.Is this correct?
For the compare part, you can use any pin (e.g. INT0, INT1) to create an interrupt. In your INT routine just enable the compare mode and start timer 1. At match, CCPx will toggle and also creates an interrupt.
Matt