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.

Junebug help??

Status
Not open for further replies.
Well in short MPLAB offers nothing to Swordfish BASIC (Until they can get debug working again but alas)
When you "build all" (assemble) your program with MPLAB it will ask absolute or relocatable code. For now choose absolute.
 
Here this walks you threw how to set up swordfish to use junebug or a pickit2
as the programmer.Are you using a blinkey.asm file? Bill you may want it to for your junebug I think it will help
 

Attachments

  • pickit2 or junebug.zip
    3.3 MB · Views: 308
Last edited:
You can use a pickit2 but I couldn't find and ICD.exe that you could run on the command line like the pk2cmd.exe. The ICD runs in mplab when I Google it I didn't find any thing. I say your right. But are they not some command line programming software
That use ICD beside mplab
 
Last edited:
be80be May I put your video on my Junebug page? I'd be happy to give you credit just need a name.

3V0 no Debug for 8.x of MPLAB. Too bad but I've gotten no response from Swordfish either.

PS the only thing I HATE about Swordfish is the full version (yes I bought it) uses a USB dongle for copy protection.
 
Sure I was hoping you would Bill you can say it's by be80be but my Name is Burt. Did one with mplab but it was for the 3x3x3 cube i change for some one wanting to use a 16f628a showing them how in mplab to do changes to it. I was going to change it to show MRdeb how to do blinkey.asm In mplab
 
I am using mplab8.2 on win xp -maybe thats why I am having trouble doing anything in mplab
gonna go to swardfish and try your edit suggestion.
just need to figure out what a blind hex is??
Where do you put your files. Here is how you do that blinky.asm
1. Make a shortcut on your desktop to C:\
2. click the shortcut to C:\ make a folder named blinky
3. Put the blinky.asm in C:\blinky
4. Start Mplab up and click project
5. Click project wizard
6. At welcome click next
7. Set device to PIC18f1320 click next
8. Set active tool suite to Microchip MPASM toolsuite click next
9. Click browse and open C:\blinky and save project as "blink" click save then click next
10. Click Blinky.asm and add it to your project click next
11. Click finish
12. In blink.mcw click the Blinky.asm it will open up in the window
13. Click project then click make it should build and say BUILD SUCCEEDED
14. Click programmer then select programmer and click PICkit 2
15. On the top right hand there is a icon that looks like a little yellow piece of paper with a arrow pointing down click that and it will program your junebug with the blinky.hex
Hope this helps you.

P.S. Thats a lot of Blinky lol
 
Last edited:
MrDeb don't get into
quickbuild
till you learn how to use mplab you'll be lost forever. Make sure you use Bill's Blinky.asm For sure don't use yours
 
used Bills asm

and kinda got lost as to locating the correct file (around step 9-12) never saw a mcw file
I refered to the directions
How to create a HEX file using MPLAB IDE
page 4 it says to highlight the asm file then QUICKBUILD
BUILD SUCCEEDED!!!
then found that piece of paper w/ arrow and clicked on.
then I think I read the pic and the LEDs flashed back n forth
stll using 8.20 version
thanks again
now if the mplab will program the pic how do I intergrate the swordfish basic??
just copy the asm and do the same??
 
Don't integrate Swordfish with MPLAB, the Swordfish IDE is so much easier to use and color codes your source code plus shows modules & syntax checks.

That said, for now why not stick to BASIC and ignore MPLAB till you get the hang of it. Something to show your scouts in a few weeks.

Move on to C18 and assembler even JAL may interest you in the future.
PS I really liked PASCAL too bad it never caught on as a popular microcontroller language. I even used the now free Alice Pascal interpreter.
 
Last edited:
I like swordfish better BUT?

I copied n pasted the asm file you posted, pasted into swordfish but get errors (see attachement)
what now???
 

Attachments

  • Capture4-10-2009-7.53.32 PM.jpg
    Capture4-10-2009-7.53.32 PM.jpg
    177.2 KB · Views: 280
Swordfish is for BASIC only, you can put inline assembly but it's really not great for that.
If you want to use asm then stick with MPLAB (and run the wizard).

BASIC will be much easier as it does plenty of setup for you.
 
I need to locate some basic programs then??

as most of the stuff I see are for other chips and are asm stuff
will look over at the swordfish site but looking for led programs as thats all I can see working at the moment.
would like to experiment w/ the buttons and on to the CON5 port
but first get the hang of swordfish basic - altering the code then see what I did??
 
MrDeb if you use swordfish you can do any thing you would want to. But I don't no how you miss this take a look.
 

Attachments

  • blink.PNG
    blink.PNG
    11.4 KB · Views: 273
never saw that

I went by the directions you posted but the file I had to copy n paste as it was in the win notepad.
after pasting I highlighted the then clicked on quickbuild and go a succesful build as per
How to create a HEX file using MPLAB IDE
question can I connect a speaker to con5 and build the code you posted (I think you posted??) will it work maybe??
}
{
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2009 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 3/31/2009 *
* Version : 1.0 *
* Notes : hook your sound up from PORTB.3 *
* : *
*****************************************************************************
}
Device = 18F1320
Clock = 8 // tells the compiler the FOSC speed
Config OSC = INTIO2, WDT = OFF, LVP = OFF
Include "Utils.bas"
Include "PW.bas" // import PWM module..
Dim Duty As Byte
OSCCON = %01111111 // select 8MHz internal oscillator
SetAllDigital
// main program...
PWM.SetFreq(5000) //this set it for a 5000khz

While true
Duty = 40 // this starts it at 2000khz
Repeat
PWM.SetDutyPercent(Duty)
Inc(Duty)
DelayMS(25)
Until Duty > 100 // takes it up to 5000
Repeat
PWM.SetDutyPercent(Duty)
Dec(Duty)
DelayMS(25)
Until Duty = 40 // lower it back down


Wend
 
Mrdeb I posted you some better code but I don't think you read it
Code:
Device = 18F1320
Clock = 8 // tells the compiler the FOSC speed
Config OSC = INTIO2, WDT = OFF, LVP = OFF
Include "Utils.bas"
Dim out As PORTB.3
OSCCON = %01111111
SetAllDigital

 Low (out)
 While true
    high (out)
    DelayUS (700)   // justs change this to change sound
    Low (out)
    delayus (700)  // and this to 
  Wend
And yes I posted that but this is easy and makes better sound just play with the delay value I think you'll like it
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top