Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using the Timer0 module

Status
Not open for further replies.

wonbinbk

New Member
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.
 
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.
 
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 !
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top