Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 19th October 2007, 12:58 AM   (permalink)
New Member
bamafan54 is on a distinguished road
Default MP Lab Program Help

Hello All.

I am trying to complete a project for my senior design course. Our project is involves creating the electronics for a glass front vendor coke machine. My portion of the project is to control the two dc motors and the solenoids to release the product I have most of my code written (using MP Lab and assembler language). I am also using a PIC16F877A as the uController and the MCP2515 as the can bus controller.

Upon compiling my code I came up with numerous errors. Could someone please take a look at it and advise where I have went wrong. If I have done things correctly all of my .asm files should be attached.
Attached Files
File Type: asm Initialization.asm (999 Bytes, 13 views)
File Type: asm Can_Comm.asm (528 Bytes, 9 views)
File Type: asm Interrupt.asm (6.8 KB, 7 views)
File Type: asm Main.asm (773 Bytes, 9 views)
File Type: asm Timer_Routines.asm (1.7 KB, 8 views)
File Type: asm Variables.asm (608 Bytes, 7 views)
bamafan54 is offline   Reply With Quote
Old 19th October 2007, 01:39 AM   (permalink)
Experienced Member
 
bananasiong is a glorious beacon of lightbananasiong is a glorious beacon of lightbananasiong is a glorious beacon of lightbananasiong is a glorious beacon of light
Default

Hi,
Why you're not combining everything into a single file?
I see the first file has:
Code:
	MOVLW	0X1B98
	MOVWF	CONFIGURATION_WORD
which I don't think working, because w register is a 8-bit long register, no 16 bits.
The configuration setting is usually after the header file of the variables (p16F877a.inc) like this:
Code:
LIST	  P=16F877A
#INCLUDE <P16F877A.INC>
  __config   0x1b98
And you don't need the Variables.asm for those special function registers, only for your general purpose registers will do.

What did you get when you try to assemble the code?
__________________
Superman Returns..
http://www.supermanhomepage.com/imag...an-returns.gif

My friend created this account for me.. LOL
http://bananasiong.myminicity.com
oh.. somemore
http://bananasiong.myminicity.com/env
bananasiong is offline   Reply With Quote
Old 19th October 2007, 02:18 AM   (permalink)
New Member
bamafan54 is on a distinguished road
Default

bananasiong,

Here is the error I recieve. I have all of the below files in a single project as a .mcp file, but I could not upload a file with this extension.



Make: The target "F:\Senior Design II\Can_Comm.o" is out of date.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F877A "Can_Comm.asm" /l"Can_Comm.lst" /e"Can_Comm.err" /o"Can_Comm.o"
Error[150] F:\SENIOR DESIGN II\CAN_COMM.ASM 6 : Labels must be defined in a code or data section when making an object file
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 7 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 8 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 9 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 10 : Executable code and data must be defined in an appropriate section
Error[150] F:\SENIOR DESIGN II\CAN_COMM.ASM 11 : Labels must be defined in a code or data section when making an object file
Message[302] F:\SENIOR DESIGN II\CAN_COMM.ASM 11 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 11 : Executable code and data must be defined in an appropriate section
Error[151] F:\SENIOR DESIGN II\CAN_COMM.ASM 12 : Operand contains unresolvable labels or is too complex
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 12 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 13 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 14 : Executable code and data must be defined in an appropriate section
Error[150] F:\SENIOR DESIGN II\CAN_COMM.ASM 17 : Labels must be defined in a code or data section when making an object file
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 18 : Executable code and data must be defined in an appropriate section
Error[150] F:\SENIOR DESIGN II\CAN_COMM.ASM 19 : Labels must be defined in a code or data section when making an object file
Message[302] F:\SENIOR DESIGN II\CAN_COMM.ASM 19 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 19 : Executable code and data must be defined in an appropriate section
Error[151] F:\SENIOR DESIGN II\CAN_COMM.ASM 20 : Operand contains unresolvable labels or is too complex
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 20 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 21 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 22 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 23 : Executable code and data must be defined in an appropriate section
Error[150] F:\SENIOR DESIGN II\CAN_COMM.ASM 25 : Labels must be defined in a code or data section when making an object file
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 26 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 27 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 28 : Executable code and data must be defined in an appropriate section
Error[150] F:\SENIOR DESIGN II\CAN_COMM.ASM 29 : Labels must be defined in a code or data section when making an object file
Message[302] F:\SENIOR DESIGN II\CAN_COMM.ASM 29 : Register in operand not in bank 0. Ensure that bank bits are correct.
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 29 : Executable code and data must be defined in an appropriate section
Error[151] F:\SENIOR DESIGN II\CAN_COMM.ASM 30 : Operand contains unresolvable labels or is too complex
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 30 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 31 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 32 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 33 : Executable code and data must be defined in an appropriate section
Error[152] F:\SENIOR DESIGN II\CAN_COMM.ASM 34 : Executable code and data must be defined in an appropriate section
Error[129] F:\SENIOR DESIGN II\CAN_COMM.ASM 35 : Expected (END)
Halting build on first failure as requested.
BUILD FAILED: Thu Oct 18 21:09:16 2007


I have no idea what it is trying to say to me. I aplologize if I seem ignorant when it comes to this, but this is about the second time I have even attempted to write code.
bamafan54 is offline   Reply With Quote
Old 19th October 2007, 02:53 AM   (permalink)
Experienced Member
kchriste is a glorious beacon of lightkchriste is a glorious beacon of lightkchriste is a glorious beacon of lightkchriste is a glorious beacon of lightkchriste is a glorious beacon of light
Default

Remember that in MPLAB if you double click on the error, it will take you right to the place in the source file that caused the error.
But I think the error comes from the fact that you've got
ORG 0X004
In Interrupt.asm Coming BEFORE
ORG 0X000
in Main.asm
This is because the #include<file.asm> directive works exactly the same as if you had pasted the code from file.asm where the #include directive is typed.
EDIT:
Also, since you are writing Absolute Code, take all the files out of the project file except for main.asm since you are using the #include directive to include them in main.asm. Otherwise MPLAB will try to compile these files on their own giving you errors because there are no ORG statements for it to decide where the code resides in each file.
__________________
--- The days of the digital watch are numbered. ---

Last edited by kchriste; 19th October 2007 at 03:30 AM.
kchriste is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Question about Inchworm+ Quan Micro Controllers 54 28th October 2007 12:20 AM
Please help!! program not working vinke Micro Controllers 3 5th October 2007 04:58 AM
First Program in assembly, And Programmer Inchworm. Ayne Micro Controllers 10 9th March 2007 07:26 PM
little help with my program please - simple count loop kud0s Micro Controllers 5 7th July 2005 09:40 PM
PicBasic Keypad program Sora Micro Controllers 0 20th April 2004 07:01 PM



All times are GMT. The time now is 03:37 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.