PDA

View Full Version : Compiler refuses to compile



CodeShredder
- 17th June 2008, 21:26
Hi,

My PICBASIC PRO compiler stubbornly refuses to compile any programs, even those that would compile before and 1 line test programs. When compiling a program dev6.pbp the error window showed these errors.


Eror DEV6.ASM 3:[235] opcode expected instead of "
Eror DEV6.ASM 5:[235] opcode expected instead of "
Eror DEV6.ASM 9:[238] preprocessor directive expected
Eror DEV6.ASM 9:[235] opcode eexpected instead of ' (('
Eror DEV6.ASM 10:[235] opcode expected instead of "
Eror DEV6.ASM 9:[238] preprocessor directive expected
Eror DEV6.ASM 9:[235] opcode eexpected instead of ' (('
Eror DEV6.ASM 10:[235] opcode expected instead of "
Etc.

This is the start of the DEV6.ASM file as seen in Windows notepad. (the first line is empty).


; PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc. All Rights Reserved.
PM_USED EQU 1

INCLUDE "16F877A.INC"


; Define statements.
#define CODE_SIZE 8
#define OSC 4

RAM_START EQU 00020h
RAM_END EQU 001EFh
RAM_BANKS EQU 00004h
BANK0_START EQU 00020h
BANK0_END EQU 0007Fh
BANK1_START EQU 000A0h
BANK1_END EQU 000EFh
BANK2_START EQU 00110h
BANK2_END EQU 0016Fh
BANK3_START EQU 00190h
BANK3_END EQU 001EFh
EEPROM_START EQU 02100h
EEPROM_END EQU 021FFh

R0 EQU RAM_START + 000h
R1 EQU RAM_START + 002h
R2 EQU RAM_START + 004h
R3 EQU RAM_START + 006h
R4 EQU RAM_START + 008h
R5 EQU RAM_START + 00Ah

etc....

I have reloaded the software, reset the compiler options in my MicroCode Studio Plus but to no avail.

Can anybody suggest a possible remedy?

Many thanks,
Mark

skimask
- 17th June 2008, 21:35
What is the actual dev6.pbp code that you are trying to compile/assemble?

CodeShredder
- 17th June 2008, 21:56
I assume it's Pic Basic - the Pic Basic Pro manual describes it as 'English-Like BASIC'

The target is a 16F877A mounted in an ME Labs LabX2 Experimenter board

Thanks
Mark

Archangel
- 18th June 2008, 01:18
Hi,

My PICBASIC PRO compiler stubbornly refuses to compile any programs, even those that would compile before and 1 line test programs. When compiling a program dev6.pbp the error window showed these errors.


Eror DEV6.ASM 3:[235] opcode expected instead of "
Eror DEV6.ASM 5:[235] opcode expected instead of "
Eror DEV6.ASM 9:[238] preprocessor directive expected
Eror DEV6.ASM 9:[235] opcode eexpected instead of ' (('
Eror DEV6.ASM 10:[235] opcode expected instead of "
Eror DEV6.ASM 9:[238] preprocessor directive expected
Eror DEV6.ASM 9:[235] opcode eexpected instead of ' (('
Eror DEV6.ASM 10:[235] opcode expected instead of "
Etc.

This is the start of the DEV6.ASM file as seen in Windows notepad. (the first line is empty).


; PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc. All Rights Reserved.
PM_USED EQU 1

INCLUDE "16F877A.INC"


; Define statements.
#define CODE_SIZE 8
#define OSC 4

RAM_START EQU 00020h
RAM_END EQU 001EFh
RAM_BANKS EQU 00004h
BANK0_START EQU 00020h
BANK0_END EQU 0007Fh
BANK1_START EQU 000A0h
BANK1_END EQU 000EFh
BANK2_START EQU 00110h
BANK2_END EQU 0016Fh
BANK3_START EQU 00190h
BANK3_END EQU 001EFh
EEPROM_START EQU 02100h
EEPROM_END EQU 021FFh

R0 EQU RAM_START + 000h
R1 EQU RAM_START + 002h
R2 EQU RAM_START + 004h
R3 EQU RAM_START + 006h
R4 EQU RAM_START + 008h
R5 EQU RAM_START + 00Ah

etc....

I have reloaded the software, reset the compiler options in my MicroCode Studio Plus but to no avail.

Can anybody suggest a possible remedy?

Many thanks,
Mark
Hi Mark, Looks as if you opened the .asm file of your program and not the .PBP or .BAS
File of the same name, close it and open the same file that has a .BAS or .PBP suffix and that should do the trick.

skimask
- 18th June 2008, 03:42
I assume it's Pic Basic - the Pic Basic Pro manual describes it as 'English-Like BASIC'

The target is a 16F877A mounted in an ME Labs LabX2 Experimenter board

Thanks
Mark

Well, I know that...........
PIC BASIC PRO

What's your code...or is that first post your actual, FULL code?

CodeShredder
- 18th June 2008, 10:46
Hi Joe S,

Yes, something is processing the assembler file but the file I have open in the editor window is the .pbp file, and I can't see anything in the options that might be telling the compiler to use the .asm file.

Hi Skimask,

The code above is not the Dev6.pbp code, but even in a one line program declaring a variable I get pretty much the same error messages. :{

Here is the beginning of the Dev6 code

TRISB = %11111111 ' Set PORTB to input
TRISC = %11111111 ' Set PORTC to input
TRISD = %11111111 ' Set PORTD to input
CMCON = 7 ' Set PORTA to digital
ADCON1 = 7 'Disable analog A\D
TRISA.0 = 0 'Set PORTA.0 to output
DEFINE OSC 4

init: Pause 500 ' Wait for LCD to start up
serout2 PORTA.0,84,[254]
serout2 PORTA.0,84,[88]
serout2 PORTA.0,84,["Hello"]
PORTC.7 = 0
PORTC.5 = 0

sFocus VAR Byte 'Holds value to which focus will be set later
panel VAR Byte 'panel number
pLast VAR Byte 'last panel selected
cFocus VAR Byte 'current focus
stSq VAR Byte 'start square
chars var byte[7] 'string chracters
'charsW var word[7] 'string chracters
stSize VAR Byte 'number of accumulated string chars
arStart VAR Byte
asciiCd VAR word
myPort VaR word
myString VAR WORD
listPos VAR BYTE

I think I shall have to strip it all off the computer and reload again.

Thanks
Mark

mackrackit
- 18th June 2008, 11:24
Does this mean you are not using MPASM?
PM_USED EQU 1

If so, maybe you should set up MCS to use MPASM.???

skimask
- 18th June 2008, 14:11
In the posts above, you have "INCLUDE 16F877A.INC"
Do you actually have that in the program? MCS/PBP already take care of that for you.


I think I shall have to strip it all off the computer and reload again.
Doesn't sound like a bad idea...clean it all out... While your at it, spend the $25 and upgrade to PBP 2.50A.

Here's the way I do a fresh reload. In my mind, I start from the PIC itself, and work my way backward, to the PBP source code itself...

1) Load the programmer software/hardware/firmware. Test it out, make sure it recognizes and handles the programmer the way it needs to handle it.

2) Load the latest version of MPLAB with any patches that need to be in there. Ensure that MPLAB can compile, and puts any result HEX files where you can find them.

3) Load PBP and any patches that need to be applied. Try it out, compile a file, assemble it (whether you do it, or you set up PBP to let MPLAB do it, either way)

4) Load MCS, connect it to PBP, connect it to MPASM.

5) Try it all out.

And don't load all of this into your "My Documents" folder. There seem to be the occassional 'long path' issues. It seems to work best for me if I put PBP in the root dir of C:, and MPLAB and MCS in their normal 'program files' folder.

CodeShredder
- 21st June 2008, 14:54
Hi Guys,

Thanks for all your advice, I have reloaded all the software elements and can now compile and load programs onto the PIC, but not sure why the compiler did not work in the first place.

After reloading the software I still got the same error messages about the assembler file, so looked again at the compile and program options. Under assembler it said 'not defined', the find buttons were greyed out and the check box saying Use MPASM was unchecked, so I checked that and compiled a program without any problems. During compiliation some progress dialog boxes came up which I have never seen before so I am assuming that in previous instalations a different compiler was installed. Does that sound likely?

After four evenings of frustration the joy that a little flashing LED can bring is surprising!

Thanks to all who assist with these newsgroups, as a web programmer and not an electronics engineer I can only see half the picture and the information gleaned from these posts and the archives is invaluable.

Cheers,
Mark

mackrackit
- 21st June 2008, 19:41
Do not know how far along you are in electronics and maybe you have been here
http://www.parallax.com/tabid/535/Default.aspx
There is a lot of good info and if you work through the experiments and adapt them to PBP I bet you will gain.