# help with junebug

Status
Not open for further replies.

#### mrwhitee

##### New Member
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)

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

Setting MCLR Vdd

#### 3v0

##### Coop Build Coordinator
Forum Supporter

Most of the time you will be programming code you just built so it will not have to import the hex.

Are you going to be programing in asm basic or c ?

#### be80be

##### Well-Known Member
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.

#### mrwhitee

##### New Member
not sure yet. The first project I intend to do is this:

I think its in asm

#### 3v0

##### Coop Build Coordinator
Forum Supporter
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.

#### mrwhitee

##### New Member
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?

#### 3v0

##### Coop Build Coordinator
Forum Supporter
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

#### blueroomelectronics

##### Well-Known Member
Is the formatting bad in the manual? I should post it online too.

#### mrwhitee

##### New Member
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.

#### 3v0

##### Coop Build Coordinator
Forum Supporter
Is the formatting bad in the manual? I should post it online too.

For some reason people end up without the leading spaces when they copy it. A link to a file would be great. Maybe we could add a C version while we are at it ?

#### mrwhitee

##### New Member
I copied from the online manual but maybe I goofed it up. Not sure.

#### blueroomelectronics

##### Well-Known Member
I'll put in a link on the site.

PS mrwhitee take a look at the JPUG issues for more Junebug programs.

#### mrwhitee

##### New Member
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.

#### blueroomelectronics

##### Well-Known Member
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.

#### mrwhitee

##### New Member
It made a square wave on both of them.

Status
Not open for further replies.

Replies
565
Views
51K
Replies
6
Views
1K
Replies
5
Views
2K
Replies
40
Views
3K
Replies
6
Views
2K