PICBASIC Pro examples will not compile????


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2010
    Posts
    12

    Default PICBASIC Pro examples will not compile????

    My programming experience is small, but I have done Z80, 6502 and 68000 assembly
    programming and Basic.

    I am just starting out using PIC BASIC Pro and I find that the examples in the PBP manual and
    MicroCode Studio Help will not compile correctly using MicroCode Studio. In the past, I have used the examples and samples to form a basis and learn, but when the examples and samples don't work, it becomes very frustrating.

    I have used 'cut and paste' to minimize typos, but the code with not compile without syntax errors. This is driving my crazy.

    My project is to read in a string of characters using HSERIN (this part I have working), then LOOKUP
    the 10th character in the string and act upon the results.

    What am I doing wrong?

    Thanks,

    John

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default couple questions

    What errors do you get?

    Do you have any specific examples which do not compile for you?

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


    Did you find this post helpful? Yes | No

    Default

    Welcome to the forum.

    Not all examples work with all chips due to different ports and registers.
    Which example and PIC are you using?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Jul 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    What errors do you get?

    Do you have any specific examples which do not compile for you?

    Right out of the MicroCode Studio Help:


    FOR B0 = 0 TO 5 ' Count from 0 to 5
    LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
    SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
    NEXT B0 ' Do next character

  5. #5
    Join Date
    Jul 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Welcome to the forum.

    Not all examples work with all chips due to different ports and registers.
    Which example and PIC are you using?
    Thank you. I am enjoying the site.

    I am using the 16F627.

    John

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by N6VMO_ View Post
    Right out of the MicroCode Studio Help:


    FOR B0 = 0 TO 5 ' Count from 0 to 5
    LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
    SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
    NEXT B0 ' Do next character
    You have to define your variables B0 and B1. Or you can add this include to your program. See page 24 ish of the manual.
    Code:
    Include "bs2defs.BAS"
    
    FOR B0 = 0 TO 5 ' Count from 0 to 5
    LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
    SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
    NEXT B0 ' Do next character

  7. #7
    Join Date
    Jul 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    What errors do you get?

    Do you have any specific examples which do not compile for you?
    ERROR Line 26: ID CURHOME2 is not a LABEL. (9600 BAUD HSERIN LOOKUP EXAMPLE rev 1.pbp)
    ERROR Line 33: Expected '['. (9600 BAUD HSERIN LOOKUP EXAMPLE rev 1.pbp)
    ERROR Line 33: Expected ']'. (9600 BAUD HSERIN LOOKUP EXAMPLE rev 1.pbp)
    ERROR Line 41: Expected ']'. (9600 BAUD HSERIN LOOKUP EXAMPLE rev 1.pbp)

    As you can see, my LOOKUP routine even makes a LABEL (line 26) have a syntax error.

  8. #8
    Join Date
    Jul 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    You have to define your variables B0 and B1. Or you can add this include to your program. See page 24 ish of the manual.
    Code:
    Include "bs2defs.BAS"
    
    FOR B0 = 0 TO 5 ' Count from 0 to 5
    LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
    SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
    NEXT B0 ' Do next character
    OK, I will give it a try...and read a bit more too.

    Thank you!

    John

Members who have read this thread : 0

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

Posting Permissions

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