Endless supply of 'syntax error's.


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Welcome.

    First off, do not
    I put 'LIST P=16F506' (no, not the single-quotes too) at the top and it bombs out with that as the first syntax error in BLINK.BAS.
    Then it moves on to my next line - INCLUDE "P16F506.INC" (or M16F506.INC) -
    PBP will do all of that. All you need to do is select the proper PIC from the dropdown box on the toolbar.

    If you want to set the fuses in code space then the *.inc for the chip in the PBP directory needs to have a line or two commented out.
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    A basic program should look something like this
    Code:
     @ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
    
       DEFINE OSC 4
       CNT  VAR BYTE
       START:
       FOR CNT = 0 TO 10
       HIGH PORTC.1
       LOW PORTC.0
       PAUSE 250
       LOW PORTC.1
       HIGH PORTC.0
       PAUSE 250
       NEXT CNT
      
       FOR CNT = 0 TO 100
       PORTC = %11
       PAUSE CNT
       PORTC = %00
       PAUSE CNT
       NEXT CNT
       GOTO START
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Dec 2009
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Selecting the target device

    The first thing I do when running these 'toolbar rich' programs is close them all. Rarely do I need something so often that 'going to the menu to select it' is a hassle, so, I prefer the increased headroom for code space. Guess what? The only toolbar thing not duplicated on the menu bar is 'target device'. I see in the registry that my 16F506 is specified, yet when I close everything and start again from scratch, it's not used to make a default selection. You know, a little 'get-it, string-search and set-listbox-index' would've been a nice touch.
    Anyway....
    Thanks. It's going to take some getting used to - like a 'double-clutching bulldozer operator' who gets into an electric car that has the 'ON' switch in the seat - it feels weird to 'not do something'.

    While I did look at 16F506.INC early on I only recalled that it made a selection between the 'M' and the 'P' versions - didn't notice/remember that it also made the presumptive decision to set the fuses. Now I know.

    BTW, the M16F506.INC is lacking the
    EC_OSC equ 0FF80003h ; XXXX XXXX X011
    in it's config definitions.

    ALL is now well. I hope to be able to take the load off you guys one day and solve some problems myself.:-)

Similar Threads

  1. Compilation errors - strange
    By tetanus4 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th October 2009, 19:04
  2. 3 phase supply detector challenge
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 15th May 2009, 07:54
  3. Picbasic Pro Demo assembly errors
    By mikeRho in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd January 2008, 06:41
  4. Replies: 2
    Last Post: - 10th July 2006, 01:05
  5. Microcode Studio Plus compile/assmebly errors
    By mikehagans in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th February 2006, 21:31

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts