Hi All,
I thought this would be really easy, but now it seems VERY hard to achieve, or am i just over-thinking the problem?
I would like to monitor a low frequency clock source (maximum of 1khz), fed into a picaxe, then, with some internal maths or logic, create a division of that frequency to be sent out of another pin.
For example, If i use pinA.0 as the clock input, and pinB.0 is the "modified" clock output, how can i easily achieve this?
My first step is to simply divide the incoming clock by 2, so 1khz IN, becomes 500hz OUT.
I started thinking about using the pulsin command, no good, then i thought about using the "count" command, no good.
What other methods can i use to divide the frequency of the incoming clock? without spending too much time in loops or missing clocks and false triggers etc??
This is probably so simple, but it's driving me up the wall now ;-)
Ultimately, i wanted a picaxe to emulate a binary divider function, like a cmos 4024, 4040, 4060 etc....
I want to emulate this function with a picaxe so i have more control of modifying pin divisions when needed, or assign pin outputs to be something 'other' than the usual weighted, 1,2,4,8,16, something more like 1,2,4,128,256 etc
Thanx in advance to those that can enlighten me ;-)
Time for a long sleep now ;-)
I thought this would be really easy, but now it seems VERY hard to achieve, or am i just over-thinking the problem?
I would like to monitor a low frequency clock source (maximum of 1khz), fed into a picaxe, then, with some internal maths or logic, create a division of that frequency to be sent out of another pin.
For example, If i use pinA.0 as the clock input, and pinB.0 is the "modified" clock output, how can i easily achieve this?
My first step is to simply divide the incoming clock by 2, so 1khz IN, becomes 500hz OUT.
I started thinking about using the pulsin command, no good, then i thought about using the "count" command, no good.
What other methods can i use to divide the frequency of the incoming clock? without spending too much time in loops or missing clocks and false triggers etc??
This is probably so simple, but it's driving me up the wall now ;-)
Ultimately, i wanted a picaxe to emulate a binary divider function, like a cmos 4024, 4040, 4060 etc....
I want to emulate this function with a picaxe so i have more control of modifying pin divisions when needed, or assign pin outputs to be something 'other' than the usual weighted, 1,2,4,8,16, something more like 1,2,4,128,256 etc
Thanx in advance to those that can enlighten me ;-)
Time for a long sleep now ;-)