Announcement

Collapse
No announcement yet.

Adventures in Microchip Curiosity Nano Land

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adventures in Microchip Curiosity Nano Land

    About a year ago, I bought a couple varieties of Microchip's PIC Curiosity Nano development board thinking that they would make great processor components for some future projects. I've been using the original Curiosity Board (DM164137) with a PIC16F18346 installed as a development platform for most of my PBP code work, and porting code over these Nano boards (the PIC16F18446-based DM164144 and the PIC16F15376-based DM164148) suits many of my projects. My intentions, however, were temporarily derailed when I discovered that PBP did not support (yet) the PIC16F18446 and that the PIC16F15376 was factory set for 3.3 volts (my projects are mostly 5 volt based - actually, all the Nano boards are factory set to 3.3 volts).

    MELabs released PBP update v3.1.3.4 earlier this year that includes the PIC16F18446 family support, and with this update installed, I set off on a journey through Curiosity Nano Land. Both of these Nano boards include an uncommitted LED indicator connected to a port pin, and so as a first step I wrote a short blinky program to verify the Curiosity Nano's drag&drop programming capability via the "mass storage device" interface via USB. After compiling a "blinky.hex" file, I found that both Nano boards worked as advertised in this programming mode. These boards also include PICKit3 and 4 programming capability (if you wire up the interface) and the user guides imply that conventional command line programming (using the "ipecmd.exe" executable) is also accommodated. Since these Nano boards include a USB interface for powering and programming, I wanted to be able to communicate with them directly from Microcode Studio (MCS) via the "compile and program" button, rather than compiling a hex file and installing it outside of MCS. Let the adventures begin. (BTW, I'm running Windows 7 Pro and started with MPLABX v5.30).

    Thinking that the Nano boards couldn't be much different from the Curiosity DM164137 Board, I tried using this programming method. An earlier post of mine provided two alternate parameter formats for programming via the DM164137's USB connector:

    -TSBUR163471457 -P$target-device$ -F$hex-filename$ -E -M -Y -OL -OB (for programming by specifying the Board's serial number)
    or
    -TPPKOB -P$target-device$ -F$hex-filename$ -E -M -Y -OL -OB (for programming by specifying the "PKOB" (PICKit On Board) tool)

    Neither of these command formats proved successful, and thus began many hours of trial and mostly error, that took me through (a) programming attempts with MPLABX IPE, (b) Windows cmd.exe command window with ipecmd.exe, (c) several versions of MPLABX, and (d) many permutations of MCS's Compile and Program Options "Select Parameters".

    Now proceeding directly to the conclusion, here is the configuration for MCS's Compile and Program Options that seems to work for the Nano boards:

    1. From MCS's main window toolbar, click "View / Compile and Program Options / Add New Programmer"

    2. Select "Create a custom programmer entry", click Next and enter a name for the programmer (such as Curiosity Nano)

    3. In the Select Programmer Executable window, type "ipecmd.exe" and click Next

    4. In the Select Programmer Path, click on Find Manually and navigate to the directory where ipecmd.exe is located in MPLABX v5.30
    (this should be C:\Program Files (x86)\Microchip\MPLABX\v5.30\mplab_platform\mplab_ipe) then click Next

    5. In the Select Parameters window, enter the following:
    -TPPKOB -P$target-device$ -F$hex-filename$ -I=updi -E -M -OL -OB

    6. Then click on Finished and then on OK in the Compile and Program Options window

    I found the the -Y parameter that verifies does not work, so I excluded it. The other parameter definitions are found in the Readme for ipecmd.exe file.

    Now to make the adventures even more so, I found that this programming method within MCS works only with MPLABX v5.30 and not with the newest MPLAB v5.45. In fact, while it's possible to program these Nano boards from MPLABX IPE v5.30, MPLAB IPE v5.45 does not even recognize the Nanos' on board programmer. Apparently, Microchip has decided the Nano boards should not be used in a production item. However, the Nano boards are supported within MPLABX IDE v5.45.

    Back to the other original problem of the Nano boards being factory set with the target microcontrollers powered at 3.3 volts, the following procedure works for changing the voltage to 5.0 volts (or any other voltage that is within the settable range described in the Nano's User Guide).

    1. Install MPLABX v5.45 on your PC (this can install in either "Program Files" or "Program Files (x86)" depending on whether you select 64-bit or 32-bit)
    2. Write a blinky program for your Nano board
    3. Either change temporarily or create another custom programmer entry as described above with the path to the ipecmd.exe within MPLABX v5.45
    4. Compile and program your blinky program. When the command window opens, it might indicate that a programmer update is occurring. Then it concludes indicating that programming succeeded, but it really hasn't. Close the command window and revert back to MPLABX v5.30

    All that has been accomplished with the above procedure is updating the Nano's programmer/debugger firmware so that it accepts *.txt commands. For some reason, doing a Compile and Program using MPLABX v5.30 does not update the Nano's firmware, and programming from MPLABX v5.45 doesn't work.

    Now, if you want to change the Nano's target microcontroller's operating voltage to 5.0 volts, do the following:

    1. Using a text editor (Windows Notepad) create a text file with the single line "CMD:5V0", and save it named as Target_5V0.txt
    2. Using the Nano's drag&drop programming, and Windows file Explorer, drag Target_5V0 to the Nano board's mass storage device folder
    3. Verify that the voltage (at the test points illustrated in the User Guide) has changed to 5.0 volts

    Whatever voltage you specify remains through power cycles until changed intentionally by drag&drop a text file comprising CMD:xVx where xVx is the desired voltage for the target.

    After all this, you should be able to (a) program your Curiosity Nano board directly from Microcode Studio and (b) set the Nano's voltage to be compatible with your target application.

    Feedback and comments on this post are welcome, and please advise of any errors, corrections or deviations that anyone discovers.

  • #2
    Changing the Curiosity Nano Target Voltage

    My recent post regarding the Microchip Curiosity Nano included a procedure for setting the Nano's target microcontroller operating voltage level by doing a drag&drop file containing the simple text "CMD:5V0". The Nano user guides describe this voltage change as "Any change to the target voltage is persistent, even through a power toggle."

    While the drag&drop does indeed change the target voltage to that specified in the CMD:nVn command, I discovered the target voltage resets to 3.3 volts following a power toggle. In order to make the change permanent, it must be done through MPLABX v5.45. Here is the procedure that makes the target voltage change permanent.

    1. Open MPLABX v5.45

    2. From the tool bar, select File / Import / HEX/ELF..(Prebuilt)File

    3. In the Import Image File window that opens, browse and select the blinky hex file that you built
    (a) Select in the drop-down the PIC family for the Nano board microcontroller
    (b) Select in the drop-down the PIC device on the Nano board
    (c) Select in the drop-down Hardware Tool the PIC Curiosity Nano S/N ....
    (d) Then click Next and Finish

    4. In MPLABX's main screen left hand window, expand Projects / Prebuilt Files and highlight the blinky.hex file that was loaded in Step 3

    5. Then from the tool bar, select File / Project Properties

    6. In the Project Properties window that opens, select PKOB nano in the left hand window
    (a) select Power in the drop-down Option Categories in the right hand window
    (b) check the Power Target Circuit Box
    (c) type in the new target voltage level, such as 5.0
    (d) then click Apply and then OK

    7. In MPLABX's main screen left hand window, again highlight the blinky.hex file (as in Step 4)

    8. Then click on the Make and Program Device icon (the green down arrow, or one of the Program options on this icon's drop-down)

    9. The Nano board will program with the blinky program, and the target voltage will be adjusted such that it remains permanent through power toggles.

    Comment

    Working...
    X