Hi,
I wish to drive the motor clockwise for 5 secs and halt for 5 secs and then continue running in ANTI-clockwise for 5 seconds....the cycle should continue this way.How do i do the delay in PIC 16f877 of MICROTECH? Any built-in function or sample code?
If you go to the PICList there is a delay code generator, which will generate assembler code for you simply by specifying the delay required and the clock speed.
Hi,
I wish to drive the motor clockwise for 5 secs and halt for 5 secs and then continue running in ANTI-clockwise for 5 seconds....the cycle should continue this way.
This is just a home project.I'm planning to do some travellator kinda stuff.I really don't know from technical aspect as I'm newbie here.I'm using a small motor for this.Kindly advice !
It's really dead simple in assembler as well, just load a register with the delay you want and call a delay routine that number of times - most of my tutorials do just that.
Find out a function .. or make a function that generate a delay of 1 micro second..
Not in C you don't, at least not with a 4MHz clock - and even in assembler you don't use a function for that, just a single NOP at 4MHz for a 1uS delay.
hence if you need a 5000 micro second delay.. then just put the value 5000 in brackets of function call..
The function of delay of one microsecond .. you can have it from Sir Nigel..