Hello. I've built an automatic cat feeder using an 08M chip with a simple program to run a small motor every 12 hours. The motor runs for approximately 8 seconds to turn a cylinder which dispenses the food.
The problem is that there seems to be a 2+ minute delay for every 24 hours. This isn't a huge issue but I'm wondering if the internal clock is less than accurate or if it's a problem with the program I've written. I realize that the 25+/- seconds/day pause and motor run time would be an issue but what about the other 90+ seconds?
The program is designed for two inputs - one is for a manual feeding and the other for a timed feeding. This issue involves the timed feeding ("away" routine). The program is shown below. Any help or explanation would be appreciated. Thanks.
MAIN:
PAUSE 1000
IF PIN3=1 THEN MANUAL
IF PIN4=1 THEN AWAY
GOTO MAIN
MANUAL:
PAUSE 3000 'WAIT 3 SECONDS BEFORE DUMPING FOOD
HIGH 2 'TURN ON OUTPUT TO SWITCH ON TIMER & MOTOR CURRENT W/MOMENTARY SWITCH
PAUSE 8425 'RUN MOTOR FOR 8.425 SECONDS (360 DEGREE TURN)
LOW 2 'STOP MOTOR TO REFILL HOPPER
GOTO MAIN
AWAY:
PAUSE 3000 'WAIT 3 SECONDS BEFORE DUMPING FOOD
HIGH 2 'TURN ON OUTPUT TO SWITCH ON TIMER & MOTOR CURRENT
PAUSE 8425 'RUN MOTOR FOR 8.425 SECONDS (360 DEGREE TURN)
LOW 2 'STOP MOTOR TO REFILL HOPPER
FOR B1 = 1 TO 200 'START COUNTER
PAUSE 60000 'PAUSE FOR 60 SECONDS PER CYCLE (200 CYCLES = 3 HOURS 20 MINUTES)
NEXT B1
FOR B2 = 1 TO 200 'START COUNTER
PAUSE 60000 'PAUSE FOR 60 SECONDS PER CYCLE (200 CYCLES = 3 HOURS 20 MINUTES)
NEXT B2
FOR B3 = 1 TO 200 'START COUNTER
PAUSE 60000 'PAUSE FOR 60 SECONDS PER CYCLE (200 CYCLES = 3 HOURS 20 MINUTES)
NEXT B3
FOR B4 = 1 TO 120 'START COUNTER
PAUSE 60000 'PAUSE FOR 60 SECONDS PER CYCLE (120 CYCLES = 2 HOURS)
NEXT B4
GOTO MAIN 'START OVER AND CHECK IF PIN 4 IS STILL HIGH
The problem is that there seems to be a 2+ minute delay for every 24 hours. This isn't a huge issue but I'm wondering if the internal clock is less than accurate or if it's a problem with the program I've written. I realize that the 25+/- seconds/day pause and motor run time would be an issue but what about the other 90+ seconds?
The program is designed for two inputs - one is for a manual feeding and the other for a timed feeding. This issue involves the timed feeding ("away" routine). The program is shown below. Any help or explanation would be appreciated. Thanks.
MAIN:
PAUSE 1000
IF PIN3=1 THEN MANUAL
IF PIN4=1 THEN AWAY
GOTO MAIN
MANUAL:
PAUSE 3000 'WAIT 3 SECONDS BEFORE DUMPING FOOD
HIGH 2 'TURN ON OUTPUT TO SWITCH ON TIMER & MOTOR CURRENT W/MOMENTARY SWITCH
PAUSE 8425 'RUN MOTOR FOR 8.425 SECONDS (360 DEGREE TURN)
LOW 2 'STOP MOTOR TO REFILL HOPPER
GOTO MAIN
AWAY:
PAUSE 3000 'WAIT 3 SECONDS BEFORE DUMPING FOOD
HIGH 2 'TURN ON OUTPUT TO SWITCH ON TIMER & MOTOR CURRENT
PAUSE 8425 'RUN MOTOR FOR 8.425 SECONDS (360 DEGREE TURN)
LOW 2 'STOP MOTOR TO REFILL HOPPER
FOR B1 = 1 TO 200 'START COUNTER
PAUSE 60000 'PAUSE FOR 60 SECONDS PER CYCLE (200 CYCLES = 3 HOURS 20 MINUTES)
NEXT B1
FOR B2 = 1 TO 200 'START COUNTER
PAUSE 60000 'PAUSE FOR 60 SECONDS PER CYCLE (200 CYCLES = 3 HOURS 20 MINUTES)
NEXT B2
FOR B3 = 1 TO 200 'START COUNTER
PAUSE 60000 'PAUSE FOR 60 SECONDS PER CYCLE (200 CYCLES = 3 HOURS 20 MINUTES)
NEXT B3
FOR B4 = 1 TO 120 'START COUNTER
PAUSE 60000 'PAUSE FOR 60 SECONDS PER CYCLE (120 CYCLES = 2 HOURS)
NEXT B4
GOTO MAIN 'START OVER AND CHECK IF PIN 4 IS STILL HIGH