Difference between revisions of "Programming the Device"
Jump to navigation
Jump to search
m (→Hardware Setting: Using a real RS232 Port) |
m (→Download and Loading Firmware: remove the redundance bet. XP & vista) |
||
Line 66: | Line 66: | ||
==Download and Loading Firmware== | ==Download and Loading Firmware== | ||
− | === | + | |
+ | ===Make sure the RS232 Port in your computer=== | ||
[[Image:1.jpg]] | [[Image:1.jpg]] | ||
*Go to Control Panel \ Device Manager | *Go to Control Panel \ Device Manager | ||
Line 73: | Line 74: | ||
*Find out your Device comm port Number | *Find out your Device comm port Number | ||
− | + | ===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 116: | Line 92: | ||
::e.g. X:\dsPic_Programmer\ ---> X:\ is the driver where the dsPic_Programmer located | ::e.g. X:\dsPic_Programmer\ ---> X:\ is the driver where the dsPic_Programmer located | ||
[[Image:prog_guid_hex.JPG]] | [[Image:prog_guid_hex.JPG]] | ||
+ | |||
===Download Firmware=== | ===Download Firmware=== | ||
*Start a Command Prompt | *Start a Command Prompt |
Revision as of 00:23, 2 February 2009
Contents
Requirements
Hardware
- PC with COM port (Windows XP Installed for MPLAB)
- ICD2 Programmer
- Target Board
- 5V Power Supply
Software
- MPLAB IDE v7.50: v7.60 is not compatible with our current ICD2 Programmers. There are consistent "Devices cannot be founded" warnings.
- dsPicProgrammer (dsPicProgrammer.jar)
Files
- dsPicBootloader (bl_5011.hex). Original assembly code by ingenia can be downloaded from here.
- Application hex file (e.g. app.hex)
Loading Bootloader (Once only)
Step | Remarks |
---|---|
Install MPLAB IDE |
|
Install USB Driver |
|
Select Target Chip |
|
Target <-> ICD 2 |
|
ICD 2 <-> PC |
|
Load Bootloader |
|
Start Programming |
|
Finishing |
|
Hardware Setting
- Connect your usb to rs232 cable to your computer
- Or Using a real RS232 Port -- COM PORT
Download and Loading Firmware
Make sure the RS232 Port in your computer
- 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 director.
- 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 directly using dsPicProgrammer.bat COM1 115200 foo.hex(Windows)
- 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
- 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
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>