Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

help with junebug

Status
Not open for further replies.
I didnt import the hex before. I opened it. I just did it with import and it worked. At least I think it did because its blinking. Here is the output code.

Initializing PICkit 2 version 0.0.3.63
Found PICkit 2 - Operating System Version 2.32.0
PICkit 2 Unit ID = OlHoss
Target power not detected - Powering from PICkit 2 ( 5.00V)
PIC18F1320 found (Rev 0x7)
PICkit 2 Ready

Programming Target (6/7/2009 3:13:14 PM)
PIC18F1320 found (Rev 0x7)
Erasing Target
Programming Program Memory (0x0 - 0x57)
Verifying Program Memory (0x0 - 0x57)
Programming Configuration Memory
Verifying Configuration Memory
PICkit 2 Ready

Setting MCLR Vdd
 
You had to load some kind of hex. When you start mplab set your programmer before you build and it will load the hex it just built.
 
Yes it is asm.

Do you know how to program in any computer language?

You may want to look at this **broken link removed**. It is a tutorial I wrote to introduce people to the 18F1320 and Junebug. It is in C but at this point it will not make much difference to you.

It will help you understand how the processor parts works together.
 
Cool. I just grabbed it. Over the next few weeks Ill be slowly learning what I can. Was the code I posted earlier ASm. If not do you have the blinky code for asm?
 
Cool. I just grabbed it. Over the next few weeks Ill be slowly learning what I can. Was the code I posted earlier ASm. If not do you have the blinky code for asm?

Yes the code was asm but the formatting was bad, some of the lines were missing leading spaces.

This is a corrected version.

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
 
I built that code and then programmed it. Now I see how that works. Looks like I just need to learn how to write the code now.
 
I will. Now i need to figure out if this oscilloscope I got is anygood. Ill post something in the other area of this forum.
 
The Junebug has a test mode (PICKit2 2.61 software) that can put out a 20kHz square wave on PGC, PGD or AUX. Handy for a quick scope test.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top