I received the kit yesterday and assembled it lastnight. I am trying to flash the led's with this:
It seems like it programmed ok. No error messaged but only the green and yellow led light up. The 3rd big red led just barely makes a visible flicker.
I am not sure if something wrong with junebug or if I programmed it wrong with mplab.
I hit file and new and then copied above code and then clicked program to taget device. The small red led lights up for a second and then its over so I guess that part worked.
Please help. I have a volt meter which I know how to use and a oscilloscope phillips pm3365A which I dont know how to use yet but I have it set up.
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
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>
bra LED1 ; loop forever
Delay decfsz Count, f ; decrement Count and skip when zero
bra Delay ; not zero? repeat
return ; return
END
It seems like it programmed ok. No error messaged but only the green and yellow led light up. The 3rd big red led just barely makes a visible flicker.
I am not sure if something wrong with junebug or if I programmed it wrong with mplab.
I hit file and new and then copied above code and then clicked program to taget device. The small red led lights up for a second and then its over so I guess that part worked.
Please help. I have a volt meter which I know how to use and a oscilloscope phillips pm3365A which I dont know how to use yet but I have it set up.