I'm just learning assembly and working with the PIC line of Microcontrollers, specificly the 18 line (A Little 16).
I'm not currently getting these chips to do anything whatsoever on my solderless breadboard, nomatter what the program says. I'm currently testing with an example peice of code from
-------------------------------------------------
Count equ 0x000
;************************************************************
; reset vectors
org 00000h ; Reset Vector
goto Start
;************************************************************
;program code starts here
org 00020h ; Beginning of program EPROM
Start
clrf LATB ; Clear PORTB output latch
clrf TRISB ; Make PORTB pins all outputs
clrf Count ; Clear Count
Loop
btfsc PORTA,4 ; Has S2 been pressed? (Normally high, goes low when pressed.)
goto Loop ; No, check again
IncCount
incf Count,F ; Increment Count
movff Count,LATB ; move Count to PORTB
Debounce
btfss PORTA,4 ; Has key been released?
goto Debounce ; No, wait some more
goto Loop ; yes, wait for next key press
END ; directive indicates end of code
--------------------------------------------------------
This was originally made for the PIC18CXX2 chip, but I've modified it slightly to be compatable with the PIC18F448 Chip which I am currently using. I Dont understand if it's a problem in the code or in the wiring. As of now i'm running a 5 Volt line to both Vdd's and grounding both Vss's (this is correct, right?). I'm grounding out S2 (on Port A pin4) and I Cant see anything coming up on any LED's. Nothing happens at all!! Does anyone see anything wrong with what I am doing?
My second question is, what is the significance of 'Org'. It seems to be defining memory addresses in the code i sent, but i dont understand the use of it.
I'm not currently getting these chips to do anything whatsoever on my solderless breadboard, nomatter what the program says. I'm currently testing with an example peice of code from
-------------------------------------------------
Count equ 0x000
;************************************************************
; reset vectors
org 00000h ; Reset Vector
goto Start
;************************************************************
;program code starts here
org 00020h ; Beginning of program EPROM
Start
clrf LATB ; Clear PORTB output latch
clrf TRISB ; Make PORTB pins all outputs
clrf Count ; Clear Count
Loop
btfsc PORTA,4 ; Has S2 been pressed? (Normally high, goes low when pressed.)
goto Loop ; No, check again
IncCount
incf Count,F ; Increment Count
movff Count,LATB ; move Count to PORTB
Debounce
btfss PORTA,4 ; Has key been released?
goto Debounce ; No, wait some more
goto Loop ; yes, wait for next key press
END ; directive indicates end of code
--------------------------------------------------------
This was originally made for the PIC18CXX2 chip, but I've modified it slightly to be compatable with the PIC18F448 Chip which I am currently using. I Dont understand if it's a problem in the code or in the wiring. As of now i'm running a 5 Volt line to both Vdd's and grounding both Vss's (this is correct, right?). I'm grounding out S2 (on Port A pin4) and I Cant see anything coming up on any LED's. Nothing happens at all!! Does anyone see anything wrong with what I am doing?
My second question is, what is the significance of 'Org'. It seems to be defining memory addresses in the code i sent, but i dont understand the use of it.