|
From: pito <pi...@vo...> - 2010-07-06 23:16:17
|
Hi friends, I've found 2constant in lib but I cannot find 2variable in
the libraries. Is that word available in amforth 4.0? I'm going to redo
a routine I'm using in my PIC dev for a quite precise 1sec tick:
int32 Ticker;
TIMER2_FREQUENCY 19999870 (in Hz=xtal freq when atmega, /4 when pic)
#int_TIMER2
void TIMER2_isr()
{
Ticker -= 65536; // Decrement ticker by clocks
per interrupt (16bit timer), or 256*prescaler when atmega32 and timer2
if ( Ticker < 65536 ) // If second has expired
{ Ticker += TIMER1_FREQUENCY; // Increment ticker by clocks
per second
Seconds++; // Increment number of seconds
}
The 2variable is required for higher precision. Any help where to find
2variable?
Pito.
|