Assembler errors trying to use MIBAM


Closed Thread
Results 1 to 9 of 9
  1. #1

    Default Assembler errors trying to use MIBAM

    I have been trying to use the simple example of MYBAM, but keep getting two assembler errors.
    I have posted the code below.

    First, MYBAM is installed in C:\PBPW.EXE

    I have the processor type (18F2520) selected correctly (other programs assemble correctly)

    Since an 18F device is selected, assembling with MPASM is required and selected

    I have PBPL selected since the final program will be using LONGS

    I'm using PBP2.60.

    The two errors I get are:

    Error 129 xxxxxxx\mybam.asm 1 : expected (end)
    Error 131 xxxxxxxx\mybam.asm 1 : processor type is undefined

    As is usually the case with me, some stupid omission somewhere, but I can't find it

    Below is the code, mostly cut and pasted from the example - all I changed was the RED - GREEN - BLUE definitions to L1B L2B L3B


    Code:
    '****************************************************************
    '*  Name    :MIBAM TESTS                                    *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2010 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 12/9/2010                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '**************************************************************
    INCLUDE "alldigital.pbp" 
    INCLUDE "MIBAM.pbp"                 ' Mirror Image BAM module                                           
        OSCCON = $70
        OSCTUNE.6 = 1                                                
    DEFINE OSC 32
    
    TRISA = %00000000
    TRISB = %00000000
    TRISC = %00000000
    
    L1B         VAR    PORTC.0      
    L2B         VAR    PORTC.2      
    L3B         VAR    PORTC.4     
    
    BAM_COUNT   CON 3                     ; How many BAM Pins are used?
    Speed       CON 20      ' Smaller = Faster
    Brightness  CON 200     ' Max DutyCycle
    
    
      ASM
    BAM_LIST  macro                     ; Define PIN's to use for BAM
         BAM_PIN (PORTC,0, L1B)         ;   and the associated Duty variables
         BAM_PIN (PORTC,2, L2B)
         BAM_PIN (PORTC,4, L3B)
      endm
      BAM_INIT  BAM_LIST                ; Initialize the Pins
    ENDASM
    
    
    
      
    Main:
        FOR L1B = 0 to Brightness -1          ' Ramp up 1 by 1
            PAUSE Speed
        NEXT L1B
        FOR L2B = 0 to Brightness -1
            PAUSE Speed
        NEXT L2B
        FOR L3B = 0 to Brightness -1
            PAUSE Speed
        NEXT L3B
    
        FOR L1B = Brightness to 1 STEP -1     ' Ramp down 1 by 1
            PAUSE Speed
        NEXT L1B
        FOR L2B = Brightness to 1 STEP -1
            PAUSE Speed
        NEXT L2B
        FOR L3B = Brightness to 1 STEP -1
            PAUSE Speed
        NEXT L3B
    GOTO Main
    
    End
    Last edited by Darrel Taylor; - 9th December 2010 at 17:57. Reason: Added [code][/code] so I could see the indentation

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The BAM_PIN (PORTC,0, L1B) statements define the PIN used and the dutycycle variable.

    But instead of a byte variable for the dutycycle, L1B, L2B and L3B are defined as the PINs again.

    Change them to ...
    Code:
    L1B VAR BYTE ;PORTC.0 
    L2B VAR BYTE ;PORTC.2 
    L3B VAR BYTE ;PORTC.4
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thanks Darrel

    I see where that was an error - I made the changes but still get the same two assembler errors . . . .

    Ken

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The "processor type is undefined" error usually means that MicroCode studio is pointing to the wrong MPASM installation.

    In MCS go to View > Compile and Program Options > assembler tab.
    The path above the "Find" buttons should read ... c:\program files\microchip\mpasm suite
    On 64-bit systems it's ... c:\program files (x86)\microchip\mpasm suite

    If the path is different, click the "Find manually" button and point it to the correct folder.
    DT

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Thanks...

    That is not it however - the path is correct . I have been assembling and compiling a large program for this project, with no problems. When trying to assemble this small sample program is when I get the errors. As soon as I include MYBAM I get the error. If I comment out that include, and the related MIBAM program, it assembles fine.
    ???
    thanks
    Ken

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You may want to download the MIBAM.pbp file again. Maybe you got a bad download.

    I've compiled your program here (after the L1B, L2B, L3B changes) and there's no errors.

    If you still have problems, send me the .LST file. (support at melabs.com)
    DT

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Thanks Darell

    I did try downloading MIBAM a couple of times with the same results.

    I just sent a copy of the .lst file to the support address - -

    Ken

  8. #8


    Did you find this post helpful? Yes | No

    Red face Problem solved

    Thanks to DT's expert help, my problem has been solved. It was my problem, because I named my program MYBAM - which caused the assembly problems. Don't name your programs the same as the macro - - -

    Ken

  9. #9


    Did you find this post helpful? Yes | No

    Unhappy Whoops

    NOT MYBAM - - - MIBAM

    Ken

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