AtomSoft
Well-Known Member
Just got my Junebug today and playing with it.
I tried altering the LED demo code
Basically what i tried to do is run the LEDs as usual until a interupt occurs. I know i must be mixing something here . I get no errors but like 30 warnings even with Junebug code alone. Also i always get a target halted:
I tried altering the LED demo code
Code:
; *** Junebug 18F1320 LED sequencer demo ***
; Flashes LEDs1 thru 6 from left to right forever
; DIP Switch (SW6) must have TUTOR on (SW6-1,2,3) all other switches off
list p=18F1320
include <p18F1320.inc>
CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF
LED macro x,y ; MACRO LED <PORTA>, <TRISA>
movlw x
movwf LATA ; LATA = x
movlw y
movwf TRISA ; TRISA = y
call Delay ; call the Delay subroutine
endm ; end macro
Count equ 0 ; delay loop counter
org 0 ; reset vector
;bsf ADCON1, 0 ; make RA0 digital
CLRF LATB ; Alternate method to clear output data latches
MOVLW b'00010001';0x08 ; Set RB0, RB1, RB4 as
MOVWF ADCON1 ; digital I/O pins
MOVLW 0xCF ; Value used to initialize data direction
MOVWF TRISB ; Set RB<3:0> as inputs RB<5:4> as outputs RB<7:6> as inputs
LED1 LED b'00000001', b'10111110' ; LED <PORTA>, <TRISA>
LED2 LED b'01000000', b'10111110' ; LED <PORTA>, <TRISA>
LED3 LED b'01000000', b'00111111' ; LED <PORTA>, <TRISA>
LED4 LED b'10000000', b'00111111' ; LED <PORTA>, <TRISA>
LED5 LED b'10000000', b'01111110' ; LED <PORTA>, <TRISA>
LED6 LED b'00000001', b'01111110' ; LED <PORTA>, <TRISA>
goto LED1 ; loop forever
Delay decfsz Count, f ; decrement Count and skip when zero
goto $-2 ; not zero? repeat
return
ISR
bcf INTCON, 0 ; alternate
bcf INTCON, 1 ; alternate
LED b'10000001', b'01111110' ; LED <PORTA>, <TRISA>
call Delay
retfie
END
Basically what i tried to do is run the LEDs as usual until a interupt occurs. I know i must be mixing something here . I get no errors but like 30 warnings even with Junebug code alone. Also i always get a target halted:
Code:
PKWarn0006: The local copy of program memory has been changed since the last program operation. Should PICkit 2 program the target (fix) before proceeding?
Programming Target (3/13/2008 10:00:00 AM)
Erasing Target
Programming Program Memory (0x0 - 0x77)
Verifying Program Memory (0x0 - 0x77)
Programming Debug Executive (0x-1E40 - 0x1FFF)
Verifying Debug Executive (0x1E40 - 0x1FFF)
Programming Debug Vector
Verifying Debug Vector
Programming Configuration Memory
Verifying Configuration Memory
Running Target
Debug mode entered, DE Version = 16.0.4
PICkit 2 Ready
Target Halted
Code:
Warning[203] C:\MPLAB\JUNEBUG\MAIN.ASM 12 : Found opcode in column 1. (call)
Warning[205] C:\MPLAB\JUNEBUG\MAIN.ASM 38 : Found directive in column 1. (END)
Loaded C:\mplab\junebug\main.cod.
BUILD SUCCEEDED: Thu Mar 13 09:59:53 2008