![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| How can I use Timer0 to create a pulse for controlling a dc motor? I try to use it with PIC 16F628A . One motor uses PWM, another uses Timer0. But I don't know when we init Timer0, it will increase every intructions cycles, right ? so, what we would do in main , meanwhile Timer0 is increasing ? The Duty cycle of the pulse is create by set the pin high (1) , then init timer0, ( after it overflows), PC comes to Interrupt routine. Do the Int , then go back to main program, and in program what would we write? ( It must be enough intructions for Timer0 to timing , right ? ) thank you very much for answer my question. | |
| |
| | (permalink) |
| That is very confusing ! You could try to explain better, but the Timer functions aren't maded specially to create Pulses, as i said try to explain your situation better. bye. | |
| |
| | (permalink) |
| Sorry everybody and thank TiagoSilva very much. My english is bad and you didn't understand me. But my question is not important now . I have already understand how to use timer0 module. Yeah, TiagoSilva is right but I use timer0 to create a pulse. I set pin RA0 =1 , then I allow time0 to run, and when it overflows , PC come to Interrupt . In Interrupt code , I then change this pin to 0,.. and etc... thank you, TiagoSilva ! | |
| |