Menu

16F716 compiler error

2007-12-25
2013-05-30
  • Nobody/Anonymous

    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.

     
    • kent_twt4

      kent_twt4 - 2007-12-25

      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.

       
    • Nobody/Anonymous

      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

       
    • kent_twt4

      kent_twt4 - 2007-12-26

      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?

       
    • Hugh Considine

      Hugh Considine - 2007-12-26

      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.

       
    • Scotty1226

      Scotty1226 - 2007-12-26

      Hugh & Kent:  Thanks for the tips on reinstall/update.  Now it works on the 716!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.