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.