Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MPLAB

Status
Not open for further replies.

zachtheterrible

Active Member
I'm trying to figure out how to use MPLAB, and am using the little tutorial that comes with it. I have done everything the tutorial says, but with a PIC16F628A. This is the result I get when I try to build everything-
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Documents and Settings\hal\My Documents\PIC\pic.mcs".
Clean: Done.
Executing: "C:\PF\MPLAB\MPASM Suite\MPAsmWin.exe" /q /p16F628A "f628Atempo.asm" /l"f628Atempo.lst" /e"f628Atempo.err" /o"f628Atempo.o"
Executing: "C:\PF\MPLAB\MPASM Suite\MPLink.exe" "C:\Documents and Settings\hal\My Documents\PIC\16f628a.lkr" "C:\Documents and Settings\hal\My Documents\PIC\f628Atempo.o" /o"pic.cof" /M"pic.map"
MPLINK 4.01, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - section 'INT_VECTOR' can not fit the absolute section. Section 'INT_VECTOR' start=0x00000004, length=0x00000012
Errors : 1

BUILD FAILED: Wed Feb 08 18:45:09 2006

What's going wrong?
 
I took out the .lkr file and now I'm left with this message:

Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Documents and Settings\hal\Desktop\628a.mcs".
Clean: Done.
Executing: "C:\PF\MPLAB\MPASM Suite\MPAsmWin.exe" /q /p16F628A "f628Atempo.asm" /l"f628Atempo.lst" /e"f628Atempo.err"
Error[149] C:\DOCUMENTS AND SETTINGS\HAL\DESKTOP\F628ATEMPO.ASM 70 : Directive only allowed when generating an object file
Error[149] C:\DOCUMENTS AND SETTINGS\HAL\DESKTOP\F628ATEMPO.ASM 76 : Directive only allowed when generating an object file
Error[149] C:\DOCUMENTS AND SETTINGS\HAL\DESKTOP\F628ATEMPO.ASM 80 : Directive only allowed when generating an object file
Error[149] C:\DOCUMENTS AND SETTINGS\HAL\DESKTOP\F628ATEMPO.ASM 103 : Directive only allowed when generating an object file
Halting build on first failure as requested.
BUILD FAILED: Fri Feb 10 14:51:46 2006

What gives!?
 
Sorry, I assumed you were doing absolute programming and the linker script was getting in your way... You may want to show us what those offending lines look like...

Regards, Mike
 
Mike, you've gotta understand that I've never programmed or used a PIC before in my life, so I don't have any idea what I'm doing and with no prior experience. I'm following the exact directions that are provided with MPLAB IDE for getting started, but I'm trying to do it with a PIC16F628A instead of the PIC that is specified in the instructions.
 
Hiya Zac,
I had a few problems using mplab when I first started but on reading up on a few books and help files it became easy. Now firstly start by opening a new project and go thru the wizard inputting the pic your using and it will specifiy what tools are available usually the simulator. Make up an asm code in notepad then in the box that says project files click add files and place the notepad file there. Then you can edit and add to the file in mplab and build it. If there is any errors it won't build and it will tell you on what line the errors are. Grab one of Nigel's tutorials in notepad and try it. I haven't had the chance to do any programming as I've been away working but thats how I remember doing it and mate it's just like riding a bike once you learn ya don't forget. :wink:

Hope this Helps

Cheers Bryan :D
 
Zach,
Have you visited the MicroChip forum? They have experts in MPLAB including some who work for MicroChip. And I don't mean to imply any disrespect to those you post in this one.

Here is the link **broken link removed**
 
Zach',

May I suggest you take a peek at the Elmer 160 tutorial... It's an A-to-Z tutorial for the newcomer and promotes good programming practices along the way...

Regards, Mike
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top