I modified the "blinkLED" program for a 16F716 PIC (#chip 16F716, 4). The compiler produced the following error message: "system.h (122): Missing bit in SET command", but the program appeared to compile. I havent tried to program the PIC yet. Any thoughts/suggestions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The obvious one would be whether you have set the port or port bit as In or Out, or perhaps you left off the port bit in the #define command. The not so ovious would be how you are trying to set the bit. If you are trying to set multiple bits at once, then you could use a command like PortB = b'00001111'. Just guessing here, without some code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks. I tried your recommendations. Still get the same error message. I was using the sample BlinkLED program in the GCBASIC download package. All I changed was the chip header at first. Curiously, your suggestions worked with a variety of other PIC's (e.g. 628, 630, 648, 684) that gave different error messages with the code as written in the package. Here is the original code:
'A program to flash two LEDs on PORTB, bits 0 and 1
'Chip model
#chip 16F819, 20
'Set the pin directions
dir PORTB.0 out
dir PORTB.1 out
'Main routine
Start:
'Turn one LED on, the other off
SET PORTB.0 ON
SET PORTB.1 OFF
wait 1 sec
'Now toggle the LEDs
SET PORTB.0 OFF
SET PORTB.1 ON
wait 1 sec
'Jump back to the start of the program
goto Start
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I was reading more into it than what you have there for code. Sample program compiles fine with the 16f716,4 header. Its a mystery, maybe try reinstalling the GCBasic package?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I assume you're using the standard GCBASIC 0.9.3.0 release?
If so, then there is a bug in the A/D initialisation code. Line 122 of the system.h file is a set command that turns off the ADFM bit. However, ADFM does not exist on the 16F716, hence the error. The A/D initialisation code contains quite a few other issues which I've fixed since the 0.9.3.0 release.
I modified the "blinkLED" program for a 16F716 PIC (#chip 16F716, 4). The compiler produced the following error message: "system.h (122): Missing bit in SET command", but the program appeared to compile. I havent tried to program the PIC yet. Any thoughts/suggestions.
The obvious one would be whether you have set the port or port bit as In or Out, or perhaps you left off the port bit in the #define command. The not so ovious would be how you are trying to set the bit. If you are trying to set multiple bits at once, then you could use a command like PortB = b'00001111'. Just guessing here, without some code.
Thanks. I tried your recommendations. Still get the same error message. I was using the sample BlinkLED program in the GCBASIC download package. All I changed was the chip header at first. Curiously, your suggestions worked with a variety of other PIC's (e.g. 628, 630, 648, 684) that gave different error messages with the code as written in the package. Here is the original code:
'A program to flash two LEDs on PORTB, bits 0 and 1
'Chip model
#chip 16F819, 20
'Set the pin directions
dir PORTB.0 out
dir PORTB.1 out
'Main routine
Start:
'Turn one LED on, the other off
SET PORTB.0 ON
SET PORTB.1 OFF
wait 1 sec
'Now toggle the LEDs
SET PORTB.0 OFF
SET PORTB.1 ON
wait 1 sec
'Jump back to the start of the program
goto Start
Sorry, I was reading more into it than what you have there for code. Sample program compiles fine with the 16f716,4 header. Its a mystery, maybe try reinstalling the GCBasic package?
I assume you're using the standard GCBASIC 0.9.3.0 release?
If so, then there is a bug in the A/D initialisation code. Line 122 of the system.h file is a set command that turns off the ADFM bit. However, ADFM does not exist on the 16F716, hence the error. The A/D initialisation code contains quite a few other issues which I've fixed since the 0.9.3.0 release.
You can download the latest build of GCBASIC from http://gcbasic.sourceforge.net/newfiles/update.zip which includes the fixed initialisation routine.
Hugh & Kent: Thanks for the tips on reinstall/update. Now it works on the 716!