Today I used GCGB Version 0.9 14/2/2010 to generate the following program to turn an LED connected to GP0 (pin 7) of a PIC12F683 on and off:
;Chip Settings
#chip 12F683,4
Dir GPIO.0 Out
main:
Set GPIO.0 On
Wait 0.5 s
Set GPIO.0 Off
Wait 0.5 s
Goto main
The program compiled and assembled without error, and simulated okay in MPLAB SIM, but didn't run correctly. The LED connected to GP0 came on and stayed on.
When I changed the 'Wait 0. 5 s' icons to 'Wait 500 ms', the program ran correctly:
;Chip Settings
#chip 12F683,4
Dir GPIO.0 Out
main:
Set GPIO.0 On
Wait 500 ms
Set GPIO.0 Off
Wait 500 ms
Goto main
Thanks in advance for using this information to make GCGB better.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Today I used GCGB Version 0.9 14/2/2010 to generate the following program to turn an LED connected to GP0 (pin 7) of a PIC12F683 on and off:
;Chip Settings
#chip 12F683,4
Dir GPIO.0 Out
main:
Set GPIO.0 On
Wait 0.5 s
Set GPIO.0 Off
Wait 0.5 s
Goto main
The program compiled and assembled without error, and simulated okay in MPLAB SIM, but didn't run correctly. The LED connected to GP0 came on and stayed on.
When I changed the 'Wait 0. 5 s' icons to 'Wait 500 ms', the program ran correctly:
;Chip Settings
#chip 12F683,4
Dir GPIO.0 Out
main:
Set GPIO.0 On
Wait 500 ms
Set GPIO.0 Off
Wait 500 ms
Goto main
Thanks in advance for using this information to make GCGB better.
GCBASIC doesn't have any ability to deal with floating point numbers, so everything has to be done using whole numbers.
I will add a bit to the help article to explain that, and a compiler error message so that it's a bit more obvious.