Prescaler should be set and forget as I understand it
Prescaler should be set and forget as I understand it
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
When you use the USART, are you setting the Baudrate after each character sent? Nope!
When you use the CCP module in PWM mode, do you need to configure the frequency each time you want to play with the duty cycle? Nope!
Internal hardware are often like so, you set them, you forget them.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
That's why i'm confused the 12F683 data sheet says that writes to the TMR0 reg clear the prescaler :?
The prescaler is not readable or writable. When
assigned to the Timer0 module, all instructions writing to
the TMR0 register will clear the prescaler.
mm, seems I need to send my crystal ball again for repair... she don't want to tell me the PIC you're using![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
That can be a little confusing. the prescaler keeps a count. Say it is set up for 1:8, it will count to 8 then roll over. the roll over is the new tmr count. When you write the tmr0 they are saying the count in pre scale will be reset back to 0. so if it had a count of 5, it will be cleared to zero. But the amount of pre scale will persist, it will still be 1:8
Steve, she just needs glasses, look above the quote
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Thanks for that CNC! makes sense. I'm using a 12F683 FYI. I'll do some bench testing
Hi,
You can't stop TMR0 when its in timer mode but you can switch it from timer- to counter mode which, as long as you don't have a any pulses coming on the T0CKI pin, will have the same effect as stopping it. As always YMMV but it's a "trick" that might work.Now I note you cant stop/start TMR0 I dont think that's a major issue in my application which is generating a 2khz pwm.
/Henrik.
Bookmarks