AlGeorge
Member level 1
- Joined
- Nov 17, 2009
- Messages
- 39
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- Waihi Beach
- Activity points
- 1,606
Using MPLAB with PIC10F206/int 4Mhz osc, MPLAB stopwatch says 948.031000 ms to line>> if (++seconds>59) below.
It says 47.400000 ms >> if (part_seconds<20) return;
This should mean the onboard clock will run way too fast, but in fact it is running much slower than the MPLAB stopwatch suggests on 4Mhz clock. EG a second anomaly per minute. See code below any suggestions please?
It says 47.400000 ms >> if (part_seconds<20) return;
This should mean the onboard clock will run way too fast, but in fact it is running much slower than the MPLAB stopwatch suggests on 4Mhz clock. EG a second anomaly per minute. See code below any suggestions please?
Code:
void Clock_Proc(void)
{
static unsigned int timecheck;
clrwdt (); //if wdt enabled, this will reset
astate=0;
TMR0=Timer_offset;
++part_seconds;
if (part_seconds<20) return;
part_seconds=0;
if (++seconds>59)