Picbasic Pro Demo assembly errors


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2007
    Posts
    4

    Cool Picbasic Pro Demo assembly errors

    Hi Everyone,

    After trying to go the MPLAB assembly language route with complete frustration, I have purchased the melabs U2 programmer and downloaded the Picbasic Pro Demo version (to start out with). I am trying to program a PIC1684A (yes, it's on the Demo Supported Device List) with the following code:

    TRISB = %11110000 'set portB pins 4, 5, 6, and 7 as outputs

    'define ports as variables
    Q1 VAR PORTB.4
    Q2 VAR PORTB.5
    Q3 VAR PORTB.6
    Q4 VAR PORTB.7

    'set each pin (portB 4 - 7) HIGH for 25ms in succession and loop
    loop:
    high Q1
    pause 25
    low Q1
    high Q2
    pause 25
    low Q2
    high Q3
    pause 25
    low Q3
    high Q4
    pause 25
    low Q4
    goto loop

    I get the following errors:
    Error PROGRAM1.MAC 6:[236] label 'rst?rp' undefined in pass 0
    Error PROGRAM1.MAC 6:[226] numeric constant or symbol name expected
    Error PROGRAM1.MAC 9:[236] label 'label' undefined in pass 0
    Error PROGRAM1.MAC 14:[224] endm directive only for use in macros
    Error PROGRAM1.MAC 17:[236] label 'label' undefined in pass 0
    Error PROGRAM1.MAC 18:[224] endm directive only for use in macros
    Error PROGRAM1.MAC 21:[236] label '1' undefined in pass 0
    Error PROGRAM1.MAC 22:[236] label 'regin' undefined in pass 0
    Error PROGRAM1.MAC 22:[236] label 'bitin' undefined in pass 0
    Error PROGRAM1.MAC 23:[224] endm directive only for use in macros
    Error PROGRAM1.MAC 23:[300] too many errors

    Mind you, the program got through the compile. It was when the assembly was being read that the errors started. I don't know enough about assembly to have a clue what is going on. OK - the questions:

    1) Am I running up against some restriction in the demo?
    2) Could my syntax be wrong somewhere (although I don't think it would have gotten past the compiler!)?
    3) Is there some wierd bug I don't know about? (I'm running an Athlon XP +3200 with WinXP SP2-pretty standard it would seem)

    I will appreciate any help I can get.

    Thanks! :-)

    Mike

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    that's strange indeed, using full-PBP don't return any error here...

    so i've downloaded and installed the demo on one of my machine, launched MicroCode studio which comes with, pasted your code in, point the compiler to PBPDemo folder.. no error at all.

    Now using MPASM as assembler... not much error.

    Using MPLAB and MPLAB plug-in... no error at all.

    Well, what may i suggest now

    I'm really happy to see that MicroCode Studio DEMO AND FREE version install EasyHID while the ol' black but PAID version don't... really nice
    Last edited by mister_e; - 31st December 2007 at 06:08.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Unhappy

    Hi,

    That line is "not so good" ...

    << TRISB = %11110000 'set portB pins 4, 5, 6, and 7 as outputs >>

    but as HIGH and LOW commands turn pins as they should be ...

    reminder: 0 for Output 1 for Input ...


    No compiling problems for me nor ...



    did you try to re-load PbP and MPLAB / OR MCS to their default directories ??? ... did you verify the MPLAB/PBP Paths ??? ...

    see here : http://melabs.com/support/mplab.htm

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Dec 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Red face re: Picbasic Pro assembly errors

    OK, now I feel really stupid. I did not have the assembler installed! I thought I had done that, but hadn't.

    I really appreciate your replies mister_e and Acetronics.

    Works like a charm now, but I'm sure I'll have some more tight spots.

    Thanks again,

    Mike

  5. #5


    Did you find this post helpful? Yes | No

    Default TRIS 1 = input, 0 = output

    There is an error in the code that is masked by your HIGH & LOW commands later on.

    TRISB = %11110000 sets port bits 7-4 as INPUTS and port bits 3-0 as OUTPUTS. This is opposite to what you are trying to do.

    The HIGH xxxx and LOW xxxx over ride the TRIS statement and force the selected pin to an output. If you later need more code space and use Portb.7 = 1 instead of HIGH PortB.7 to save a few bytes it will all crash.

    In the current implementation you do not need the TRISB statement so either fix it or scrap it.
    You can reduce code size by using the TRISB statement followed by
    PortB.n = 1 or PortB.n = 0

    HTH
    BrianT

  6. #6
    Join Date
    Dec 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Wink

    Hi BrianT,

    I guess you didn't read the post by Acetronics who told me (essentially) the same thing -problem corrected, thank you very much. In addition, I had replied back to my own post and said "Works like a charm now". Given that, why did you think I hadn't gotten it fixed - that is, unless you hadn't realy read the entire thread!

    Don't get me wrong, I appreciate the help, but I usually need to be told only once (unless it's by my wife - she says it takes her telling me three times before it really sinks in!)

    Anyway, thanks!

    Mike

Similar Threads

  1. PicBasic Pro Demo
    By nbrucew in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th August 2009, 19:10
  2. Replies: 3
    Last Post: - 1st July 2008, 21:07
  3. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 18:31
  4. Question for all that use MELABS PICBASIC PRO
    By oskuro in forum Off Topic
    Replies: 2
    Last Post: - 24th March 2005, 17:15
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 21:19

Members who have read this thread : 1

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