The DSPIC Evaluation Board can be used stand-alone board builtwith an in-circuit USB programmer. Sample programs are provided to demonstrate the unique features of the supported devices.
The DSPIC Evaluation Board Kit comes with the following:
☞Sample devices (dsPIC30F4011)
☞CD-ROM, which contains: a) Sample programs b) DSPIC Evaluation Board User’s Guide
☞9V AC/DC adapter
DSPIC Evaluation Board
The DSPIC Evaluation Board has the following hardware features:
☞40-pin ZIF socket.
☞+5V regulator for direct input from 9V, 500 mA AC/DC wall adapter
☞Two no’s RS-232 socket and associated hardware for RS-232 interface.
☞ICSP USB 2.0 Programmer with busy LED indication
☞One 5KΩ pot for devices with analog inputs.
☞Four push button switches for external interrupts and Reset.
☞Red power-on indicator LED.
☞A 10 MHz crystal oscillator.
☞16×2 LCD display with CONTRAST adjust
☞Two 20×2 Connector for interfacing with external devices
☞One PBT-3 pin connector for MCU RX and TX out.
☞Three 5×2 FRC box connector for PORT output
☞General purpose area to add external components
☞ZIGBEE wireless module
☞Optional USB power supply
DSPIC EVALUATION HARDWARE
DSPIC Evaluation Board LAYOUT
CHAPTER 2: Hardware Details
40 Pin ZIF socket is provided for the processor. Microcontroller can be removed from the board easily. This socket is intended to use our development board as programmer to program other IC’s.10 pin FRC box type connectors: Three connectors can be found in the board. A 10 pin FRC cable is used to make connection with external.
Pins 1-8 are Data Pins. Pin 9 is VDD and the Pin 10 is GND. All 10 Pin FRC connectors will follow the same rule. If the port has less no of pins then it is arranged from 1 up to 8 and the VDD, VSS are same.
20×2 FRC connectors: this will be FEMALE or MALE type connectors. Connector J10 is connected with microcontroller’s pins 1-20 and the connector J11 is connected to pins 40-21. The following diagram shows the connection.
The external power can be AC or DC, with a voltage (9V, 1A output). The DSPIC board produces +5V using an LM7805 voltage regulator, which provides supply to the peripherals. Power supply is controlled through slide switch J2. We can provide an alternate power supply from USB
1. Open up the user CD comes with DSPIC Microcontroller Board, Navigate to MPLAB IDE Folder
2. Double Click Setup.exe and Click >> Next
3. Click >> I accept the terms of the license agreement and Click >> Next
4. Select >> Complete check box and Click >> Next
5. Click >> Next
6. Click >> I accept the terms of the license agreement for both Application Maestro as well as MPLAB c32 windows and Click >> Next, Next
7. Click >> Next to Start Copying Files
8. Now the MPLAB IDE setup will Progress
9. After finishing installation MPLAB IDE, it will prompt for HI-TECH C Installation. Click >> No
10. Click >> Finish to InstallShield Wizard Complete
11. Just Close the MPLAB IDE Document Support
InstallingMPLAB C30 compiler
Purchase this compiler from microchip or download their 60 days student version. Install the compiler as per their manual. Then follow the next step.
Creating a Project on MPLAB IDE
1. Double Click the MPLAB IDE v8.xx from desktop
2. To create a new project, Click >> Project and Project Wizard.
3. At the first page of Project Wizard, Click >> Next.
4. Step ONE: Next, you will need to select the device for your project. For this demonstration I will use DSPIC16F877A as the device.
5. After selecting the device, click >> Next
6. Step TWO: Select the Compiler for your Project.
7. Click the Active Toolsuite drop box and select MPLAB C30 ToolSuite.
8. There should not be any red “X” mark (For those with the red “X”, please reinstall the MPLAB C30). Click Next to continue.
Example: See the “Red X” mark that appears before CCS C compilers
9. Step Three: Select the directory to store your project and your project name.
☞Click on Browse to open a browser where you choose the directory and the project name.
☞It is advised that you use a new folder for a new project, and all the coding file (c file, h file, asm file) should be stored under the same folder.
10. Now enter the Project Name and Click >> Save
11. Click >> Next to the following window
12. Step four, If you have an existing file Select that file and Click Add>>, Otherwise Just Skip this step by clicking Next.
13. You have successfully created the project. Click Finish to continue.
14. The project that you create will be open after you successfully created it, and this is what you will see at the IDE, a Project window and an Output window.
If you don’t have these windows on your IDE, you can always enable it back by clicking View >> Project and View >> Output.
15. Click on the icon (New File) to create a new file.
16. Enter All your codes or Enter spacebar once and Click File >> Save.
17. Enter the file name with “.c” extension. Check the box “Add File To Project”. Click Save to save it in project directory.
18. IF you forget to Check the box “Add File To Project”, You can add your source file by right clicking at the Source File and click Add Files.
19.Select the file that is being saved. Click Open
20.Now the code file “.c” is added to your project. You can see that it is shown under the Source Files at the Project window.
21. Now Right Click On Linker Script and Click Add Files…
22. Navigate to “C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\gld” and select your IC’s linker script. Click Open
23. Now everything has been done. Now write your code or modify the existing code…
24. Click build All to compile the project and correct the error, do rebuild etc…
3.3 Configuring Programmer for DSPIC Development Board 1.
☞First attach the DSPIC Microcontroller Development Board with PC via USB cable.
☞Connect the 9V AC/DC Adapter with Development Board or Just use USB power.
☞Turn ON the Power Switch (either USB side or EXT side).
☞Wait until the PICkit2 Finishes Driver Installation*. If the driver not detected just try to reconnect or RESTART your system, then try again.
5. After Finishing the Hardware driver installation. Open MPLAB IDE. Select Programmer >> Select Programmer >> PICkit2
6. If the Kit is properly connected, you can see the PICkit2 Icon set on the Toolbar (Yellow Set) and the PICkit2 Ready Message. Very First icon is used for “Programming the device”
7. Finally open our Example Programs, Burn it to the controller, do the hardware connection as per Chapter 4 and See the result.
Error 1: MPLAB may throw “Write Failure-Get lost Error”. If it does, follow the instructions below,
☞Unplug the Power supply from target board
☞Plug the AC/DC adapter
Error 2: MPLAB may throw “target not found” error or “Unspecified device error”. If it does, follow the instructions below
☞Ensure whether the DSPIC microcontroller placed properly in ZIF jacket.
☞In Configure–>Select device, ensure DSPIC16F877A (or any) is selected.
Error 3: MPLAB may throw “Verified Failed” error, due to the following
☞Hex File may be old, so compile the project once and try Programming.
☞Faulty microcontroller device, Replace it with new one.
Note *: If the error still retains check your windows firewall or antivirus software to allow this MPLAB and DsPICkit2 programmer.
Example Programs and Connections
|Other Examples are also provided in the CD. So use this examples by changingthe pins or modify the codes according to the target etc.|
Setting up HyperTerminal
HyperTerminal is automatically installed under Programs>>Accessories,
1. Click Start >> Programs >> Accessories >> Communications >> HyperTerminal
☞Enter Name (e.g. Com1_9600) and choose any one ICON.
2. Click the drop-down arrow by Connect Using >> COM1 >> Click OK
3. COM1 Properties, Port Settings
☞Bits per Second: select 9600 (or desired baud rate)
☞Data Bits: select 8
☞Parity: select None
☞Stop Bits: select 1
☞Flow Control: select none
4. Now you get the HyperTerminal window.
5. The Serial Cable used with the board (both USART1 and USART2) is a NULL modem cable.