Difference between revisions of "DsPIC30F 5011 Development Board"

From OpenCircuits
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{sprotected2}}
+
{{sprotected}}
  
 
==Programming the Device==
 
==Programming the Device==

Revision as of 20:52, 21 February 2007

Template:Sprotected

Programming the Device

Requirements

  • Hardware
  1. PC with COM port (Windows XP Installed for MPLAB)
  2. ICD2 Programmer
  3. Target Board
  4. 5V Power Supply
  • Software
  1. MPLAB IDE v7.50 or higher
  2. dsPicProgrammer (dsPicProgrammer.jar)
  3. RXTX driver
  • Files
  1. dsPicBootloader (ingenia.hex). Original assembly code by ingenia can be downloaded from here.
  2. Application hex file (e.g. app.hex)

Loading Bootloader (Once only)

Table 9.1 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 dsPIC30F5011
Target <-> ICD 2
  • Use six pin cable. Beware of the pin assignments. Only pin 1 - 5 should be used.
  • Place Jumper on target board (if any). The Jumper connects target Vcc to ICD 2.
  • Do NOT power-up the target.
ICD 2 <-> PC
  • Plug-in ICD 2 to PC via USB cable
  • Power-up the target.
  • 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.
Load Bootloader
  • Select: File>Import...
  • Select ingenia.hex
Start Programming
  • Select: Programmer>Program
Finishing
  • Power-down the Taget
  • Select: Programmer>Select Programmer>None
  • Unplug USB cable

Loading Application

Table 9.2 Loading Application File
Step Remarks
Install RXTX
  • For Windows User:
    • copy RXTXcomm.jar to \jre\lib\ext (under java)
    • copy rxtxSerial.dll to \jre\bin
  • For Linux User:
    • copy RXTXcomm.jar to /jre/lib/ext (under java)
    • copy librxtxSerial.so to /jre/lib/[machine type] (i386 for instance)
Connect target board
  • For Windows User:
    • connect to COM1 (or other useable port)
  • For Linux User:
    • connect to ttyS0 (or other useable port)
Open a console window
  • In Windows, Start>Run, and type cmd.
Start Programming
  • Change to the directory containing dsPicProgrammer.jar
  • Execute dsPicProgrammer.jar
    • For Windows User: java -jar dsPicProgrammer.jar COMi Y:\foo2\app.hex
    • For Linux User: java -jar dsPicProgrammer.jar /dev/ttySi Y:/foo2/app.hex
  • Power-up target board
Finishing
  • Power-down target board
  • Disconnect from COM port


Remote Access

  • At the moment, local devices (e.g. EEPROM, ADC, DAC, etc.) can only be accessed locally through POSIX functions such as open(), read(), write(), ioctl().
  • However, a client may need to access these devices on a remote server. This section reviews the background and gives some ideas on its possible implementation.

Requirements

  • A remote file access protocol, to transfer "files" (i.e. device's data) such as:
  1. File Transfer Protocol (FTP): Required files are copied from sever to client for manipulation
  2. Remote Shell (RSH): Required files are copied from sever to client for manipulation
  3. Network File System (NFS): Required files are manipulated on sever
  • An API to access files using a selected protocol, such as:
  1. lam_rfposix: A POSIX-like remote file service for Local Area Multicomputer
  2. API employed by VxWorks: VxWorks is a Unix-like real-time operating system, commonly used for embedded systems.

API Reference for VxWorks


To Do List

  1. Construct examples codes for using DSP library
  2. Construct examples codes for using Build-in library
  3. GUI Interface for Benchtop boards