• AVR Freaks

Hot!PIC24 curiosity demo project not working on my board

Author
SmallRedMachine
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2018/11/15 12:17:57
  • Location: 0
  • Status: offline
2019/09/16 13:05:15 (permalink)
0

PIC24 curiosity demo project not working on my board

I have bought the PIC24(16bit) Curiosity Development Board and just tried to run the PIC24F Curiosity Board Demo in the mplabcloud, so this is what's supposed to happen: "Pressing S1 will light LED1. Pressing S2 will light LED2.", now I have followed the instructions given, the USB bridge is connected, the code was successfully built and it says Programming/Verify complete, the red LED above S2 button lights up briefly but as soon as the programming is completed both the red LED and LED3 turn off.
 
The board is connected to my laptop and one thing I noticed, the first time I ran the code my laptop mouse went crazy, clicking automatically non stop, this doesn't happen every time I run it through. don't know what I should do, really worried this may not work at all.
#1

3 Replies Related Threads

    davekw7x
    Entropy++
    • Total Posts : 1827
    • Reward points : 0
    • Joined: 2012/01/16 12:01:07
    • Location: Second star on the right, straight on till morning
    • Status: offline
    Re: PIC24 curiosity demo project not working on my board 2019/09/16 14:54:19 (permalink)
    0
    SmallRedMachine
    I have bought the PIC24(16bit) Curiosity Development Board and just tried to run the PIC24F Curiosity Board Demo in the mplabcloud, so this is what's supposed to happen: "Pressing S1 will light LED1. Pressing S2 will light LED2."

    Ummm...
    Did you download the file from here? https://mplabxpress.micro...ud/example/details/268
     
    [Edit]
    Well, ignore the first statement of the description (the one you quoted).  That's just plain bogus.  See Footnote.
    I was working from notes about a previous version.  The current version is completely functional, consistent with both items described on the web page.
    I am very sorry about posting bad information.
     [/Edit]
    Here's the functionality, as described in the next statement on that page:
    "The potentiometer will increase the intensity of one of the colors of the RGB LED (LED3). Pressing S1 or S2 will cycle to the next color."
     
    So: Vary the pot setting and see what happens.  Then press S1 and vary the pot again.  Repeat these two steps.  Again.
     
    Then LOOK AT THE CODE in main().
     
    Bottom line: The code works for me as described in the second statement of the description (the one that I quoted above).
     
    Regards,
     
    Dave
     
    Footnote
    My many, many (many) years of experience unravelling OPC Other People's Code) have taught me one thing: External documentation is important, as are comments in the code itself, but the only thing that counts is the code.  It's common to modify the code and forget to update the documentation.
     
    post edited by davekw7x - 2019/09/17 07:44:37

    Sometimes I just can't help myself...
    #2
    SmallRedMachine
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2018/11/15 12:17:57
    • Location: 0
    • Status: offline
    Re: PIC24 curiosity demo project not working on my board 2019/09/16 15:33:48 (permalink)
    0
    davekw7x
    SmallRedMachine
    I have bought the PIC24(16bit) Curiosity Development Board and just tried to run the PIC24F Curiosity Board Demo in the mplabcloud, so this is what's supposed to happen: "Pressing S1 will light LED1. Pressing S2 will light LED2."

    Ummm...
    Did you download the file from here? https://mplabxpress.micro...ud/example/details/268
    Well, ignore the first statement of the description (the one you quoted).  That's just plain bogus.  See Footnote.
     
    Here's the functionality, as described in the next statement on that page:
    "The potentiometer will increase the intensity of one of the colors of the RGB LED (LED3). Pressing S1 or S2 will cycle to the next color."
     
    So: Vary the pot setting and see what happens.  Then press S1 and vary the pot again.  Repeat these two steps.  Again.
     
    Then LOOK AT THE CODE in main().
     
    Bottom line: The code works for me as described in the second statement of the description (the one that I quoted above).
     
    Regards,
     
    Dave
     
    Footnote
    My many, many (many) years of experience unravelling OPC Other People's Code) have taught me one thing: External documentation is important, as are comments in the code itself, but the only thing that counts is the code.  It's common to modify the code and forget to update the documentation.
     


    I haven't used any microcontroller for a while so I'm back to being a complete beginner again so the code is not making any sense to me, was just trying to figure out if the board works at all ! once I compile it they all stop illuminating then when I disconnect the USB and plug it back in the buttons, LED 1 & 2 and also the pot all start working again until I try to compile it...
     
    But so far really disappointed with my purchase, I might as well could bought any other microcontroller as there is really no tutorial for my particular board, don't know why it's advertised for beginners, I will have to start from trying to lighting up an external LED and work my way up from there.
    #3
    davekw7x
    Entropy++
    • Total Posts : 1827
    • Reward points : 0
    • Joined: 2012/01/16 12:01:07
    • Location: Second star on the right, straight on till morning
    • Status: offline
    Re: PIC24 curiosity demo project not working on my board 2019/09/17 07:39:00 (permalink)
    5 (2)
    SmallRedMachine
    was just trying to figure out if the board works at all ! once I compile it they all stop illuminating then when I disconnect the USB and plug it back in the buttons, LED 1 & 2 and also the pot all start working again until I try to compile it...

     
    First of all, I apologize for the misinformation in my previous post.  I had been using some older demo code.  The current version from the link I gave is completely functional, consistent with all of the description on the web page.  Sorry.

    So, here's a fresh start:
    • Unzip the zip file.
    • Plug a USB cable from your PC into the micro-B connector on the PIC24F Curiosity board.
    • Start MPLABX and open the project.
    • Right-click the PIC24F_Curiosity_Board_Demo thing in the Projects window.
    • It shows "Simulator" selected as the Hardware tool.
    • Scroll down select the "PIC24F Curiosity" item under Microchip Kits (PKOB).
    • Select your XC16 compiler version.  I'm using version 1.40, but, as far as I know, any version will work.  Select your version.
    • Click OK
    Now, click the "Make and Program Device" icon on the menu bar.  Here's where some beginners (and some not-so-beginners) bog down.  It may have to update the PKOB firmware, and I have found that the first attempt is likely to fail.  Just try the "Make and Program Device" again.  If it still fails, then you may have to do other steps like unplugging and plugging the USB cable and going through the Properties menu again.  Different things work for different folks.
     
    Anyhow, once it is programmed successfully, the RGB LED will be illuminated.  As you vary the potenometer setting, the color changes from pretty Green to sort of Orange.  At least that's my observation.

    Press S1: LED1 goes on. Release S1 LED1 goes off.
    Now when you vary the pot setting it goes the tri-color LED goes from Blue to Green.  (Or at least, something other than the colors from the original load.)

    Play around with setttings. By pressing S1 and/or S2 and varying the pot each time.

    Now: Press the Reset button on the Curiosity board.  Operation reverts to the condition that was in effect immediately after programming. Play around a few times more.

    Unplug the USB cable and plug it in again.  There will be a delay of a couple of seconds while the PKOB circuitry on the Curiosity board is initializing itself, then operation becomes the same as it was immediately after programming.
     
    SmallRedMachine
    don't know why it's advertised for beginners

    Comments:
    • If you use the Debug menu to program the device instead of "Make and Program Device" you will discover that it won't work unless you are actually debugging.  That is, a reset or power cycle will not result in normal operation.  People who have never used MPLABX might not realize that a Debug build puts additional code that makes "ordinary" operation (i.e. not using the debugger) not possible.
    • My invitation to LOOK AT THE CODE might not be (probably won't be) be helpful to "beginners," since it there is a lot of stuff: Using a timer interrupt to process and debounce switch closures that change the state.  Things like that.  It can be an interesting demonstration of use of ADC and timers and interrupts, etc., and may be a useful learning experience and reference once they have got beyond the fundamentals, but not necessarily a good point for starting to learn about C and embedded programming in C and fundamentals of PIC24 programming in C.
    • The part that is useful for "beginners" is that the hardware is set up with LEDs, Switches, a 32 kHz clock for secondary oscillator usage.  There is a reset button and a programming interface that requires only a USB connection to your workstation; no external PICkit or other programmer is required, and no other power supply is required to get it up and running.

    Regards,

    Dave
    post edited by davekw7x - 2019/09/17 07:50:25

    Sometimes I just can't help myself...
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5