Tmro 1 Hour Assembler

Status
Not open for further replies.

medallo21

New Member
Hello friends,

I want to temporizer by means of tmro 6 hours as of the moment at which pic ignites, some of you can give an example or help me me with asm.

Thank you very much
 
medallo21 said:
Hummm, is nothing no based on tmro.

TMR0 is the most useless of the timers, I would suggest you use the far better TMR2 instead, which is used in the 7 segment and 8x8 LED tutorials for the multiplexing.
 
Nigel Goodwin said:
TMR0 is the most useless of the timers, I would suggest you use the far better TMR2 instead, which is used in the 7 segment and 8x8 LED tutorials for the multiplexing.

I like TMR0
With a proper crystal it's makes an awesome RTCC timebase Jiffy, it's lack of love means it's almost always available.
 
blueroomelectronics said:
I like TMR0
With a proper crystal it's makes an awesome RTCC timebase Jiffy, it's lack of love means it's almost always available.

Except to use it as a RTCC of any accuracy you need to compensate for it's limitations, it's not just 'load and run' like TMR2.
 
blueroomelectronics said:
What limitations? With a proper crystal like 9.8304MHz it works like a charm, serial ports too.

Check the technical bulletins, for an accurate RTCC you have to compensate for the manual reloading of the timer, there was loads about it on the PICList back in the distant past.
 
Nigel Goodwin said:
Check the technical bulletins, for an accurate RTCC you have to compensate for the manual reloading of the timer, there was loads about it on the PICList back in the distant past.

Not if you don't reload it. This will keep good time with a 4MHz crystal.
Code:
//timer 0 prescaller set to 16

Interrupt{
    if(TMR0IF){
        ticks-=4096;
        if(ticks<0){
            ticks+=1000000;
            Seconds++;
        }
	TMR0IF=0;
    }
}

//or, to keep to integers,

Interrupt{
    if(TMR0IF){
        ticks-=64;
        if(ticks<0){
            ticks+=15625;
            Seconds++;
        }
	TMR0IF=0;
    }
}

Mike.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…