PDA

View Full Version : Errors In MPLAB 8.02



HOTLNC
- 29th May 2008, 14:55
I am an experienced PIC and MPLAB user (Assembly language only). I'm trying get started in PicBasicPro and am hitting a brick wall. I'm doing a test using the BLINK.asm program. When i BUILD the file, I get an "I/O error,: file not open for input" with OK button. If you press OK, I receive the following text in the OUTPUT screen:

Executing: "C:\pbp\PBPW.EXE" -ampasmwin -oq -z -p18F442 "blink.bas"
PicBasic Pro Compiler 2.45a, (c) 1998, 2004 microEngineering Labs, Inc.
All Rights Reserved.
Error processing COD file C:\pbp\Files\blink.COD
Warning[223] C:\PBP\FILES\P18F442.INC 18 : Redefining processor.
Warning[223] C:\PBP\FILES\P18F442.INC 37 : Redefining processor.
Warning[223] C:\PBP\FILES\P18F442.INC 56 : Redefining processor.
Warning[223] C:\PBP\FILES\P18F442.INC 75 : Redefining processor.
Error[138] C:\PBP\FILES\P18F442.INC 76 : Include files nested too deep
Error[113] C:\PBP\FILES\P18F442.INC 77 : Symbol not previously defined (_CONFIG1H)
Warning[230] C:\PBP\FILES\P18F442.INC 77 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[126] C:\PBP\FILES\P18F442.INC 77 : Argument out of range (not a valid config register address)
Error[113] C:\PBP\FILES\P18F442.INC 78 : Symbol not previously defined (_CONFIG2H)
Warning[230] C:\PBP\FILES\P18F442.INC 78 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[126] C:\PBP\FILES\P18F442.INC 78 : Argument out of range (not a valid config register address)
Error[113] C:\PBP\FILES\P18F442.INC 79 : Symbol not previously defined (_CONFIG4L)
Warning[230] C:\PBP\FILES\P18F442.INC 79 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Halting build on first failure as requested.
BUILD FAILED: Thu May 29 08:45:38 2008


I've installed all patches and have the PicBasic Pro Tool Set selected.

Any idea what I am doing wrong?

Thanks and Best Regards,

skimask
- 29th May 2008, 15:12
http://www.picbasic.co.uk/forum/showthread.php?t=543&highlight=presetting+config+bits

And an upgrade to 2.50 might not be a bad idea either...

Acetronics2
- 29th May 2008, 16:12
Hi,

Nor an upgrade to MPLAB 8.10 ...

BTW ... I'm curious to see the .bas listing ... just an idea !

Alain

Bruce
- 29th May 2008, 17:49
Have you setup MPLAB for PBP like shown here? http://www.microengineeringlabs.com/support/mplab.htm

HOTLNC
- 29th May 2008, 19:28
I've fixed the Configuration bits. Thanks for that!

I'm going to update to MPLAB 8.1. In the meantime, Here is the .bas file:

'************************************************* ***************
'* 18F442.BAS *
'* *
'* By : Leonard Zerman, Jeff Schmoes *
'* Notice : Copyright (c) 2001 micro Engineering Labs, Inc. *
'* All Rights Reserved *
'* Date : 08/28/01 *
'* Version : 2.40 *
'* Notes : *
'************************************************* ***************

BANKA $0000, $007F
BANK0 $0080, $00FF
BANK1 $0100, $01FF
BANK2 $0200, $02FF
'EEPROM $F00000, $F000FF
LIBRARY "PBPPIC18"

include "PIC18EXT.BAS"

PORTL VAR PORTB
PORTH VAR PORTC
TRISL VAR TRISB
TRISH VAR TRISC

include "PBPPIC18.RAM"

'*-----------------------* EOF 18F442.BAS *---------------------*
' Example program from manual to blink an LED connected to PORTB.0 about once a second

loop: High 0 ' Turn on LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds

Low 0 ' Turn off LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds

Goto loop ' Go back to loop and blink LED forever


End

MPLAB gives the following errors now:

Executing: "C:\Pb\PBPW.EXE" -ampasmwin -oq -z -p18F442 "blink1.BAS"
PicBasic Pro Compiler 2.45a, (c) 1998, 2004 microEngineering Labs, Inc.
All Rights Reserved.

C:\PBP\PIC18EXT.BAS ERROR Line 12: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 13: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 14: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 15: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 16: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 17: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 18: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 19: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 20: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 21: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 22: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 23: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 24: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 25: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 26: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 27: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 28: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 29: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 30: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 31: Redefinition of VAR.
C:\PBP\PIC18EXT.BAS ERROR Line 32: Redefinition of VAR.
FATAL ERROR: Too many errors. (21)
Halting build on first failure as requested.
BUILD FAILED: Thu May 29 13:18:17 2008

Bruce
- 29th May 2008, 19:33
Edit your blink1.bas file to include just this. Save and recompile.



loop: High 0 ' Turn on LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds

Low 0 ' Turn off LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds

Goto loop ' Go back to loop and blink LED forever


End

skimask
- 29th May 2008, 20:53
Edit your blink1.bas file to include just this. Save and recompile.
Hopefully he's not under the mistaken impression that he should be adding/deleting/moving the 18F442.BAS file, or any of the other files in that directory around!

HOTLNC
- 29th May 2008, 21:07
Noted. My .bas files looks like this:

' Example program from manual to blink an LED connected to PORTB.0 about once a second

loop: High 0 ' Turn on LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds

Low 0 ' Turn off LED connected to PORTB.0
Pause 500 ' Delay for .5 seconds

Goto loop ' Go back to loop and blink LED forever
End


The outfile looks like this:

Executing: "C:\pbp\PBPW.EXE" -ampasmwin -oq -z -p18F442 "blink.bas"
PicBasic Pro Compiler 2.45a, (c) 1998, 2004 microEngineering Labs, Inc.
All Rights Reserved.
Warning[223] C:\PBP\P18F442.INC 18 : Redefining processor.
Warning[221] C:\PBP\P18F442.INC 18 : Invalid message number (65417)
Warning[207] C:\PBP\18F442.INC 21 : Found label after column 1. (_CONFIG1H)
Warning[230] C:\PBP\18F442.INC 28 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[113] C:\PBP\18F442.INC 28 : Symbol not previously defined (_OSCS_OFF_1H)
Error[113] C:\PBP\18F442.INC 28 : Symbol not previously defined (_XT_OSC_1H)
Warning[230] C:\PBP\18F442.INC 29 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[113] C:\PBP\18F442.INC 29 : Symbol not previously defined (_WDT_ON_2H)
Error[113] C:\PBP\18F442.INC 29 : Symbol not previously defined (_WDTPS_128_2H)
Warning[230] C:\PBP\18F442.INC 30 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[113] C:\PBP\18F442.INC 30 : Symbol not previously defined (_LVP_OFF_4L)
Error[113] C:\PBP\FILES\BLINK.ASM 54 : Symbol not previously defined (PORTB)
Error[113] C:\PBP\FILES\BLINK.ASM 56 : Symbol not previously defined (PORTC)
Error[113] C:\PBP\FILES\BLINK.ASM 58 : Symbol not previously defined (TRISB)
Error[113] C:\PBP\FILES\BLINK.ASM 60 : Symbol not previously defined (TRISC)
Error[113] C:\PBP\PBPPIC18.LIB 6219 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 6219 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 6221 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 6221 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 6277 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 6277 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 6280 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 6280 : Symbol not previously defined (STATUS)
Loaded C:\pbp\Files\blink.COD.
BUILD SUCCEEDED: Thu May 29 15:04:55 2008

Best Regards,

mister_e
- 29th May 2008, 21:25
Seems weird... few post above your files showed a V2.40 file but with a 2.45 compiler. Did you tried to delete the whole PBP folder then re-install it?

It also seems your MPLAB installation is not that right. Make sure you have followed the info on previous Bruce's link.

You don't have to add/include any extra file in your project apart the .BAS, PBP will do it at compile time. Only one file have to be listed in the Project view window.

It also seems you haven't selected the right PIC when bulding your Project, hence the Processor ReDefinition.

skimask
- 30th May 2008, 01:47
Noted. My .bas files looks like this:

Which .bas file is this? 'cause somehow I get the feeling like your messing with the wrong .bas file.

Acetronics2
- 30th May 2008, 09:03
Hi,

just verify ( mouse over is enough ) in the MPLAB menu : Project\remove file

that there is ONLY 1 file : Blink.bas ... with only Bruce's lines ...

BTW could you give us what files are in the VIEW\project\ source files window ???

Alain

Bruce
- 30th May 2008, 13:27
Here's an MPLAB v8.02 project with everything setup. It blinks an LED on RB0, has the watch window, logic analyzer, etc.

Make a sub-directory in C:\PBP\MPSIM. Unzip it into the MPSIM sub-directory. Start MPLAB, open the project and give it a shot.

Note: I would start with a clean install of PBP if you have altered any of the default PBP device includes, .bas, or other system files. You will also want to download the MPLAB/PBP registration files from the link I posted previously. Run the registration .bat file, then start MPLAB.

All you need to run PBP in MPLAB/MPSIM is the .bas file YOU create. You don't need to cut & paste anything from PBP system files into your program code and you don't need to copy any of the MPLAB device include files into your PBP directory. The MPLAB project window should show only your .bas file. No other files are needed.

If the P18F442.INC include file can't be found at compile time, then check that you have set the path to MPLAB as noted in the link above showing how to setup PBP with MPLAB.

HOTLNC
- 30th May 2008, 14:54
OK, I'll give it a shot.

This is above and beyond, guys. Thanks!

HOTLNC
- 30th May 2008, 15:03
Ok. I reran the BAT file. I used a clean copy of all the .BAS and .INC files.

Using the above attached project, here is the output file:

Executing: "C:\pbp\PBPW.EXE" -ampasmwin -oq -z -v -p18F442 "BLINK.BAS"
PicBasic Pro Compiler 2.45a, (c) 1998, 2004 microEngineering Labs, Inc.
All Rights Reserved.
Pass 1:
Pass 2:
Code Gen:
Macro Pass:
mpasmwin /q C:\pbp\MPSIM\BLINK.ASM
COD Pass:
Warning[223] C:\PBP\P18F442.INC 18 : Redefining processor.
Warning[221] C:\PBP\P18F442.INC 18 : Invalid message number (65417)
Error[113] C:\PBP\18F442.INC 20 : Symbol not previously defined (_CONFIG1H)
Warning[230] C:\PBP\18F442.INC 20 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[126] C:\PBP\18F442.INC 20 : Argument out of range (not a valid config register address)
Error[113] C:\PBP\18F442.INC 21 : Symbol not previously defined (_CONFIG2H)
Warning[230] C:\PBP\18F442.INC 21 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[126] C:\PBP\18F442.INC 21 : Argument out of range (not a valid config register address)
Error[113] C:\PBP\18F442.INC 22 : Symbol not previously defined (_CONFIG4L)
Warning[230] C:\PBP\18F442.INC 22 : __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG.
Error[126] C:\PBP\18F442.INC 22 : Argument out of range (not a valid config register address)
Error[113] C:\PBP\MPSIM\BLINK.ASM 61 : Symbol not previously defined (PORTB)
Error[113] C:\PBP\MPSIM\BLINK.ASM 63 : Symbol not previously defined (PORTC)
Error[113] C:\PBP\MPSIM\BLINK.ASM 65 : Symbol not previously defined (TRISB)
Error[113] C:\PBP\MPSIM\BLINK.ASM 67 : Symbol not previously defined (TRISC)
Error[113] C:\PBP\PBPPIC18.LIB 6219 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 6219 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 6221 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 6221 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 6277 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 6277 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 6280 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 6280 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 551 : Symbol not previously defined (TRISB)
Error[113] C:\PBP\PBPPIC18.LIB 551 : Symbol not previously defined (TRISB)
Error[113] C:\PBP\PBPPIC18.LIB 886 : Symbol not previously defined (TRISB)
Error[113] C:\PBP\PBPPIC18.LIB 596 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 596 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 632 : Symbol not previously defined (C)
Error[113] C:\PBP\PBPPIC18.LIB 632 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 596 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 596 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 630 : Symbol not previously defined (Z)
Error[113] C:\PBP\PBPPIC18.LIB 630 : Symbol not previously defined (STATUS)
Error[113] C:\PBP\PBPPIC18.LIB 551 : Symbol not previously defined (PORTB)
Error[113] C:\PBP\PBPPIC18.LIB 551 : Symbol not previously defined (PORTB)
Error[113] C:\PBP\PBPPIC18.LIB 906 : Symbol not previously defined (PORTB)
Error[113] C:\PBP\PBPPIC18.LIB 551 : Symbol not previously defined (PORTB)
Error[113] C:\PBP\PBPPIC18.LIB 551 : Symbol not previously defined (PORTB)
Error[113] C:\PBP\PBPPIC18.LIB 908 : Symbol not previously defined (PORTB)
Loaded C:\pbp\MPSIM\BLINK.COD.
BUILD SUCCEEDED: Fri May 30 09:00:36 2008

HOTLNC
- 30th May 2008, 15:12
I ran your project without hitting the build key and it simulates/works great.

Something is wrong on my end, for sure.

Bruce
- 30th May 2008, 17:10
Warning[223] C:\PBP\P18F442.INC 18 : Redefining processor.

P18F442.INC is not a header file that should be in your PBP directory. These get installed
when you install MPLAB, in the MPASM Suite directory.

Archangel
- 30th May 2008, 17:26
Warning[223] : Redefining processor.

Hi Bruce,
Where do you find the list of these warnings, as to their meanings? Are they in the individual inc. files?
Thank You
JS

mister_e
- 30th May 2008, 17:29
In MPLAB Help>> Topic>> MPASM Assembler >> MPASM Assembler >> Errors, Warnings...>> Assembler Errors

Look in \PBP folder, on a regular PBP installation, you don't have pXXxXXXX.INC file over there, but XXxXXXX.INC files

Bruce
- 30th May 2008, 17:31
Hi Joe,

Errors & warnings generated by MPASM can be found in the MPASM help file. If you're
using the PM assembler, look in PM.TXT in your PBP install directory.

HOTLNC
- 2nd June 2008, 20:03
Warning[223] C:\PBP\P18F442.INC 18 : Redefining processor.

P18F442.INC is not a header file that should be in your PBP directory. These get installed
when you install MPLAB, in the MPASM Suite directory.

OK, I'll remove the P18F442 file from the PBP directory and make sure the path points to the same file in the MPLAB area.

Thanks!

HOTLNC
- 4th June 2008, 13:52
I finally got it guys.

I could not get PBP to find the p18f442.inc file, even after making sure the path was pointing correctly. So I modified the 18f442.inc file and added the path to it.

It now works without error.

Thanks for all the hand holding.