PDA

View Full Version : Assembler errors trying to use MIBAM



ozarkshermit
- 9th December 2010, 16:18
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




'************************************************* ***************
'* 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

Darrel Taylor
- 9th December 2010, 18:03
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 ...

L1B VAR BYTE ;PORTC.0
L2B VAR BYTE ;PORTC.2
L3B VAR BYTE ;PORTC.4

ozarkshermit
- 9th December 2010, 18:28
Thanks Darrel

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

Ken

Darrel Taylor
- 9th December 2010, 18:40
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.

ozarkshermit
- 9th December 2010, 19:13
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

Darrel Taylor
- 9th December 2010, 19:28
You may want to download the MIBAM.pbp (http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3191&d=1234363057) 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)

ozarkshermit
- 9th December 2010, 20:20
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

ozarkshermit
- 11th December 2010, 01:47
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

ozarkshermit
- 11th December 2010, 01:50
NOT MYBAM - - - MIBAM

Ken