How to generate pulses of different frequencies at GPIO4 and GPIO5 in PIC12f629?

Status
Not open for further replies.
I mentioned 9 uSec in the post.....to compensate for the ticks consumed by the context saving instructions. Why 9 u might ask. Well....I simply simulated the system in Oshonsoft, and adjusted the value to get the best cumulative result with min. error after 5, 23Hz cycles. To be really super accurate I'd have to recode the decision tree for the 23Hz and 3 Hz so that they consume the same # of ticks whether or not they are due to be pulsed. That way the tick variation introduced by the decision making code is removed and you have a consistent pulsing. It really depends on how much accuracy u need. The interrupt prevents error deviation from getting out of hand. It's possibl with PICs to do time accurate coding because of the fixed ticks the instruction codes consume.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…