Difference between revisions of "Programming the Device"
Jump to navigation
Jump to search
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)== |
− | ===Hardware=== | + | ===Hardware Requirement=== |
− | #PC with | + | #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. 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. | ||
− | |||
===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'''). | ||
− | |||
− | + | ===Procedure=== | |
− | == | ||
{|border="1" cellspacing="0" cellpadding="5" | {|border="1" cellspacing="0" cellpadding="5" | ||
|+ Loading Bootloader | |+ Loading Bootloader | ||
Line 33: | 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" | ||
| ICD 2 <-> PC || | | ICD 2 <-> PC || | ||
Line 50: | Line 42: | ||
| Load Bootloader || | | Load Bootloader || | ||
*Select: File>Import... | *Select: File>Import... | ||
− | *Select ''' | + | *Select '''bl_$(MODEL).hex''' |
+ | |-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. | ||
|-valign="top" | |-valign="top" | ||
| Start Programming || | | Start Programming || | ||
*Select: Programmer>Program | *Select: Programmer>Program | ||
+ | *Wait until finishes | ||
|-valign="top" | |-valign="top" | ||
| Finishing || | | Finishing || | ||
Line 63: | Line 60: | ||
− | ==Hardware | + | ==Download and Loading Firmware== |
+ | |||
+ | ===Hardware Requirement=== | ||
+ | #PC (Linux/Windows) with COM port OR use a USB-RS232 cable | ||
+ | #Target Board (with bootloader) | ||
+ | #5V Power Supply | ||
+ | |||
+ | ===Software Requirement=== | ||
+ | #[http://java.sun.com/javase/downloads/index.jsp JAVA JDK or JRE] | ||
+ | #[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=== | ||
+ | #Application hex file (e.g. '''app.hex''') | ||
+ | |||
+ | ===Procedure=== | ||
+ | |||
+ | ====Setup COM Port==== | ||
[[Image:DSC00921.JPG]] | [[Image:DSC00921.JPG]] | ||
*Connect your usb to rs232 cable to your computer | *Connect your usb to rs232 cable to your computer | ||
*Or Using a real RS232 Port -- COM PORT | *Or Using a real RS232 Port -- COM PORT | ||
− | |||
− | |||
− | |||
− | |||
[[Image:1.jpg]] | [[Image:1.jpg]] | ||
*Go to Control Panel \ Device Manager | *Go to Control Panel \ Device Manager | ||
Line 78: | Line 88: | ||
*Find out your Device comm port Number | *Find out your Device comm port Number | ||
− | ===Get the Dspic Programmer=== | + | ====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] | *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. | *Save to a directory. | ||
Line 87: | Line 97: | ||
---- | ---- | ||
− | *Drag the unzip file to a | + | *Drag the unzip file to a directory. |
::eg. USB memory devics | ::eg. USB memory devics | ||
[[Image:prog_guid_drag.JPG]] | [[Image:prog_guid_drag.JPG]] | ||
Line 97: | Line 107: | ||
[[Image:prog_guid_hex.JPG]] | [[Image:prog_guid_hex.JPG]] | ||
− | ===Download Firmware=== | + | ====Download Firmware==== |
*Start a Command Prompt | *Start a Command Prompt | ||
**Start -> Run<br>[[Image:2 1 run.JPG]]<br> | **Start -> Run<br>[[Image:2 1 run.JPG]]<br> | ||
Line 103: | Line 113: | ||
*Run dsPicProgrammer | *Run dsPicProgrammer | ||
**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: | + | **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 |
− | *** | + | ***'''dsPicProgrammer.bat COM1 115200 foo.hex''' (Windows) or |
− | ***''' | + | ***'''dsPicProgrammer.sh /dev/ttyS0 115200 foo.hex''' (Linux) |
:::where COM1 is your COM Port ID | :::where COM1 is your COM Port ID | ||
:::115200 is communication speed [in bps] | :::115200 is communication speed [in bps] | ||
Line 117: | Line 127: | ||
− | ==Troubleshooting== | + | ===Troubleshooting=== |
− | ===Invalid COM Port=== | + | ====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> | + | *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> |
− | ===Missing firmware file=== | + | *Solution: check the COM port ID, or close any programs that are using the COM Port |
− | *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 firmware file==== |
− | ===Missing RXTX driver=== | + | *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> |
− | *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: 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''' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 20:01, 23 February 2009
Description on how to use dsPicProgrammer to download firmware to DsPIC30F 5011 Development Board
Loading Bootloader (Once only)
Hardware Requirement
- PC with USB port (with Windows)
- ICD2 Programmer
- Target Board
- 5V Power Supply
Software Requirement
- 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
- dsPicBootloader (bl_$(MODEL).hex).
Procedure
Step | Remarks |
---|---|
Install MPLAB IDE |
|
Install USB Driver |
|
Select Target Chip |
|
ICD 2 <-> PC |
|
Load Bootloader |
|
Target <-> ICD 2 |
|
Start Programming |
|
Finishing |
|
Download and Loading Firmware
Hardware Requirement
- PC (Linux/Windows) with COM port OR use a USB-RS232 cable
- Target Board (with bootloader)
- 5V Power Supply
Software Requirement
- JAVA JDK or JRE
- RXTX Driver: Download rxtx-2.1-7-bins-r2.zip or later
- dsPicProgrammer (dsPicProgrammer.jar)
Files
- Application hex file (e.g. app.hex)
Procedure
Setup COM Port
- Connect your usb to rs232 cable to your computer
- Or Using a real RS232 Port -- COM PORT
- Go to Control Panel \ Device Manager
- Find out your Device comm port Number
Get the Dspic Programmer
- Download dsPic_Programmer.zip, updated directory or svn server
- Save to a directory.
- e.g. desktop
- Unzip the dsPic_Programmer.zip, then you have an unziped file.
- Drag the unzip file to a directory.
- eg. USB memory devics
- Save your .hex file(foo.hex) to your directory location
- e.g. X:\dsPic_Programmer\ ---> X:\ is the driver where the dsPic_Programmer located
Download Firmware
- Start a Command Prompt
- Start -> Run
File:2 1 run.JPG - Enter cmd
File:2 2 cmd.JPG
- Start -> Run
- Run dsPicProgrammer
- 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
- dsPicProgrammer.bat COM1 115200 foo.hex (Windows) or
- dsPicProgrammer.sh /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
- When the program prompt you for an input, press y:
File:2 4 prompt.JPG - If communication can be established, you should see something like this:
- Wait until programming is completed.
- after all completed, power OFF your device, then power ON again, enjoy your new updated.
Troubleshooting
Invalid COM Port
- 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
- 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
- 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
- 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