1. 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.
    Dismiss Notice

Junebug help??

Discussion in 'Microcontrollers' started by MrDEB, Apr 8, 2009.

  1. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    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.
     
  2. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn
    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
     

    Attached Files:

    Last edited: Apr 10, 2009
  3. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    Am I correct that you can not use ICD with the Swordfish IDE ?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn

    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: Apr 10, 2009
  6. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    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.
     
  7. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn
    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
     
  8. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    You make em I'll host em.
     
  9. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn
    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: Apr 10, 2009
  10. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    lets throw a wrench into the works

    I see that there is now a 8.30 version
    8.20 had some issues with quickbuild in 8.20
    How to create a HEX file using MPLAB IDE
    gona try be80be's suggestion for blinky.asm
    be back later with results.
     
  11. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn
    MrDeb don't get into
    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
     
  12. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    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??
     
  13. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    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: Apr 10, 2009
  14. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    I like swordfish better BUT?

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

    Attached Files:

  15. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    my objective is to edit

    the code to learn maybe something.
    I eveuntuly want to connect a speaker to the CON 5 port and change frequencies as per be80be' s post towards the beginning of this thread
    here is the website he suggested
    PIC microcontrollers : chapter 7 - Examples
     
  16. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    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.
     
  17. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    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??
     
  18. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn
    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.
     

    Attached Files:

  19. MrDEB

    MrDEB Active Member

    Joined:
    Apr 16, 2007
    Messages:
    4,364
    Likes:
    22
    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
     
  20. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn
    Mrdeb I posted you some better code but I don't think you read it
    Code (text):

    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: Apr 10, 2009
  21. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,807
    Likes:
    135
    Location:
    morristown,tn

Share This Page