mikroElektronika EasydsPIC6 User Manual

EasydsPIC6
All MikroElektronika´s development systems represent irreplaceable tools for programming and developing microcontroller-based devices. Carefully chosen components and the use of machines of the last generation for mounting and testing thereof are the best guarantee of high reliability of our devices. Due to simple design, a large number of add-on modules and ready to use examples, all our users, regardless of their experience, have the possibility to develop their project in a fast and effi cient way.
User manual
Development System
TO OUR VALUED CUSTOMERS I want to express my thanks to you for being interested in our products and for having confi dence in
mikroElektronika. The primary aim of our company is to design and produce high quality electronic products and to constantly improve the performance thereof in order to better suit your needs.
Nebojsa Matic
General Manager
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KeeLoq, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A and other countries.
Development System EasydsPIC6
TABLE OF CONTENTS
3
page
Introduction to EasydsPIC6 Development System Key Features
1.0. Connecting the System to a PC ......................
2.0. Supported Microcontrollers
3.0. On-board dsPICprog Programmer
4.0. mikroICD (In-Circuit Debugger) ................................................................................................. 10
5.0. ICD Connector
6.0. Power Supply ........................
7.0. RS-232 Communication Module
8.0. CAN Communication Module .................................................................................................... 14
9.0. Voltage Reference Source ........................................................................................................ 15
10.0. A/D Converter Test Inputs
11.0. Serial EEPROM Module
12.0. DS1820 Temperature Sensor
13.0. Piezo Buzzer
14.0. LEDs ........
15.0. 4x4 Keypad
16.0. MENU Keypad
17.0. Push Buttons ........................................................................................................................... 23
18.0. On-board 2x16 LCD
19.0. 2x16 LCD ...........
20.0. 128x64 Graphic LCD .............
21.0. Touch Panel
22.0. I/O Ports ....................
23.0. Port Expander (Additional I/O Ports) ....................................................................................... 30
....................................................................................................................................
....................................................................................................... 7
............................................................................................
..........................................................................................................................
....................................................................................................
................................................................................................
.......................................................................................................
.........................................................................................................
..................................................................................................
..........................................................................................................................
...............................................................................................................................
.............................................................................................................................
.........................................................................................................................
................................................................................................................
.....................................................................................................................
..................................................................................................
............................................................................................................................
..............................................................................................................
.......................................................................... 4
5
..........................................................................
8
11
12 13
16 17 18 19 20 21 22
24 25 26 27
28
6
MikroElektronika
4
Introduction to EasydsPIC6 Development System
page
The EasydsPIC6™ development system provides a development environment for experimenting with dsPIC® microcontrollers from Microchip®. The system includes an on-board programmer with mikroICD providing an interface between the microcontroller and a PC.
You are simply expected to write a program in one of the dsPIC compilers, generate a .hex le and program your microcontroller using
the on-board dsPICprog™ programmer. Numerous modules, such as 128x64 graphic LCD, alphanumeric 2x16 LCD, port expander etc, are provided on the board and allow you to easily simulate the operation of the target device.
Development System EasydsPIC6
Full-featured development system for dsPIC microcontroller based devices
On-board USB 2.0 programmer
In-Circuit Debugger for real time debugging at hardware level
Port expander provides an easy I/O expansion by 2 additional ports
MikroElektronika
Graphic LCD with backlight
The dsPICFLASH™ program for programming provides a complete list of all supported microcontrollers. The latest version of this program with updated list of supported microcontrollers can be downloaded from our website at
www.mikroe.com
Package contains:
Development system: EasydsPIC6 CD: product CD with relevant software Cables: USBcable Documentation: Manuals for EasydsPIC6, dsPICprog and mikroICD, quick guide for installing USB drivers, electrical schematic of the system
System specication:
Power Supply: over an AC/DC connector (7-23V AC or 9-32V DC); or over a USB cable for programming (5V DC) Power consumption:~40mA in idle state when all on-board modules are off Dimension: 26,5 x 22cm (10,4 x 8,6inch) Weight: ~416g (0.91lbs)
Development System EasydsPIC6
5
31
30
29
28
27
26
1
2
3
64
7
8 9
105
page
11
12
13
14
15
16
25
24
23
Key Features
1. Power supply voltage regulator
2. On-board programmer’s USB connector
3. USB 2.0 programmer with mikroICD
4. DS1820 temperature sensor
5. Microchip’s debugger connector (ICD2 or ICD3)
6. CAN communication module
7. A/D converter test inputs
8. 4.096V voltage reference source
9. Piezo buzzer
10. Jumper for pull-up/pull-down resistor selection
11. Serial EEPROM module
12. On-board 2x16 LCD
13. I/O port connectors
14. DIP switches enable pull-up/pull-down resistors
15. Microcontroller sockets
192021
16. Port expander
17. Potentiometer for adjusting contrast of graphic display
18. Graphic LCD connector
19. Touch panel connector
20. MENU keypad
21. 4x4 keypad
22. Push buttons simulate microcontroller digital inputs
23. Jumper for selecting pins’ logic state via push buttons
24. Jumper for protective resistor shortening
25. Reset button
26. 42 LEDs indicate pins’ logic state
27. Potentiometer for adjusting contrast of alphanumeric LCD
28. Alphanumeric LCD connector
29. DIP switches turn on/off on-board modules
30. RS-232 communication module
31. Power supply switch
171822
MikroElektronika
6
1.0. Connecting the System to a PC
page
Development System EasydsPIC6
Step 1:
Follow the instructions provided in the relevant manuals and install the dsPICash program and the USB driver from the product CD. USB drivers are essential for the proper operation of the on-board programmer. In case you already have one of the Mikroelektronika’s dsPIC compilers installed on your PC, there is no need to reinstall USB drivers as they are already installed along with the compiler.
Step 2:
Use the USB cable to connect the EasydsPIC6 development system to a PC. One end of the USB cable, with a USB connector of B type, should be connected to the development system, as shown in Figure 1-2, whereas the other end of the cable with a USB connector of A type should be connected to a PC. When establishing a connection, make sure that jumper J7 is placed in the USB position as shown in Figure 1-1.
AC/DC connector
J7 power supply selector
Figure 1-1: Power supply
USB connector
1
Figure 1-2: Connecting USB cable
POWER SUPPLY switch
2
Step 3:
Turn on your development system by setting the POWER SUPPLY switch to ON position. Two LEDs marked as POWER and USB LINK will be automatically turned on indicating that your development system is ready to use. Use the on-board programmer and the dsPICprog programmer and the dsPICash program to dump a hex code into the microcontroller and employ the system to test and develop your projects.
NOTE: If some additional modules are used, such as LCD, GLCD etc, it is necessary to place them properly on the development
system while it is turned off. Otherwise, either can be permanently damaged. Refer to gure below for the proper placing of
the additional modules.
Figure 1-3: Placing additional modules on the board
MikroElektronika
Development System EasydsPIC6
2
7
2.0. Supported Microcontrollers
The EasydsPIC6 development system provides six separate sockets for dsPIC microcontrollers in DIP40, DIP28 and DIP18 packages. These sockets allow supported microcontrollers in dsDIP packages to be plugged directly into the development board. There are two sockets for dsPIC microcontrollers in DIP40 package, three sockets for dsPIC microcontrollers in DIP28 package and one socket for dsPIC microcontrollers in DIP18 package provided on the board. Which of these sockets will be used depends solely on the pinout of the microcontroller in use. The EasydsPIC6 development system comes with the microcontroller in DIP40 package.
Figure 2-1: Microcontroller sockets
dsPIC microcontrollers normally use a quartz crystal for stabilizing clock frequency. The EasydsPIC6 provides two sockets for quartz crystal. Microcontrollers in DIP40A, DIP40B and DIP28A packages use socket X1 (OSC1A, OSC1B) for quartz crystal. If microcontrollers in DIP18, DOP28B and DIP28C packages are used, it is necessary to move quartz crystal from socket X1 to socket X2 (OSC2A, OSC2B). Besides, it is possible to replace the existing quartz crystal with another one. The value of the quartz crystal depends on the maximum clock frequency allowed.
page
1
Figure 2-2: Plugging microcontroller into appropriate socket
Prior to plugging the microcontroller into the appropriate socket, make sure that the power supply is turned off. Figure 2-2 shows how to correctly plug a microcontroller. Figure 1 shows an unoccupied DIP40 socket. Place one end of the microcontroller into the socket as shown in Figure 2. Then put the microcontroller slowly down until all the pins thereof match the socket as shown in Figure 3. Check again that everything is placed correctly and press the microcontroller easily down until it is completely plugged into the socket as shown in Figure 4.
NOTE: Only one microcontroller may be plugged into the development board at one time.
3
4
MikroElektronika
8
3.0. On-board dsPICprog Programmer
page
A programmer is a necessary tool when working with microcontrollers. It is used to load a hex code into the microcontroller and provides an interface between the microcontroller and a PC. The EasydsPIC6 has an on-board dsPICprog programmer. All you need is a .hex le to be loaded into the microcontroller using the dsPICFLASH program. Figure 3-3 shows connection between the compiler, the dsPICFLASH program and the microcontroller.
Programmer’s USB connector
Figure 3-1: USB connector’s front side
Figure 3-2: On-board programmer
Development System EasydsPIC6
1
Write a code in one of the dsPIC compilers, generate
a .hex le, and employ the on-board programmer
to load the code into the microcontroller.
Figure 3-3: Programming process
Compiling program
hex code loading
2
3
1
Write a program in one of dsPIC
compilers and generate a .hex le;
2
Use the dsPICFLASH program to select desired microcontroller to be programmed;
3
Click the Write button to dump the code into the microcontroller.
On the left side of the dsPICFLASH program’s main window, there is a number of options for setting the operation of the microcontroller to be used. A number of options which enable the programming process are provided on the right side of the window. Positioned in the bottom right corner of the window, the Progress bar enables you to monitor the programming progress.
MikroElektronika
Development System EasydsPIC6
9
Microcontroller pins for programming (PGD, PGC and MCLR) are not directly connected to the on-board programmer, but via a multiplexer. The multiplexer is used to disconnect the microcontroller pins used for programming from the rest of the board while the programming process is under way. As soon as the programming process starts, the multiplexer automatically disconnects pins for programming from the development system. In this case, these pins cannot be used as I/O pins. When the programming process is complete, the multiplexer reconnects these pins to the development system, after which they can be used as I/O pins.
During the programming, the multiplexer disconnects the microcontroller pins used for programming from the rest of the board and connects them to
the dsPICprog programmer. When the process of programming is complete, these pins are automatically disconnected from the programmer and may be used as input/output pins.
page
Figure 3-4: Programmer schematic
MikroElektronika
10
4.0. mikroICD (In-Circuit Debugger)
page
The mikroICD (In-Circuit Debugger) is an integral part of the on-board programmer. It is used for testing and debugging programs in real time. The process of testing and debugging is performed by monitoring the state of all registers within the microcontroller while operating in real environment. The mikroICD software is integrated in all dsPIC compilers designed by Mikroelektronika (mikroBASIC PRO, mikroC PRO, mikroPASCAL PRO etc). As soon as the mikroICD debugger starts up, a window called Watch Values, appears on the screen, Figure 4-1. The mikroICD debugger communicates to the microcontroller through the microcontroller’s pins used for programming.
Icon commands
A complete list of registers within the microcontroller being programmed
A list of selected registers to be monitored. The state of these registers changes during the program execution, which can be viewed in this window
Double click on the Value eld enables you to change data format
Figure 4-1: Watch Values window
Development System EasydsPIC6
mikroICD debugger options:
Start Debugger [F9] Run/Pause Debugger [F6] Stop Debugger [Ctrl+F2] Step Into [F7] Step Over [F8] Step Out [Ctrl+F8] Toggle Breakpoint [F5] Show/Hide Breakpoints [Shift+F4] Clear Breakpoints [Ctrl+Shift+F5]
Each of these commands is activated via keyboard shortcuts or by clicking appropriate
icon within the Watch Values window.
The mikroICD debugger also offers functions such as running a program step by step (single stepping), pausing the program execution to examine the state of currently active registers using breakpoints, tracking the values of some variables etc. The following example illustrates a step-by-step program execution using the Step Over command.
Step 1:
In this example the 41st program line is highlighted in blue, which means that it will be executed next. The current state of all registers within the microcontroller can be viewed in the mikroICD Watch Values window.
Step 2:
After the Step Over command is executed, the microcontroller will execute the 41st program line. The next line to be executed is highlighted in blue. The state of registers being changed by executing this instruction may be viewed in the Watch Values window.
NOTE: For more information on the mikroICD debugger refer to the mikroICD Debugger manual.
1
During operation, the program line to be executed next is highlighted in blue, while the breakpoints are highlighted in red. The Run command executes the program in real time until it encounters a breakpoint.
2
MikroElektronika
Loading...
+ 23 hidden pages