Endless supply of 'syntax error's.


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009
    Posts
    5

    Default Endless supply of 'syntax error's.

    It's something stupid - I've written 10's of K's of LOC in 4-bit paged assembly in my life but I'm having a tough time 'letting' PBP in MicroCode Studio do the work for me. After cranking out a bunch of code 'by the book', I've now retreated back to BLINK.BAS. The particulars...
    PBP Ver.2.50c, MCS Ver.3.0.0.5, target uC= PIC16F506

    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) - which seems OK 'cause all the errors now are in P16F506.INC.
    Starting with the first line, whatever it is, every line is an excuse for it to fail the 'syntax test' - starting with ...
    IFNDEF __16F506 on line 37 in P16F506.inc and
    the first 'DEFINE... ' in M16F506.INC.

    I've turned 'Use MPASM' on and off - no diff.

    I'm a tidy sort - I like MY files to be in MY folder - have told MCS what my favorite default folder is - and have put all 'called for' files in there. This wouldn't be one of those 'MCS programmer is a dictator' things, would it?

    If one of you fine fellow 'code spewers' could clue me in - or spell out EVERYTHING I need -and where I need it to be - to get BLINK.BAS to compile and run on a PIC16F506 , I'll appreciate it and probably not have to bother anyone here again.;-)

    PS. While I'm here - I'm using PicStart Plus that's been upgraded with the latest flash firmware/module. Is there some reason why MCS has left it off the drop-down list of 'Available Programmers'?

  2. #2
    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.

  3. #3
    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 : 1

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