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
 
LinkBack Thread Tools Display Modes
Old 8th May 2007, 09:39 PM   (permalink)
Default Having troubles with compiling

STATUS equ 03h
PORTA equ 05h
PORTB equ 06h
TRISA equ 85h
TRISB equ 86h
org 0x0000 ;org sets the origin, 0x0000 for the 16F628,

bsf STATUS, 5 ;select bank 1
movlw b'00000000' ;set PortB all outputs
movwf TRISB
movwf TRISA ;set PortA all outputs
bcf STATUS, 5 ;select bank 0

Loop
movlw 0xff
movwf PORTA ;set all bits on
movwf PORTB
nop ;the nop's make up the time taken by the goto
nop ;giving a square wave output
movlw 0x00
movwf PORTA
movwf PORTB ;set all bits off
goto Loop ;go back and do it again

end

This is one of the codes I am just using to try and get the stupid thing to compile something, none of mine work after I use the MOVWF command. This is a modified version of one of Nigels codes off of his website, I figured it should work since its a tutorial but it won't even compile.

Heres the eror message:

MPLINK 4.11, Linker
Copyright (c) 2007 Microchip Technology Inc.
Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x0000001c
Errors : 1

Its something to do with the linking but I can't figure it out, if someone could tell me why it keeps returning this error it would be much appreciated.
psecody is offline  
Old 8th May 2007, 10:27 PM   (permalink)
Default

The program has been assembled succesfully with MPASM. I've added the list and __config directives (you may change those settings)
Attached Files
File Type: asm p1.asm (613 Bytes, 3 views)
eng1 is offline  
Old 8th May 2007, 11:17 PM   (permalink)
Default

Remove the linker file from your project and it will compile correctly.

Mike.
Pommie is online now  
Old 9th May 2007, 05:38 AM   (permalink)
Default

Thanks I appreciate the help. I'll probably have some more noob questions to ask after I start reading some more haha. Thanks again
psecody is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Picstart+ Troubles freeskier89 Micro Controllers 6 16th April 2006 09:01 AM
initilisation troubles Lilikin Micro Controllers 0 22nd March 2006 05:49 PM
Diode troubles Kloth General Electronics Chat 12 14th February 2006 05:20 PM
Telephone troubles Verizon is clueless:( Bob Haller General Electronics Chat 0 8th March 2004 10:53 PM
SimuLink and RTW compiling custom S-function Styx General Electronics Chat 0 25th February 2004 03:51 PM



All times are GMT. The time now is 06:07 PM.


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

eXTReMe Tracker