Difference between revisions of "Programming the Device"
Jump to navigation
Jump to search
(22 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Description on how to use dsPicProgrammer to download firmware to [{{SERVER}}/DsPIC30F_5011_Development_Board DsPIC30F 5011 Development Board] | |
− | ===Hardware=== | + | ==Loading Bootloader (Once only)== |
− | #PC with | + | |
+ | ===Hardware Requirement=== | ||
+ | #PC with USB port (with Windows) | ||
#ICD2 Programmer | #ICD2 Programmer | ||
#Target Board | #Target Board | ||
#5V Power Supply | #5V Power Supply | ||
− | ===Software=== | + | ===Software Requirement=== |
− | #[http://ww1.microchip.com/downloads/en/DeviceDoc/MP750.zip MPLAB IDE v7.50]: v7.60 is not compatible with our current [http://www.sure-electronics.com/ ICD2 Programmers]. There are consistent "Devices cannot be founded" warnings. | + | #[http://ww1.microchip.com/downloads/en/DeviceDoc/MP750.zip MPLAB IDE v7.50]: v7.60 is not compatible with our current [http://www.sure-electronics.com/ ICD2 Programmers]. There are consistent "Devices cannot be founded" warnings. See [http://www.sureelectronics.net/pdfs/DB-DP003.pdf manual] for details. |
− | |||
===Files=== | ===Files=== | ||
− | #[http://chungyan5.no-ip.org/ | + | #[http://chungyan5.no-ip.org/vc/?root=dspic_bootloader dsPicBootloader] ('''bl_$(MODEL).hex'''). |
− | |||
− | |||
− | == | + | ===Procedure=== |
{|border="1" cellspacing="0" cellpadding="5" | {|border="1" cellspacing="0" cellpadding="5" | ||
|+ Loading Bootloader | |+ Loading Bootloader | ||
Line 31: | Line 30: | ||
*Run MPLAB IDE on PC | *Run MPLAB IDE on PC | ||
*Select: Configure>Select Devices... | *Select: Configure>Select Devices... | ||
− | *Choose | + | *Choose the correct dsPic model |
|-valign="top" | |-valign="top" | ||
− | | | + | | Load Bootloader || |
− | * | + | *Select: File>Import... |
− | * | + | *Select '''bl_$(MODEL).hex''' |
− | |||
|-valign="top" | |-valign="top" | ||
| ICD 2 <-> PC || | | ICD 2 <-> PC || | ||
*Plug-in ICD 2 to PC via USB cable | *Plug-in ICD 2 to PC via USB cable | ||
+ | |-valign="top" | ||
+ | | Target <-> ICD 2 || | ||
+ | *Connect six pin cable to target board. Beware of the pin assignments. Only pin 1 - 5 are used. | ||
*Power-up the target. | *Power-up the target. | ||
+ | |-valign="top" | ||
+ | | ICD 2 <-> PC || | ||
*Select: Programmer>Select Programmer>MPLAB ICD 2 | *Select: Programmer>Select Programmer>MPLAB ICD 2 | ||
*If this is the first time the ICD 2 is connected to PC, MPLAB IDE will automatically download the required OS to ICD 2, wait until it has finished | *If this is the first time the ICD 2 is connected to PC, MPLAB IDE will automatically download the required OS to ICD 2, wait until it has finished | ||
*If you have not connected and powered up the target, you might see Warnings on invalid device IDs, and/or running self tests. | *If you have not connected and powered up the target, you might see Warnings on invalid device IDs, and/or running self tests. | ||
*See results of self test if necessary: Programmer>Settings, Status Tab. Refer to [http://ww1.microchip.com/downloads/en/DeviceDoc/51331B.pdf ICD2 User's Guide] Chapter 7. | *See results of self test if necessary: Programmer>Settings, Status Tab. Refer to [http://ww1.microchip.com/downloads/en/DeviceDoc/51331B.pdf ICD2 User's Guide] Chapter 7. | ||
− | |||
− | |||
− | |||
− | |||
|-valign="top" | |-valign="top" | ||
| Start Programming || | | Start Programming || | ||
*Select: Programmer>Program | *Select: Programmer>Program | ||
+ | *Wait until finishes | ||
|-valign="top" | |-valign="top" | ||
| Finishing || | | Finishing || | ||
− | *Power-down the | + | *Power-down the Target |
*Select: Programmer>Select Programmer>None | *Select: Programmer>Select Programmer>None | ||
*Unplug USB cable | *Unplug USB cable | ||
Line 60: | Line 60: | ||
|} | |} | ||
− | ==Hardware | + | |
− | [[Image:DSC00921.JPG]] | + | ==Download and Loading Firmware== |
− | *Connect your | + | ===dsPicProgrammer User Guide=== |
− | == | + | [http://chungyan5.no-ip.org/download/software/dsPicProgrammer/dsPicProgrammerUserGuide_V2.0.1.pdf dsPicProgrammerUserGuide_V2.0.1] |
− | === | + | |
− | [[Image:1.jpg]] | + | ===Hardware Requirement=== |
+ | #PC (Linux/Windows) with COM Port OR USB-COM converter cable | ||
+ | #Target Board (with bootloader) | ||
+ | #5V Power Supply | ||
+ | |||
+ | ===Software Requirement=== | ||
+ | #[http://chungyan5.no-ip.org/vc/?root=dspicProgrammer dsPicProgrammer] | ||
+ | |||
+ | ===Files=== | ||
+ | #Application hex file (e.g. '''app.hex''') | ||
+ | |||
+ | ===Procedure=== | ||
+ | |||
+ | ====Setup COM Port==== | ||
+ | [[Image:DSC00921.JPG | 480px]] | ||
+ | *Connect your USB-COM converter cable to your computer | ||
+ | *Or Using a real COM PORT | ||
+ | |||
+ | |||
+ | ---- | ||
+ | =====Find out your COM port Number===== | ||
+ | [[Image:1.jpg | 480px]] | ||
*Go to Control Panel \ Device Manager | *Go to Control Panel \ Device Manager | ||
− | |||
− | |||
− | [[Image: | + | ---- |
− | * | + | [[Image:2.jpg | 480 px]] |
+ | *Find out your Device COM Port Number | ||
− | |||
− | |||
− | |||
− | [[Image: | + | ---- |
− | * | + | ====Get the Dspic Programmer==== |
− | + | [[Image:programmer_3.jpg |480px]] | |
− | + | *Download [http://chungyan5.no-ip.org/open_data/electronic_computer/platforms/dspic/dsPicProgrammer/dsPicProgrammer3.00.01s.zip dsPicProgrammer.zip], from [http://chungyan5.no-ip.org/open_data/electronic_computer/platforms/dspic/dsPicProgrammer/ws/ updated directory] or [http://chungyan5.no-ip.org/vc svn server] | |
− | + | *Unzip the dsPicProgrammer.zip, then you have an unziped file. | |
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ---- | ||
+ | ====Download Firmware==== | ||
+ | [[Image:programmer_4.jpg |480px]] | ||
+ | *Save your .hex file(foo.hex) to the folder called firmware. | ||
+ | *Run dsPicProgrammer.bat (Windows) / dsPicProgrammer.sh (linux) | ||
+ | **Make sure your device is connected through a "Direct RS232 Cable" to PC Serial Port. | ||
− | + | ---- | |
− | + | [[Image:programmer_6.jpg |480px]] | |
− | * | + | *Choose a COM port |
− | * | + | *Choose a baudrate |
− | :: | + | ::115200 is communication speed [in bps] |
− | + | ||
− | [ | ||
---- | ---- | ||
+ | [[Image:programmer_7.jpg |480px]] | ||
+ | *Choose a .hex file | ||
− | |||
− | |||
− | |||
---- | ---- | ||
+ | [[Image:programmer_8.jpg |480px]] | ||
+ | *Press start | ||
+ | *Then press Yes to confirm programming the device | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ==Troubleshooting== | + | |
− | ===Invalid COM Port=== | + | ---- |
− | *In case of selecting an invalid COM port, you should see the error message:<br>gnu.io.NoSuchPortException: Choosing COM Port Error<br>[[Image:3 1 com err.JPG]]<br><br> | + | [[Image:programmer_9.jpg | 480px]] |
− | ===Missing firmware file=== | + | *The status during programming |
− | *In case of selecting a firmware file that does not exist, you should see the error message:<br>java.io.FileNotFoundException: foo1.hex <The system cannot find the file specified><br>[[Image:3 2 file err.JPG]]<br><br> | + | |
− | ===Missing RXTX driver=== | + | |
− | *In case of missing the RXTX driver, you should see the error message:<br>Exception in thread “main” java.lang.NoClassDefFoundError: gnu/io/UnsupportedCommOperationException<br>[[Image:3 3 rxtx err.JPG]]<br><br> | + | ---- |
+ | [[Image:programmer_10.jpg |480px]] | ||
+ | *The programming have been completed, press OK the close the message box | ||
+ | |||
+ | ---- | ||
+ | ===Troubleshooting=== | ||
+ | ====Invalid COM Port==== | ||
+ | *In case of selecting an invalid COM port, you should see the error message:<br>''gnu.io.NoSuchPortException: Choosing COM Port Error''<br>[[Image:3 1 com err.JPG]]<br><br> | ||
+ | *Solution: check the COM port ID, or close any programs that are using the COM Port | ||
+ | ====Missing firmware file==== | ||
+ | *In case of selecting a firmware file that does not exist, you should see the error message:<br>''java.io.FileNotFoundException: foo1.hex <The system cannot find the file specified>''<br>[[Image:3 2 file err.JPG]]<br><br> | ||
+ | *Solution: check the file path | ||
+ | ====Missing RXTX driver==== | ||
+ | *In case of missing the RXTX driver, you should see the error message:<br>''Exception in thread “main” java.lang.NoClassDefFoundError: gnu/io/UnsupportedCommOperationException''<br>[[Image:3 3 rxtx err.JPG]]<br><br> | ||
+ | *Solution: | ||
+ | **Copy '''RXTXcomm.jar''' to '''/dsPicProgrammer/rxtx/lib''' | ||
+ | **Copy '''rxtxSerial.dll''' to '''/dsPicProgrammer/rxtx/bin''' (Window) | ||
+ | **Copy '''librxtxSerial.so''' to '''/dsPicProgrammer/rxtx/bin''' (Linux) | ||
+ | ====Missing JAVA==== | ||
+ | *In case of missing JAVA JDK or JRE, an error message will be prompted. | ||
+ | *Solution: | ||
+ | **Copy the contents under directory '''C:/Program Files/Java/jre$(VERSION)/''' to '''/dsPicProgrammer/jre''' | ||
+ | |||
+ | == Further reading == | ||
+ | |||
+ | * [[PIC Programmers, In Circuit Programming and BootLoaders]] |
Latest revision as of 22:29, 25 April 2012
Description on how to use dsPicProgrammer to download firmware to DsPIC30F 5011 Development Board
Contents
Loading Bootloader (Once only)[edit]
Hardware Requirement[edit]
- PC with USB port (with Windows)
- ICD2 Programmer
- Target Board
- 5V Power Supply
Software Requirement[edit]
- MPLAB IDE v7.50: v7.60 is not compatible with our current ICD2 Programmers. There are consistent "Devices cannot be founded" warnings. See manual for details.
Files[edit]
- dsPicBootloader (bl_$(MODEL).hex).
Procedure[edit]
Step | Remarks |
---|---|
Install MPLAB IDE |
|
Install USB Driver |
|
Select Target Chip |
|
Load Bootloader |
|
ICD 2 <-> PC |
|
Target <-> ICD 2 |
|
ICD 2 <-> PC |
|
Start Programming |
|
Finishing |
|
Download and Loading Firmware[edit]
dsPicProgrammer User Guide[edit]
dsPicProgrammerUserGuide_V2.0.1
Hardware Requirement[edit]
- PC (Linux/Windows) with COM Port OR USB-COM converter cable
- Target Board (with bootloader)
- 5V Power Supply
Software Requirement[edit]
Files[edit]
- Application hex file (e.g. app.hex)
Procedure[edit]
Setup COM Port[edit]
- Connect your USB-COM converter cable to your computer
- Or Using a real COM PORT
Find out your COM port Number[edit]
- Go to Control Panel \ Device Manager
- Find out your Device COM Port Number
Get the Dspic Programmer[edit]
- Download dsPicProgrammer.zip, from updated directory or svn server
- Unzip the dsPicProgrammer.zip, then you have an unziped file.
Download Firmware[edit]
- Save your .hex file(foo.hex) to the folder called firmware.
- Run dsPicProgrammer.bat (Windows) / dsPicProgrammer.sh (linux)
- Make sure your device is connected through a "Direct RS232 Cable" to PC Serial Port.
- Choose a COM port
- Choose a baudrate
- 115200 is communication speed [in bps]
- Choose a .hex file
- Press start
- Then press Yes to confirm programming the device
- The status during programming
- The programming have been completed, press OK the close the message box
Troubleshooting[edit]
Invalid COM Port[edit]
- In case of selecting an invalid COM port, you should see the error message:
gnu.io.NoSuchPortException: Choosing COM Port Error - Solution: check the COM port ID, or close any programs that are using the COM Port
Missing firmware file[edit]
- In case of selecting a firmware file that does not exist, you should see the error message:
java.io.FileNotFoundException: foo1.hex <The system cannot find the file specified> - Solution: check the file path
Missing RXTX driver[edit]
- In case of missing the RXTX driver, you should see the error message:
Exception in thread “main” java.lang.NoClassDefFoundError: gnu/io/UnsupportedCommOperationException - Solution:
- Copy RXTXcomm.jar to /dsPicProgrammer/rxtx/lib
- Copy rxtxSerial.dll to /dsPicProgrammer/rxtx/bin (Window)
- Copy librxtxSerial.so to /dsPicProgrammer/rxtx/bin (Linux)
Missing JAVA[edit]
- In case of missing JAVA JDK or JRE, an error message will be prompted.
- Solution:
- Copy the contents under directory C:/Program Files/Java/jre$(VERSION)/ to /dsPicProgrammer/jre