Editing Programming the Device

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
Description on how to use dsPicProgrammer to download firmware to [{{SERVER}}/DsPIC30F_5011_Development_Board DsPIC30F 5011 Development Board]
 
Description on how to use dsPicProgrammer to download firmware to [{{SERVER}}/DsPIC30F_5011_Development_Board DsPIC30F 5011 Development Board]
  
==Loading Bootloader (Once only)==
+
==Requirements==
  
===Hardware Requirement===
+
===Hardware===
#PC with USB port (with Windows)
+
#PC with COM port (Windows XP Installed for MPLAB) OR use a USB-RS232 cable
 
#ICD2 Programmer
 
#ICD2 Programmer
 
#Target Board
 
#Target Board
 
#5V Power Supply
 
#5V Power Supply
  
===Software Requirement===
+
===Software===
 
#[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.
 
#[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.
 +
#[http://chungyan5.no-ip.org/vc/?root=dspicProgrammer dsPicProgrammer] ('''dsPicProgrammer.jar''')
  
 
===Files===
 
===Files===
 
#[http://chungyan5.no-ip.org/vc/?root=dspic_bootloader dsPicBootloader] ('''bl_$(MODEL).hex''').
 
#[http://chungyan5.no-ip.org/vc/?root=dspic_bootloader dsPicBootloader] ('''bl_$(MODEL).hex''').
 +
#Application hex file (e.g. '''app.hex''')
 +
  
===Procedure===
+
==Loading Bootloader (Once only)==
 
{|border="1" cellspacing="0" cellpadding="5"
 
{|border="1" cellspacing="0" cellpadding="5"
 
|+ Loading Bootloader
 
|+ Loading Bootloader
Line 30: Line 33:
 
*Run MPLAB IDE on PC
 
*Run MPLAB IDE on PC
 
*Select: Configure>Select Devices...
 
*Select: Configure>Select Devices...
*Choose the correct dsPic model
+
*Choose dsPIC30F5011
 
|-valign="top"
 
|-valign="top"
| Load Bootloader ||
+
| Target <-> ICD 2  ||
*Select: File>Import...
+
*Use six pin cable. Beware of the pin assignments. Only pin 1 - 5 should be used.
*Select '''bl_$(MODEL).hex'''
+
*Place Jumper on target board (if any). The Jumper connects target V<sub>cc</sub> to ICD 2.
 +
*Do '''NOT''' power-up the target.
 
|-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"
 +
| Load Bootloader ||
 +
*Select: File>Import...
 +
*Select '''bl_5011.hex'''
 
|-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 Target
+
*Power-down the Taget
 
*Select: Programmer>Select Programmer>None
 
*Select: Programmer>Select Programmer>None
 
*Unplug USB cable
 
*Unplug USB cable
Line 61: Line 63:
  
  
==Download and Loading Firmware==
+
==Hardware Setting==
===dsPicProgrammer User Guide===
+
[[Image:DSC00921.JPG]]
[http://chungyan5.no-ip.org/download/software/dsPicProgrammer/dsPicProgrammerUserGuide_V2.0.1.pdf dsPicProgrammerUserGuide_V2.0.1]
+
*Connect your usb to rs232 cable to your computer
 +
*Or Using a real RS232 Port -- COM PORT
  
===Hardware Requirement===
 
#PC (Linux/Windows) with COM Port OR USB-COM converter cable
 
#Target Board (with bootloader)
 
#5V Power Supply
 
  
===Software Requirement===
+
==Download and Loading Firmware==
#[http://chungyan5.no-ip.org/vc/?root=dspicProgrammer dsPicProgrammer]
 
  
===Files===
+
===Make sure the RS232 Port in your computer===
#Application hex file (e.g. '''app.hex''')
+
[[Image:1.jpg]]
 +
*Go to Control Panel \ Device Manager
  
===Procedure===
+
[[Image:2.jpg]]
 
+
*Find out your Device comm port Number
====Setup COM Port====
 
[[Image:DSC00921.JPG | 480px]]
 
*Connect your USB-COM converter cable to your computer
 
*Or Using a real COM PORT
 
  
 +
===Get the Dspic Programmer===
 +
*Download [http://chungyan5.no-ip.org/open_data/electronic_computer/platforms/dspic/dsPicProgrammer/dsPicProgrammer1.5.5.zip dsPic_Programmer.zip], [http://chungyan5.no-ip.org/open_data/electronic_computer/platforms/dspic/dsPicProgrammer/ws/ updated directory] or [http://chungyan5.no-ip.org/vc svn server]
 +
*Save to a directory.
 +
::e.g. desktop
 +
*Unzip the dsPic_Programmer.zip, then you have an unziped file.
 +
[[Image:prog_guid_dl.JPG]]
  
 
----
 
----
=====Find out your COM port Number=====
 
[[Image:1.jpg | 480px]]
 
*Go to Control Panel \ Device Manager
 
  
 +
*Drag the unzip file to a director.
 +
::eg. USB memory devics
 +
[[Image:prog_guid_drag.JPG]]
  
 
----
 
----
[[Image:2.jpg | 480 px]]
 
*Find out your Device COM Port Number
 
  
 +
*Save your .hex file(foo.hex) to your directory location 
 +
::e.g. X:\dsPic_Programmer\ ---> X:\ is the driver where the dsPic_Programmer located
 +
[[Image:prog_guid_hex.JPG]]
  
----
+
===Download Firmware===
====Get the Dspic Programmer====
+
*Start a Command Prompt
[[Image:programmer_3.jpg |480px]]
+
**Start -> Run<br>[[Image:2 1 run.JPG]]<br>
*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]
+
**Enter cmd<br>[[Image:2 2 cmd.JPG]]<br>
*Unzip the dsPicProgrammer.zip, then you have an unziped file.
+
*Run dsPicProgrammer
 
 
 
 
----
 
====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.  
 
**Make sure your device is connected through a "Direct RS232 Cable" to PC Serial Port.  
 +
**Change to the directory where dsPicProgrammer.jar is located and run the command:
 +
***for example, '''jre\bin\java -Djava.library.path=.\rxtx\bin -jar dspicProgrammer.jar COM1 115200 foo.hex'''
 +
***Or directly using '''dsPicProgrammer.bat COM1 115200 foo.hex'''(Windows)
 +
***'''jre\bin\java -jar dsPicProgrammer.jar /dev/ttyS0 115200 foo.hex''' (Linux)
 +
:::where COM1 is your COM Port ID
 +
:::115200 is communication speed [in bps]
 +
:::foo.hex is your firmware new file
 +
::[[Image:5.jpg]]
 +
:*When the program prompt you for an input, press y:<br>[[Image:2 4 prompt.JPG]]<br>
 +
:*If communication can be established, you should see something like this:<br>[[Image:2 5 progress.JPG]]<br>
 +
:*Wait until programming is completed.<br>[[Image:2 6 complete.JPG]]<br>
 +
:*after all completed, power OFF your device, then power ON again, enjoy your new updated.
  
  
----
+
==Troubleshooting==
[[Image:programmer_6.jpg |480px]]
+
===Invalid COM Port===
*Choose a 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>
*Choose a baudrate
+
===Missing firmware file===
::115200 is communication speed [in bps]
+
*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>
  
  
----
+
==Downloads==
[[Image:programmer_7.jpg |480px]]
+
{| border="1" cellspacing="0" cellpadding="5"
*Choose a .hex file
+
|+ Related software download links for dsPicBootloader and dsPicProgrammer
 
+
! Program
 
+
! Site
----
+
! Remarks
[[Image:programmer_8.jpg |480px]]
+
|- valign="top"
*Press start
+
| JDK
*Then press Yes to confirm programming the device
+
| [http://java.sun.com/javase/downloads/index.jsp website]
 
+
| Download latest JDK
 
+
|- valign="top"
 
+
| RXTX
----
+
| [http://users.frii.com/jarvi/rxtx/download.html website]
[[Image:programmer_9.jpg | 480px]]
+
| Download rxtx-2.1-7-bins-r2.zip or later
*The status during programming
+
|- valign="top"
 
+
| dsPicBootloader
 
+
| [http://chungyan5.no-ip.org/vc click]
----
+
| Under "dsPicBootloader/", download bl_5011.s or bl_j128gp306.s
[[Image:programmer_10.jpg |480px]]
+
|-valign="top"
*The programming have been completed, press OK the close the message box
+
| dsPicProgrammer
 
+
| [http://chungyan5.no-ip.org/vc click]
----
+
| Under "dsPicProgrammer/", dowload dsPicProgrammer.jar<br><br>Alternatively, if you want to compile yourself or modify the source code, download <br>all source files under "dsPicProgrammer/" '''plus''' RdFileIntelHex.java under <br>"IntelHexPaser/tags/0.02.00/".<br>You should also install RXTX on your local machine as recommended in the readme file.
===Troubleshooting===
+
|- valign="top"
====Invalid COM Port====
+
| Ingenia's bootloader
*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>
+
| [http://www.ingenia-cat.com/en/downloads.php website]
*Solution: check the COM port ID, or close any programs that are using the COM Port
+
| Download original ingenia's bootloader
====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]]
 

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)