Electronics > Projects, Designs, and Technical Stuff

About PIC timer module (help)

<< < (3/3)

Mechatrommer:

--- Quote from: danielks on October 20, 2011, 04:04:23 am ---I'm using 1:1 prescaler. I'm saying that using 391 times of over flow interrupt on 1:1 prescale and I'm getting 50Hz when timer starting point is 0 but if I set the initial starting point of the timer to for example 100, I should get more than 50Hz if i'm still using 391 times of interrupt.

--- End quote ---
ok. where did you put the TMR = 100 code? do you use polling or interrupt routine to check for OF? did your TMR=100 is executed each time OF is flagged? did you clear the flag? what PIC do you use, so somebody can check in the datasheet the timer and ISR behaviour. i'm afraid if i check in my pic16f690 or even pic10f200 datasheet and give you some advice, it wont apply to your PIC64F. so you will successfully have our time wasted. "usually" and if you do it correctly, setting TMR to larger value will have its IF registers flagged and interrupt vector called sooner. and as usual Microchip got some fancy procedure to do it correctly, such as you cannot set directly after OF, must wait n cycles bla bla etc etc. if i were you, i will blink a led on one of its pin each time the interrupt for debug purpose, so i can check in DSO what is happening wrong.

Psi:
Yeah, as Mechatrommer says, try and get it working at a slow speed with leds.

Then you can see and understand how and why it works before trying to do it at fast speeds.

Mechatrommer:

--- Quote from: Psi on October 20, 2011, 10:16:21 am ---Yeah, as Mechatrommer says, try and get it working at a slow speed with leds.
Then you can see and understand how and why it works before trying to do it at fast speeds.

--- End quote ---
lol. when did i say work at slow speed? the fastest pwm (led blink) achievable with 5MIPS is only around 1MHz which can be easily seen in any decent DSO... and that you dont do timing do dont anything, just led blink :D sorry.

Psi:

--- Quote from: Mechatrommer on October 20, 2011, 10:34:39 am ---
--- Quote from: Psi on October 20, 2011, 10:16:21 am ---Yeah, as Mechatrommer says, try and get it working at a slow speed with leds.
Then you can see and understand how and why it works before trying to do it at fast speeds.

--- End quote ---
lol. when did i say work at slow speed? the fastest pwm (led blink) achievable with 5MIPS is only around 1MHz which can be easily seen in any decent DSO... and that you dont do timing do dont anything, just led blink :D sorry.

--- End quote ---

Sorry, i just meant to get it working with leds as you suggested.

Slow speed was my idea so he can get his timer working and producing a visual delay that makes sense given all the variables etc.. xtal, prescaler, timer register.
(We don't know if he has a CRO/DSO)

Navigation

[0] Message Index

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod