Difference between revisions of "**OBSOLETE** Getting Started with PIC32 and UBW32"
Andrew Long (talk | contribs) (→MPLAB) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 29: | Line 29: | ||
The HEX for Firmware version 1.1 can be downloaded [[Media:UBW32_Firmware_v1_1.hex | '''here''']]. |
The HEX for Firmware version 1.1 can be downloaded [[Media:UBW32_Firmware_v1_1.hex | '''here''']]. |
||
The Files for the Firmware can be downloaded [[Media:UBW32_Firmware_v1_1.zip | '''here''']]. It is not necessary to download these files unless you want to modify the Firmware. It is NOT recommended to modify the firmware. |
The Source Files for the Firmware can be downloaded [[Media:UBW32_Firmware_v1_1.zip | '''here''']]. It is not necessary to download these files unless you want to modify the Firmware. It is NOT recommended to modify the firmware. |
||
Using the HEX downloaded above, use directions [[Directions to Load Files to PIC32 | here]] to download the hex with the bootloader to the PIC. |
Using the HEX downloaded above, use directions [[Directions to Load Files to PIC32 | here]] to download the hex with the bootloader to the PIC. |
||
Line 41: | Line 41: | ||
Download and Install [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en536656 Microchip C32 Compiler] (the academic version is free) |
Download and Install [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en536656 Microchip C32 Compiler] (the academic version is free) |
||
Download and Install [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en537044 PIC32 USB Device/Embedded Host Software Stack] located at bottom of page (this software contains common source code and header files) |
Download and Install [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2680&dDocName=en537044 PIC32 USB Device/Embedded Host Software Stack] located at bottom of page (this software contains common source code and header files) Note: this stack may get combined with the applications library of PIC18 and PIC24. |
||
* Header files from the framework do not need to be specifically added to the project in MPLAB, but MPLAB needs to be directed to their location (see HelloUSBWorld for directions) |
* Header files from the framework do not need to be specifically added to the project in MPLAB, but MPLAB needs to be directed to their location (see HelloUSBWorld for directions) |
||
* Source files from the framework do need to be added to the project |
* Source files from the framework do need to be added to the project |
||
Line 47: | Line 47: | ||
= Linker File = |
= Linker File = |
||
When creating new projects to download to the PIC. Make sure [[Media:procdefs.ld | procdefs.ld]] linker file is in the project folder. |
When creating new projects to download to the PIC. Make sure [[Media:old-procdefs.ld | procdefs.ld]] linker file is in the project folder. The procdefs.ld for UBW32 is different than the standard procdefs.ld for PIC32 when using the bootloader originally installed on UBW32. Make sure to use the procdefs.ld file above for UBW32. |
||
This [http://www.paintyourdragon.com/uc/ubw32/index.html website] warns that if this linker file is not in the project the bootloader may be hosed. |
This [http://www.paintyourdragon.com/uc/ubw32/index.html website] warns that if this linker file is not in the project the bootloader may be hosed. |
||
= Start Up Projects = |
= Start Up Projects = |
||
* [[Media:HelloWorld_PIC32.zip|'''HelloWorld.zip''']] |
|||
* [[Media:HelloUSBWorld_PIC32.zip|'''HelloUSBWorld.zip''']] |
|||
Follow [[Directions for Starting New MPLAB Project]]. |
Latest revision as of 20:39, 8 February 2012
Follow these steps to get the UBW32 started.
Driver for UBW32
Download the driver to your computer from here.
Plug a miniUSB cord into the UBW32 and into the computer.
The New Hardware Wizard should appear. The driver is for a COM PORT. Complete wizard and select driver you downloaded.
The UBW32 should now communicate with the computer.
Open a terminal (I used HyperTerminal) and type 'v'. The Firmware version should appear.
Bootloader
An advantage of the UBW32 is that a bootloader has already been installed. This means you do not need to a programmer to put new programs on the PIC32.
The HID bootloader v2.4 executable can be downloaded here.
This bootloader is used to put HEX files on the PIC32.
NOTE: occassionally, the bootloader will get stuck verifying that the program is running. (There must be a bug in the bootloader application code) It will take 90-100% of CPU. End task manually with the task manager if this happens.
Firmware
There is already firmware installed on the PIC32. This firmware should be updated.
The HEX for Firmware version 1.1 can be downloaded here.
The Source Files for the Firmware can be downloaded here. It is not necessary to download these files unless you want to modify the Firmware. It is NOT recommended to modify the firmware.
Using the HEX downloaded above, use directions here to download the hex with the bootloader to the PIC.
MPLAB
MPLAB is the software used for editing, compiling, debugging code. This software creates the HEX files to download to the PIC.
Download and Install Microchip MPLAB (Microchip's free IDE for editing, debugging and compiling code)
Download and Install Microchip C32 Compiler (the academic version is free)
Download and Install PIC32 USB Device/Embedded Host Software Stack located at bottom of page (this software contains common source code and header files) Note: this stack may get combined with the applications library of PIC18 and PIC24.
- Header files from the framework do not need to be specifically added to the project in MPLAB, but MPLAB needs to be directed to their location (see HelloUSBWorld for directions)
- Source files from the framework do need to be added to the project
Linker File
When creating new projects to download to the PIC. Make sure procdefs.ld linker file is in the project folder. The procdefs.ld for UBW32 is different than the standard procdefs.ld for PIC32 when using the bootloader originally installed on UBW32. Make sure to use the procdefs.ld file above for UBW32.
This website warns that if this linker file is not in the project the bootloader may be hosed.