Difference between revisions of "Programming the Device"

From OpenCircuits
Jump to navigation Jump to search
(→‎Download and Loading Firmware: update the new menu)
 
(5 intermediate revisions by 3 users not shown)
Line 63: Line 63:
 
==Download and Loading Firmware==
 
==Download and Loading Firmware==
 
===dsPicProgrammer User Guide===
 
===dsPicProgrammer User Guide===
[http://chungyan5.no-ip.org/open_data/electronic_computer/platforms/dspic/dsPicProgrammer/dsPicProgrammerUserGuide_V1.0.0.pdf dsPicProgrammerUserGuide_V1.0.0]
+
[http://chungyan5.no-ip.org/download/software/dsPicProgrammer/dsPicProgrammerUserGuide_V2.0.1.pdf dsPicProgrammerUserGuide_V2.0.1]
 +
 
 
===Hardware Requirement===
 
===Hardware Requirement===
 
#PC (Linux/Windows) with COM Port OR USB-COM converter cable
 
#PC (Linux/Windows) with COM Port OR USB-COM converter cable
Line 70: Line 71:
  
 
===Software Requirement===
 
===Software Requirement===
#[http://java.sun.com/javase/downloads/index.jsp JAVA JDK or JRE]
+
#[http://chungyan5.no-ip.org/vc/?root=dspicProgrammer dsPicProgrammer]
#[http://users.frii.com/jarvi/rxtx/download.html RXTX Driver]: Download rxtx-2.1-7-bins-r2.zip or later
 
#[http://chungyan5.no-ip.org/vc/?root=dspicProgrammer dsPicProgrammer] ('''dsPicProgrammer.jar''')
 
  
 
===Files===
 
===Files===
Line 80: Line 79:
  
 
====Setup COM Port====
 
====Setup COM Port====
:[[Image:DSC00921.JPG]]
+
[[Image:DSC00921.JPG | 480px]]
 
*Connect your USB-COM converter cable to your computer
 
*Connect your USB-COM converter cable to your computer
 
*Or Using a real COM PORT
 
*Or Using a real COM PORT
Line 86: Line 85:
  
 
----
 
----
 
 
=====Find out your COM port Number=====
 
=====Find out your COM port Number=====
[[Image:1.jpg]]
+
[[Image:1.jpg | 480px]]
 
*Go to Control Panel \ Device Manager
 
*Go to Control Panel \ Device Manager
 +
  
 
----
 
----
 +
[[Image:2.jpg | 480 px]]
 +
*Find out your Device COM Port Number
  
 
[[Image:2.jpg]]
 
*Find out your Device COM Port Number
 
  
 
----
 
----
 
 
 
====Get the Dspic Programmer====
 
====Get the Dspic Programmer====
[[Image:programmer_3.jpg]]
+
[[Image:programmer_3.jpg |480px]]
*Download [http://chungyan5.no-ip.org/open_data/electronic_computer/platforms/dspic/dsPicProgrammer/dsPicProgrammer1.5.5.zip dsPic_Programmer.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]
+
*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.
 
*Unzip the dsPicProgrammer.zip, then you have an unziped file.
  
  
 
----
 
----
 
 
 
 
====Download Firmware====
 
====Download Firmware====
[[Image:programmer_4.jpg]]
+
[[Image:programmer_4.jpg |480px]]
 
*Save your .hex file(foo.hex) to the folder called firmware.
 
*Save your .hex file(foo.hex) to the folder called firmware.
 
*Run dsPicProgrammer.bat (Windows) / dsPicProgrammer.sh (linux)
 
*Run dsPicProgrammer.bat (Windows) / dsPicProgrammer.sh (linux)
Line 118: Line 111:
  
 
----
 
----
 
+
[[Image:programmer_6.jpg |480px]]
 
 
[[Image:programmer_6.jpg]]
 
 
*Choose a COM port
 
*Choose a COM port
*Choose a braudrate
+
*Choose a baudrate
 
::115200 is communication speed [in bps]
 
::115200 is communication speed [in bps]
 +
  
 
----
 
----
 
+
[[Image:programmer_7.jpg |480px]]
 
 
 
 
[[Image:programmer_7.jpg]]
 
 
*Choose a .hex file
 
*Choose a .hex file
  
  
 
----
 
----
 
+
[[Image:programmer_8.jpg |480px]]
 
 
 
 
 
 
[[Image:programmer_8.jpg]]
 
 
*Press start  
 
*Press start  
 
*Then press Yes to confirm programming the device
 
*Then press Yes to confirm programming the device
Line 145: Line 130:
  
 
----
 
----
[[Image:programmer_9.jpg]]
+
[[Image:programmer_9.jpg | 480px]]
 
*The status during programming
 
*The status during programming
 +
  
 
----
 
----
 +
[[Image:programmer_10.jpg |480px]]
 +
*The programming have been completed, press OK the close the message box
  
[[Image:programmer_10.jpg]]
+
----
*The the programming have been completed, press OK the close the message box
 
 
 
 
 
 
===Troubleshooting===
 
===Troubleshooting===
 
====Invalid COM Port====
 
====Invalid COM Port====

Latest revision as of 22:29, 25 April 2012

Description on how to use dsPicProgrammer to download firmware to DsPIC30F 5011 Development Board

Loading Bootloader (Once only)[edit]

Hardware Requirement[edit]

  1. PC with USB port (with Windows)
  2. ICD2 Programmer
  3. Target Board
  4. 5V Power Supply

Software Requirement[edit]

  1. 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]

  1. dsPicBootloader (bl_$(MODEL).hex).

Procedure[edit]

Loading Bootloader
Step Remarks
Install MPLAB IDE
  • Do NOT connect ICD 2 (via USB) to PC
  • Execute MPLAB vX.XX Install.exe
Install USB Driver
  • Follow the instruction in (C:\Program Files\Microchip\MPLAB IDE\ICD2\Drivers\Ddicd2.htm)
Select Target Chip
  • Run MPLAB IDE on PC
  • Select: Configure>Select Devices...
  • Choose the correct dsPic model
Load Bootloader
  • Select: File>Import...
  • Select bl_$(MODEL).hex
ICD 2 <-> PC
  • Plug-in ICD 2 to PC via USB cable
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.
ICD 2 <-> PC
  • 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 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 ICD2 User's Guide Chapter 7.
Start Programming
  • Select: Programmer>Program
  • Wait until finishes
Finishing
  • Power-down the Target
  • Select: Programmer>Select Programmer>None
  • Unplug USB cable


Download and Loading Firmware[edit]

dsPicProgrammer User Guide[edit]

dsPicProgrammerUserGuide_V2.0.1

Hardware Requirement[edit]

  1. PC (Linux/Windows) with COM Port OR USB-COM converter cable
  2. Target Board (with bootloader)
  3. 5V Power Supply

Software Requirement[edit]

  1. dsPicProgrammer

Files[edit]

  1. Application hex file (e.g. app.hex)

Procedure[edit]

Setup COM Port[edit]

DSC00921.JPG

  • Connect your USB-COM converter cable to your computer
  • Or Using a real COM PORT



Find out your COM port Number[edit]

1.jpg

  • Go to Control Panel \ Device Manager



2.jpg

  • Find out your Device COM Port Number



Get the Dspic Programmer[edit]

Programmer 3.jpg



Download Firmware[edit]

Programmer 4.jpg

  • 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.



Programmer 6.jpg

  • Choose a COM port
  • Choose a baudrate
115200 is communication speed [in bps]



Programmer 7.jpg

  • Choose a .hex file



Programmer 8.jpg

  • Press start
  • Then press Yes to confirm programming the device



Programmer 9.jpg

  • The status during programming



Programmer 10.jpg

  • 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
    3 1 com err.JPG

  • 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>
    3 2 file err.JPG

  • 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
    3 3 rxtx err.JPG

  • 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

Further reading[edit]