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 SIRC RX - Complete

Discussion in 'Microcontrollers' started by UTMonkey, Jan 14, 2008.

  1. ex-navy

    ex-navy New Member

    Joined:
    Jan 28, 2008
    Messages:
    29
    Likes:
    0
    Location:
    Toronto Canada
    Thanks Bill

    Ok, I have everything setup as your workspace, including the watch Commandcode and DeviceCode.

    I have LED1 lit, send a SIRC IR and LED2 illuminates.

    No values in either command or device......??
     
  2. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    I forgot you have to pause/stop the debugger for the watch window to update. A breakpoint near the very end of the program will work.
    find this line (forth from the end)
    btfsc PORTB, RB2
    and set a breakpoint (double click)
     
  3. ex-navy

    ex-navy New Member

    Joined:
    Jan 28, 2008
    Messages:
    29
    Likes:
    0
    Location:
    Toronto Canada
    ok, got the breakpoint set

    maybe my remote is not sirc 12[​IMG]
     
    Last edited: Feb 1, 2008
  4. dave

    Dave New Member

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


     
  5. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada

    I'll have to try an extended remote and see what happens. Here's my copy just to be sure it's the same.
     

    Attached Files:

  6. ex-navy

    ex-navy New Member

    Joined:
    Jan 28, 2008
    Messages:
    29
    Likes:
    0
    Location:
    Toronto Canada
    I tried a re-program of the PIC and this is what I am getting for error:

    Programming Target (2/1/2008 11:44:04 PM)
    Erasing Target
    Programming Program Memory (0x0 - 0x1FFF)
    Verifying Program Memory (0x0 - 0x1FFF)
    Programming EEPROM Memory (0x0 - 0xFF)
    Verifying EEPROM Memory (0x0 - 0xFF)
    Programming User ID Memory
    Verifying User ID Memory
    Programming Configuration Memory
    Verifying Configuration Memory
    PK2Error0027: Failed verify (Address = 0x30000C - Expected Value 0x0 - Value Read 0x3)
    PICkit 2 Ready
     
  7. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Thats odd, Is that with my program?
     
  8. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    No. Not if you expect anything to happen on the Junebug board. MPLAB Sim means the program runs in the simulator, not on the chip. Choose PICkit2 to debug on the chip.

    For it to debug on the chip, you have to build (assemble) the program in Debug mode and program it to the chip from the Debugger menu. That way it programs the debug code as well as the program.

    After you do that you can do all the nice debug things with the actual code on the chip, like watch variables, start and stop the program at will, set breakpoints, single step, etc..

    You can do all the same things in the sim, but you won't get data from stuff on the target board, like the IR, because the target board is not running. Good for some things, but useless for what you're trying to do. :)
     
    Last edited: Feb 1, 2008
  9. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    I completely missed that it was the simulator, nice catch futz.
     
  10. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,329
    Likes:
    653
    Location:
    Derbyshire, UK
    The extension is added on the end of the earlier standard, so the 12 bit code will happily receive the later extended codes (or at least mine does).
     
  11. ex-navy

    ex-navy New Member

    Joined:
    Jan 28, 2008
    Messages:
    29
    Likes:
    0
    Location:
    Toronto Canada
    Hi guys,

    I originally thought "to run in debug mode" meant selecting debugger>Select tool>MPLAB SIM.

    I now understand that this is just a software simulator and not the actual
    PIC outputs.

    Being a newbie to all of this, I think that I might tend to rush and not read
    everything.

    Can I assume these points are correct:

    MPLAB 8.0 Project wizard, select device, select MPASM toolsuite and the 3 files associated.

    Create project file and save it.

    Skip the linker file in this case as the SONY SIRC code it's not relocatable code.

    Click finish.

    Workspace, add SONY SIRC.asm to source code.

    Plug Junebug into USB, select Programmer as Pickit2

    Response from Pickit2 is READY

    Double click on SONY SIRC.asm

    Set breakpoint at btfsc PORTB, RB2

    Build all

    Program the 18f1320 by selecting Programmer>Program

    Pickit2 output verifies target was programmed.

    Turn off 3 Tutor dip switches on Junebug

    LED1 on Junebug lights to reflect that Junebug is ready to receive SIRC.

    View>watch>add symbol Commandcode & Devicecode

    Point remote at Junebug, select button, LED2 illuminates to show valid code
    received.

    No value shown in Commandcode or Devicecode


    I bet you I am missing something very easy being new to PIC programming.

    A thumbnail is attached (workspace)

    [​IMG]

    Thanks
     
    Last edited: Feb 2, 2008
  12. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
  13. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Right there you went wrong. Don't select a programmer at all. Instead, select a debugger. You can't have both at the same time (except with the sim). After selecting your debugger you will program the chip from the Debugger menu instead of the Programmer menu.
     
  14. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Hey futz, what do you think of the debug video? does it work on your PC?
     
  15. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    90% of my machines are Linux. My main machine (the one I'm on now) is Linux. Much prefer it over Windoze. My programming machine is dual boot with Windows first, as all the tools are Windows, and Wine won't do everything.

    Anyway, on this Linux machine, when I go to get your SWF file to play it starts, downloads the first little bit (and will play it fine) and then the download stalls every time. Can't seem to get it to download the rest. I think it might be your server, but can't be sure. Should try it on a Windoze box but I have to go to work very soon here. I'll try it later today on Windoze.

    What I did do to make the movie larger was to link directly to the swf..

    EDIT: By "pounding away" at it - reloading the page over and over - I finally got it all downloaded. And it plays fine. :D It's your server, I think. Maybe they're serving swf's at low priority or something?

    EDIT2: Tried it on a windoze box and it's the same deal. Your server sends about the first 5% and then stalls. I got disgusted with waiting, tried the one on my server and it just downloaded right through. No delays at all. I'm a very happy Site5 customer.
     
    Last edited: Feb 2, 2008
  16. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Yup, that explains it. A spoken audio track wouldn't hurt, but not necessary. That first zoom shouldn't last so long. Should zoom out some before the build so you can see the window on the right properly.
     
    Last edited: Feb 2, 2008
  17. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Hmm, I'm heading out today. I'll try it from a friends house. Maybe move it to a hosting service.
     
  18. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    I have oodles of space and unused traffic capacity. I'm kind of a hosting reseller, but with no customers but myself and one other guy. :D Hey, it was the same price as my previous hosting place that only had capacity for a single site! I can host it for ya. But of course I can't put it up right now. Later today.
     
  19. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    It's uploaded. Here's the link. Try this if you can't get Bill's copy to download. :D
     
  20. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    Thanks futz, PS futz would you like to work on the Ladybug with me. I could use a second opinion.
     

    Attached Files:

  21. ex-navy

    ex-navy New Member

    Joined:
    Jan 28, 2008
    Messages:
    29
    Likes:
    0
    Location:
    Toronto Canada
    Bill,

    First of all, thank you for the FIRST CLASS help!!!

    As a newbie, the movie clip is worth more than a 1,000 words. Awesome idea.

    Very creative thinking!

    As a consumer, one of my further purchase descisions for the Firely, Dragonfly, (already bought the Unicorn) would be based on this excellent video training demonstration.

    I think that anyone who is thinking of buying a PIC tutorial/programmer should look at how you present the user information to them as an important factor.

    You have helped me immensely!

    Thank you very much
     

Share This Page