2003-03-31 02:43 AM
2003-03-31 01:16 AM
Hello again,
i have some questions regarding the increment of the timers. Is the Timer register incremented once a cycle? To generate a precies Tick every 50 ms with a clock at 20MHz is the required reload value 0x03E8?(20Mhz*50ms)? Thanks Vasilios2003-03-31 01:50 AM
OK here is the code bit which confused me:
/ * this. Timeout is set to 5 msec assuming a 20 MHz bus /// --------------------------------------------------------------- /// Configuration of CC1 timer 0: /// --------------------------------------------------------------- /// - timer 0 works in timer mode /// - prescaler factor is 8 /// - timer 0 run bit is set T01CON = 0x0000; // load CAPCOM1 timer 0 and timer 1 T0 = 0xCF2C; // load CAPCOM1 timer 0 register T0REL = 0xCF2C; // load CAPCOM1 timer 0 reload register According to the c167 users manual (is there any better document around?) the resolution with a 20Mhz clock is 400ns, so the loaded value would generate a 21ms delay wouldn't it? Thanks (The Value i think i need for 50ms is a prescaler of 16 and a register value of 0xF424) ...2003-03-31 02:43 AM
AHEM,
counting upwards.... Next time i make sure i read better before asking.. Vasilios