masoninc61
New Member
:shock: :shock: Well I am at my school trying to get this thing to work and well....it doesnt work. so i have come here to ask you for help getting it to work.
I have these programs called MPLAB IDE, to write them,
MPASMWIN, to compile it, and IFI loader to get it to the little robot thing, see I dont know what i am doing, i copy and pasted this code that it came from but it didnt copy write ~here it is.
Please not that due to PHbb the spaces are wrong, well of course i dont know if they were right in the first place :twisted:
title "PIC18F452 counting program"
list p=18f452,f=inhx32
#include <p18f452.inc> ; This “header file” contains all
; the PIC18F252 special function
; register names and addresses.
; This file is located in the same
; directory as MPASMWIN.EXE.
COUNT equ 0x00
DVAR equ 0x01
DVAR2 equ 0x02
org 00h ;reset vector
goto Start
org 1Ch
Start
clrf WREG ;clear W register
movwf PORTC ;clear PORTC
movwf TRISC ;config PORTC as outputs
Init
clrf COUNT ;clr count
IncCount
incf COUNT,F ;increment count
movf COUNT,W ;
movwf PORTC ;display on port c
call Delay ;wait
goto IncCount ;loop
Delay
movlw 0xFF ;set delay loop
movwf DVAR2 ;
D0
movwf DVAR ;reset inner loop
D1
decfsz DVAR,F
goto D1
decfsz DVAR2,F
goto D0
return
end
I copmile it, then use IFI loader to try and download it to my robot, i guess you would say. and i dont thing it detects the interface, it doesnt read any of the com ports as anything bieng there, but there is! and i get this error Invalid Address: 0x0 (correct range 0x800-0x07fff)
any suggestions of what i should do, i just started and dont know what to do
I have these programs called MPLAB IDE, to write them,
MPASMWIN, to compile it, and IFI loader to get it to the little robot thing, see I dont know what i am doing, i copy and pasted this code that it came from but it didnt copy write ~here it is.
Please not that due to PHbb the spaces are wrong, well of course i dont know if they were right in the first place :twisted:
title "PIC18F452 counting program"
list p=18f452,f=inhx32
#include <p18f452.inc> ; This “header file” contains all
; the PIC18F252 special function
; register names and addresses.
; This file is located in the same
; directory as MPASMWIN.EXE.
COUNT equ 0x00
DVAR equ 0x01
DVAR2 equ 0x02
org 00h ;reset vector
goto Start
org 1Ch
Start
clrf WREG ;clear W register
movwf PORTC ;clear PORTC
movwf TRISC ;config PORTC as outputs
Init
clrf COUNT ;clr count
IncCount
incf COUNT,F ;increment count
movf COUNT,W ;
movwf PORTC ;display on port c
call Delay ;wait
goto IncCount ;loop
Delay
movlw 0xFF ;set delay loop
movwf DVAR2 ;
D0
movwf DVAR ;reset inner loop
D1
decfsz DVAR,F
goto D1
decfsz DVAR2,F
goto D0
return
end
I copmile it, then use IFI loader to try and download it to my robot, i guess you would say. and i dont thing it detects the interface, it doesnt read any of the com ports as anything bieng there, but there is! and i get this error Invalid Address: 0x0 (correct range 0x800-0x07fff)
any suggestions of what i should do, i just started and dont know what to do