Ian Walters
New Member
Hi
I'm trying to write a simple program using a 16F628 chip to animate a model. I'm very new to this and totally inexperienced and have only accquired enough knowledge to complete my needs..
The problem I have is that the program runs perfectly but then runs again and keeps on running continuously despite my placing an "END" command.
I read on another forum that the Watchdog Timer may need disabling to prevent this happening? If so, can anyone tell me the command to make this happen?
This is the program:
AllDigital
TRISA = %11111111
TRISB = %00100000
Symbol motor = PORTB.0
Symbol schip = PORTB.1
Symbol voice = PORTB.2
Symbol beams = PORTB.3
Symbol yellow1 = PORTB.4
Symbol switch = PORTB.5
main:
While PORTB.5 = 0
Wend
If PORTB.5 = 1 Then
Goto start
Else
Goto main
Endif
start:
High yellow1
WaitMs 500
Low yellow1
High schip
High motor
WaitMs 1600
High voice
WaitMs 3000
Low voice
WaitMs 1500
High voice
WaitMs 2800
Low voice
WaitMs 600
High beams
WaitMs 1600
Low beams
WaitMs 1000
Low schip
Low motor
WaitMs 30000
Goto main
End
I would be extremely grateful for any help on this but please speak slowly and use little words!
Thanks in anticipation
I'm trying to write a simple program using a 16F628 chip to animate a model. I'm very new to this and totally inexperienced and have only accquired enough knowledge to complete my needs..
The problem I have is that the program runs perfectly but then runs again and keeps on running continuously despite my placing an "END" command.
I read on another forum that the Watchdog Timer may need disabling to prevent this happening? If so, can anyone tell me the command to make this happen?
This is the program:
AllDigital
TRISA = %11111111
TRISB = %00100000
Symbol motor = PORTB.0
Symbol schip = PORTB.1
Symbol voice = PORTB.2
Symbol beams = PORTB.3
Symbol yellow1 = PORTB.4
Symbol switch = PORTB.5
main:
While PORTB.5 = 0
Wend
If PORTB.5 = 1 Then
Goto start
Else
Goto main
Endif
start:
High yellow1
WaitMs 500
Low yellow1
High schip
High motor
WaitMs 1600
High voice
WaitMs 3000
Low voice
WaitMs 1500
High voice
WaitMs 2800
Low voice
WaitMs 600
High beams
WaitMs 1600
Low beams
WaitMs 1000
Low schip
Low motor
WaitMs 30000
Goto main
End
I would be extremely grateful for any help on this but please speak slowly and use little words!
Thanks in anticipation