As the next project I aimed in making a pulse generator.
555 are too costly. Too many components.
So I went for a 12F675.
It has an ADC, so I believe I can vary the pulse frequency with it.
I need 3 Digital outs.
One for pulse, one for direction and one for Enable.
My aim is to drive a DC motor and Leds. During testing various projects.
I wrote the code.
The ADC is read and the Direction pin can be changed accordingly when the ADC value changes.
I assigned the TMR0 and interrupt routine to pulse the output.
The code was compiled after reading a lot of web pages from google and pdf's.
The prescaler is set for 1:256 with internal RC 4MHz osc.
So the LED is flashing around 5 to 10Hz I think.
Well at least I am getting an out put.
I thought I can assign a value ( corresponding to the value from ADC) and load it the timer0 or somewhere and change the pulse freq. But so far I am lost.
I like the freq to be around 20Hz to 2Khz variation.
Is this possible.
If it is I appreciate some pointers on how I should go about it.
555 are too costly. Too many components.
So I went for a 12F675.
It has an ADC, so I believe I can vary the pulse frequency with it.
I need 3 Digital outs.
One for pulse, one for direction and one for Enable.
My aim is to drive a DC motor and Leds. During testing various projects.
I wrote the code.
The ADC is read and the Direction pin can be changed accordingly when the ADC value changes.
I assigned the TMR0 and interrupt routine to pulse the output.
The code was compiled after reading a lot of web pages from google and pdf's.
The prescaler is set for 1:256 with internal RC 4MHz osc.
So the LED is flashing around 5 to 10Hz I think.
Well at least I am getting an out put.
I thought I can assign a value ( corresponding to the value from ADC) and load it the timer0 or somewhere and change the pulse freq. But so far I am lost.
I like the freq to be around 20Hz to 2Khz variation.
Is this possible.
If it is I appreciate some pointers on how I should go about it.