+ Reply to Thread
Page 1 of 2
1 2 Last
Results 1 to 15 of 20

Thread: instructions for using junebug sim

  1. #1
    MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent
    Join Date
    Apr 2007
    Posts
    2,135

    Default instructions for using junebug sim

    as well as the pickit2.
    I loaded the pickit2.exe file.
    paste program into swordfish editor
    then press F10
    program starts doing something = compiling then says it loaded sucessfullt.
    then it says the microcontroller needs to be reset
    what now??
    want to figure out this part before trying to run the Junebug simulator.
    tried to figure out but get lost real quick -- couldn't find my bag of cookies crumbs to leave along the trail--lol or was it crackers??


  2. #2
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    You don't have your programmer installed Bill has how to do it In his junebug manual easy to miss but it's in there look on page 11 and make sure you do the 10 steps
    1. View
    2. Compile and Program Options
    3. Install New Programmer
    4. Create a custom programmer entry
    5. Junebug
    6. PK2CMD.EXE
    7. Find automatically
    8. /PPIC$target-device$ /F$long-hex-filename$ /M /R /H2
    9. Finished
    10. OK
    Burt

  3. #3
    MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent
    Join Date
    Apr 2007
    Posts
    2,135

    Default have mplab etc installed

    went to swordfish website and pretty sure I have everything in the right folder
    In summary:

    * Ensure either SESwordfish.exe or Swordfish.exe are present in your main Swordfish installation folder
    * Copy SFBasic.mtc and TLSFBasic.ini into the MPLAB MTC Suites folder
    * Run Swordfish.reg

    I get "reset micro controller" error.
    Is this because the Junebug is not actually installed?
    need to review the manual as well as assemble the junebug kit I already have.
    second questio?? I read this artical PIC microcontrollers : chapter 7 - Examples
    and wondering if the code can be translated to go into the 18f1320 or will the junebug do a 16f84 pic??
    sorry for all the questions but am chopping at the bit to learn and can't learn without asking.

  4. #4
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    It's and ideal to go by showing you how to get sound out of a pic. You can buy a 16f84 and program it with your junebug
    microcontroller needs to be reset
    what now??
    swordfish does that when there no programmer or it not set up.
    If your wanting to use mplab to sim what it's harder to do then program. I'll write you the code for the 18f1320 doing the same as PIC microcontrollers : chapter 7 - Examples I told you about that site so you could see how to set up your chip.
    Burt

  5. #5
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    You get your sound from PORTB,3 And unzip the PW file and place it in your swordfish user Library. You put the PW.bas in the user library only. Here the code
    Code:
    {
    *****************************************************************************
    *  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
    
    Attached Files
    Burt

  6. #6
    MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent
    Join Date
    Apr 2007
    Posts
    2,135

    Default got the hello world compiled?

    after following page 11 of 12 in the junebug assembly instructions and a few errors I got the program compiled.
    BUT in the assembly instructions it shows a screen shot of pickit2 uart tool
    I assume I need to actually have the Junebug connected??
    And the code for the melodies from the link you suggested, do I test using a speaker ?? or a piezo sounder.
    If a piezo tweeter will work then I will tray and get my 2 - 6 khz frequencies??
    lots easier than the method I was attempting.
    can the pic do to frequencies simultaneous back and forth?? or would I be better off asking for all of Berni Madeoffs assets--lol
    Well I think I am already learning something, what I am not sure of but??

  7. #7
    MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent
    Join Date
    Apr 2007
    Posts
    2,135

    Default boy that was quick!!!

    I guess this pic stuff is easier than I thought or your really sharp with this stuff??
    thanks
    now after compilling I am going to fiddle with it but would like to hear the results etc. see above post

  8. #8
    MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent MrDEB Excellent
    Join Date
    Apr 2007
    Posts
    2,135

    Default how to check if it loaded the pw.bas?

    I put that mod. in the swordfish library
    I pressed F10 = no errors
    pretty small program = 687 bytes, 48 variables
    boy this is exciting. almost as good as Christmas

  9. #9
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    You can hook it up like this
    Attached Images
    Burt

  10. #10
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,709
    Blog Entries
    5

    Default

    There is a special header for RB3 (CCP1) and that little speaker schematic should put out some sound.
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  11. #11
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    the one that said user I hope
    swordfish library
    because swordfish will over write files on up date but not the user library
    Burt

  12. #12
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    Bill I was hoping so I never looked at that part of your circuit just the leds I love assembly and and so I tried your code and used the led part of the junebug I would buy one if I had
    a job but work is slow right now.
    Burt

  13. #13
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,709
    Blog Entries
    5

    Default

    The piezo speaker will have a sweet spot frequency where it's going to be the loudest.
    Now RB.3 (or CCP1/PWM) can generate a frequency all by itself. It's a set and forget kind of thing.
    Here's a Swordfish PWM module to wet your appetite.
    Swordfish Wiki | SwordfishUser / PWM2 browse

    The older PICBASIC Pro has a TONE command plus it can synthesize DTMF dual tones (like a touchtone phone) in software. So it's possible but I don't know the algorythm offhand. (Eric Smith wrote something like this if I recall)
    http://www.brouhaha.com/~eric/pic/dtmf.html

    Now it's in ancient 16C54 asm but when/if you decide to tackle asm you'll find the debugger really handy.

    And of course Roman Blacks sound generation on a PIC (I recall 3V0 playing with this)
    Official Home Page of the Roman Black
    Last edited by blueroomelectronics; 3rd April 2009 at 04:01 AM. Reason: Found the link
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

  14. #14
    be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent be80be Excellent
    Join Date
    Aug 2008
    Location
    morristown,tn
    Posts
    2,000

    Default

    Bill He has that thats what I gave him there are 2 and when you down load them they have the same name so I change it because 1 works better on some chips like the 18f1330
    Burt

  15. #15
    Help us help you blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent blueroomelectronics Excellent
    Join Date
    Jan 2007
    Location
    Toronto, Canada
    Posts
    10,709
    Blog Entries
    5

    Default

    Ahh thanks, didn't notice that

    Here's something I wish I could write for the 18F1320 (yes the Speakjet is a 18F1320)
    http://www.magnevation.com/pdfs/speakjetusermanual.pdf
    Bill
    Smart Kits build Smart People

    http://www.blueroomelectronics.com/

+ Reply to Thread
Page 1 of 2
1 2 Last

Similar Threads

  1. C Instructions Optimization
    By yatoof in forum Micro Controllers
    Replies: 4
    Latest: 16th February 2009, 02:44 PM
  2. offset instructions
    By 4electros in forum Micro Controllers
    Replies: 4
    Latest: 23rd December 2006, 02:20 PM
  3. ia 32 instructions
    By mkh in forum Chit-Chat
    Replies: 2
    Latest: 17th December 2006, 05:33 PM
  4. Purpose of assembly instructions?
    By gregmcc in forum Micro Controllers
    Replies: 2
    Latest: 27th December 2005, 08:58 AM
  5. PIC instructions length
    By french_student in forum Micro Controllers
    Replies: 6
    Latest: 19th December 2003, 12:58 PM

Tags for this Thread