Unformatted text preview: 300 Ω
12/31 RD7 30 R36
D0 VSS Instructions
Locate the PIC® MCU Communicator GUI in the PIC MCU Communicator folder in
Project 8 on the CD-ROM. Choose the Comm Port and baud rate. Then click “Open
Comm.” Enter “TRISD” in the top Label text field. Enter “088” into the top Addr text field.
Check the top Hex box. Enter “7F” into the Data field. In the box labeled “Bit Control”
enter “PORTD” in the label text field. Enter “008” in the Addr field. Finally, toggle bit 7
using the “T” button under that bit. The LED on your board should toggle on and off.
See Figure 2-18.
FIGURE 2-18: DS51557B-page 40 PIC® MCU COMMUNICATOR INTERFACE © 2005 Microchip Technology Inc. Example Projects
The firmware for this project implements RS-232 communication between the PC and
PIC16F917. The USART is used to perform this communication. If a crystal oscillator
were used as the clock source for the PIC16F917, auto-baud would not be necessary.
However, because the PIC16F917 is using the internal RC oscillator, it is necessary to
perform auto-baud. Auto-baud refers to sending out a known character from the PC,
the MCU measures the time it takes to receive the character, interprets this time into bit
width, and then sets up the baud rate registers accordingly for the USART. This method
allows the RS-232 communication to be free from errors on different microcontrollers
and over temperature variations.
The PIC MCU Communicator GUI is included in this project as an example GUI.
However, it is also a great tool for debugging. Experiment with using the GUI to setup
other peripherals on the microcontroller. © 2005 Microchip Technology Inc. DS51557B-page 41 PICDEMTM Mechatronics Demo Board User’s Guide
2.3.9 Project 9: Brushed DC Motor Control Using the ECCP This project is very similar to Project 5, only in this project, we are using the Enhanced
Capture Compare PWM (ECCP) module in the PIC16F690 (see note). In PWM mode,
the ECCP module has four outputs for directly driving an H-bridge circuit. This makes
implementing bidirectional speed control of a brushed DC motor a simple task.
Note: To change microcontrollers, disconnect power from the board. Remove the
PIC16F917 microcontroller from U1 and install the PIC16F690 in U2.
Reconnect power to the board. Objectives
1. Configure the ECCP module for Full-Bridge mode.
2. Change motor directions. Applicable Technical Documents
Low-Cost Bidirectional Brushed DC Motor Control Using the PIC16F684 Application
Note, AN893 (DS00893) Jumper Configuration
• DS51557B-page 42 P1A (J6) to P1 (J1)
P1B (J6) to N1 (J1)
P1C (J6) to P2 (J1)
P1D (J5) to N2 (J1)
AN2 (J5) to POT1 (J4)
RA5 (J6) to SW2 (J4)
Make sure there are no shunts (two pin jumpers) on J2.
Attach the brushed DC motor leads to DRIVE1 (P9) and DRIVE2 (P10).
Connect the right and center pins of JP8 using a shunt. © 2005 Microchip Technology Inc. Example Projects
PROJECT 9: JUMPER DIAGRAM
Brushed DC Lead FIGURE 2-19: © 2005 Microchip Technology Inc. DS51557B-page 43 DS51557B-page 44
10 kΩ SW2 1 kΩ R10 VDD 17 AN2 2 RA5 7 VSS 20 P1D 14 P1C P1B 6 10 kΩ 10 kΩ 10 kΩ * * = These are simplified circuits that show the equivalent functionality. C26
1000 pF 1 kΩ R5 1 10 kΩ * Motor +5V * * FIGURE 2-20: R4
10 kΩ VDD +5V P1A 5 PIC16F690 +5V PICDEMTM Mechatronics Demo Board User’s Guide
PROJECT 9: SCHEMATIC © 2005 Microchip Technology Inc. Example Projects
Use POT1 to adjust the speed of the motor. SW2 toggles between the following four
modes of operation:
• Motor Off
The ECCP module is ideal for driving a full-bridge circuit. Dead-band Delay Control and
Automatic Shutdown are some of the other features of the ECCP module when
configured in PWM mode. Dead-band Delay Control allows you to control when the
MOSFETs in the full-bridge circuit are turned on and off, in relation to one another. This
is done in order to automatically account for the MOSFET turn-on and turn-off times.
Automatic Shutdown allows you to define the shutdown state of the ECCP when a
shutdown event occurs. © 2005 Microchip Technology Inc. DS51557B-page 45 PICDEMTM Mechatronics Demo Board User’s Guide
NOTES: DS51557B-page 46 © 2005 Microchip Technology Inc. PICDEMTM MECHATRONICS
DEMO BOARD USER’S GUIDE
Chapter 3. Troubleshooting
This chapter describes common problems associated with using the PICDEM™
Mechatronics and steps on how to resolve them. 3.2 COMMON PROBLEMS
3.2.1 VDD Is Below 5V The board must be powered by one of the following:
• A 9-12 VDC source at the screw terminals (P20 and P21)
A 9-12 VDC source at J9
A 9 VDC battery
A 5 VDC power source at TP2 and TP3 Supplying less than 9 VDC at J9 or the screw terminals will not allow the regulator (U3)
to function properly causing VDD to be below 5 VDC. 3.2.2 No Voltage On Drive Stage There must be a two-pin shunt present on JP8 connecting the middle pin to +5 VD...
View Full Document
- Winter '10
- ........., MicrOChip Technology Inc