MCpros PIC-P40-28 User manual

The MicroControllerShop
http://microcontrollershop.com
PIC-P40-28
Prototyping Board
User Manual
Rev. 1.0
February 2008

The MicroControllerShop
http://microcontrollershop.com
PIC-P40-28 User Manual February 2008
MicroController Pros Corporation
Table of Contents
1.0 Preface ................................................................................................................................................... 3
1.1. Cautions............................................................................................................................................. 3
1.2. Trademarks........................................................................................................................................ 3
1.3. Limited Guarantee and Support ........................................................................................................ 3
1.4. Copyright ........................................................................................................................................... 3
2.0 Introduction............................................................................................................................................. 4
3.0 Hardware ................................................................................................................................................ 5
3.1. PIC-P40-28 Board Components........................................................................................................ 5
3.2. Power Supply Requirements ............................................................................................................. 6
3.3. 14- and 18-pin MCU sockets ............................................................................................................. 6
3.4. MCU Oscillator Circuit ....................................................................................................................... 7
3.5. In-Circuit Serial Programming (ICSP) and In-Circuit Debug (ICD) Interface..................................... 7
3.6. RS232 Interface................................................................................................................................. 9
3.7. Reset Circuit .................................................................................................................................... 11
3.8. LED.................................................................................................................................................. 11
3.9. Push Button ..................................................................................................................................... 11
3.10. Board Dimensions & PCB Material................................................................................................ 11
Appendix A. Board Schematic.................................................................................................................... 12

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 3/ 12 February 2008
1.0 Preface
1.1. Cautions
Caution: Check power supply requirements. Incorrect voltage will damage the board. See chapter 3.2
for details.
Caution: Only populate one socket at a time. Do not insert microcontrollers into more than one socket
at a time, or you may damage the microcontroller chips.
Caution: Check the pin orientation of the sockets before inserting a chip. The 28- pin socket is
rotated by 180 degrees in relation to the 40-pin socket (see ). This means that the pin 1
location for the 28-pin socket is in the lower right hand corner, whereas the pin 1 position for the 40-pin
socket is in the upper left hand corner of the socket. Make sure you align pin 1 of your microcontroller
with pin 1 of the socket. Inserting a microcontroller chip incorrectly can damage it.
Figure 3-1
1.2. Trademarks
All brand or product names used in this manual are trademarks or registered trademarks of their
respective companies or organizations.
1.3. Limited Guarantee and Support
MicroController Pros Corp. warrants the PIC-P40-28 board to be free from component or assembly
defects for a period of 180 days from the date of purchase. Settlement is limited to repair or replacement
of the product only. MicroController Pros Corp. does not assume any liability arising out of the application
or use of any product, circuit or procedure described herein. No other liability or warranty applies,
expressed or implied. While every attempt has been made to ensure accurate documentation,
MicroController Pros Corp. cannot be held responsible for errors or omissions, and reserves the right to
make changes without prior notice.
This prototype board is intended as a low-cost development tool with limited support. It is assumed that
you are familiar with basic electrical engineering concepts and microcontroller code development. Our
support does not include us teaching you those concepts. If you experience functional issues with this
board, you can contact support via email: support@microcontrollershop.com
General information on Microchip PIC microcontrollers can be found at the following URL:
http://www.microchip.com
1.4. Copyright
© 2008 MicroController Pros Corporation. All rights reserved.
Website: http://microcontrollershop.com

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 4/ 12 February 2008
2.0 Introduction
The PIC-P40-28 is a prototype board for Microchip PIC microcontrollers in a 28- or 40-pin DIP package.
Check the pinout of the PIC microcontroller, which you intent to use with this board, in the Microchip PIC
device datasheet. Verify that the PIC’s Vdd, Vss, OSC1, OSC2, ICSP programming, and UART Rx and
Tx signals match the location of those pins on the appropriate MCU socket of this board (see schematic).
The board comes completely assembled and tested and offers the following features:
•28-pin, and 40-pin DIL microcontroller sockets
•Jumper selectable +3.3V or +5.0V board supply voltage
•Power plug-in jack: 5.5mm outer, 2.5mm inner diameter
oAccepts AC and DC input voltage
•RS232 DB9 female connector with MAX2232 interface circuit and Tx, Rx, CTS and DTR/RTS
signals. Rx and Tx signals are routed to 28-pin and 40-pin MCU sockets (see schematics).
•RJ12 and 6-pin, single row In-Circuit Serial Programming (ICSP) connectors for in-circuit
programming and debugging with a PIC In-Circuit Debugger & Programmer.
•20 MHz quartz crystal oscillator in machined, spring-loaded socket for easy oscillator replacement
•Reset button
•Push button connected to PIC I/O pin via removable jumper
•Status LED connected to PIC I/O pin via removable jumper
•Extension solder pads for every µC pin
•Prototyping area with 100 mils grid
•Prototyping GND bus
•Prototyping Vcc bus
•FR-4, 1.5 mm (0.062″), single layer, electroless nickel/immersion gold (ENIG) plating, green
soldermask, white silkscreen component print
•Four mounting holes

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 5/ 12 February 2008
3.0 Hardware
3.1. PIC-P40-28 Board Components
Figure 3-1
Figure 3-1: PIC-P40-28 Board
shows the PIC-P40-28 Board with major components identified.
RS232 Interface
(D-Sub 9 female)
6-pin,single row
ICSP/ICD Connector
Power Connector
LED
Reset Button
Push Button
S1
Socketed 20MHz Crystal
BoardSupplyVolta
ge
Selection Jumper
Open:5.0V
Closed:3.3V
L
ED Connect/
D
isconnect Jumper Push Button
Connect/Disconne
ct
Jumper
M
AX2232 RS232
T
ransceiver
S1
Pin1 of
40-pin socket
RJ12 Jack
ICSP/ICD Connector
Pin 1 of
28-pin socket

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 6/ 12 February 2008
3.2. Power Supply Requirements
Power input to the board is supplied via a barrel connector with 5.5mm outer and 2.5mm inner diameter.
An on-board bridge rectifier provides polarity reversal protection and allows you to use both AC or DC
input voltages.
An on-board LM317 adjustable output voltage regulator can be set via a jumper to provide the board with
either 5.0V or 3.3V DC operating voltage. In the open position of jumper 3.3V, the output voltage is 5.0V.
In the jumper-closed position, the output voltage is 3.3V
Jumper 3.3V Board Operating Voltage (BOV)
Open 5.0V DC
Closed 3.3V DC
The input voltage supplied to the board should be at least 3.5V above the desired board operating voltage
(BOV) if you use a DC power supply, and 2.5V above BOV if you use an AC power supply.
5.0V Board Operating Voltage 3.3V Board Operation Voltage
Minimum AC input voltage 7.5V AC 5.8V AC
Minimum DC input voltage 8.5V DC 6.8V DC
The following maximum input voltages should not be exceeded by your power supply, otherwise you risk
damaging the board:
Maximum AC input voltage 10.5V AC
Maximum DC input voltage 15V DC
The current rating of your power supply is uncritical, as this board requires less than 100mA to operate.
Therefore, any power supply with a current rating of 100mA or higher can be used. A higher current rating
is not a problem, as the board will only draw as much current from the supply as is needed for operation.
In general, you should use voltages close to the minimum required input voltage. It reduces stress on the
voltage regulator, as a smaller voltage differential has to be dissipated into heat.
A word of caution, however: Many cheap transformer-based wall-plug power supplies provide an
unregulated output voltage that under no load is usually much higher than the rated output voltage printed
on the supply. This high output voltage then “collapses” under load and can be lower than the rated
output voltage. To avoid damage to your board, verify with a multi-meter that the true voltage of your
power supply is within the above stated limits before connecting it to this board.
3.3. 28- and 40-pin MCU sockets
Caution: Only populate one socket at a time. Do not insert microcontrollers into more than one socket
at a time, or you may damage the microcontroller chips.
Caution: Check the pin orientation of the sockets before inserting a chip. The 28- pin socket is
rotated by 180 degrees in relation to the 40-pin socket (see ). This means that the pin 1
location for the 28-pin socket is in the lower right hand corner, whereas the pin 1 position for the 40-pin
socket is in the upper left hand corner of the socket. Make sure you align pin 1 of your microcontroller
with pin 1 of the socket. Inserting a microcontroller chip incorrectly can damage it.
Figure 3-1

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 7/ 12 February 2008
Check the pinout of the PIC microcontroller, which you intent to use with this board, in the Microchip PIC
device datasheet. Verify that the PIC’s Vdd, Vss, OSC1, OSC2, ICSP programming, and UART Rx and
TX signals match the location of those pins on the appropriate MCU socket of this board (see schematic).
The board has routed connections from both sockets to the RS232 Rx and Tx pins, ICSP signals, a push
button, a reset button, an LED and a crystal oscillator.
Each unused MCU pin has a direct connection to the solder pad next to it. You can solder square header
pins into those locations and then use prototyping jumper wires to connect to other circuitry. Alternatively,
you can directly solder wire connections or component pins to these pads. Using header pins and jumper
wires gives you the flexibility to connect the MCU pins to different components on the board quickly.
For header pins, see: http://microcontrollershop.com/product_info.php?products_id=2115
For prototyping jumper wires, see: http://microcontrollershop.com/product_info.php?products_id=791
3.4. MCU Oscillator Circuit
A 20MHz crystal oscillator is connected to the 28-pin and 40-pin socket oscillator pins. The crystal is
socketed, so you can easily replace it with a different frequency value.
Figure 3-2: Socketed Crystal
3.5. In-Circuit Serial Programming (ICSP) and In-Circuit Debug (ICD) Interface
PIC microcontrollers use the same connection for in-circuit serial programming (ICSP) and in-circuit
debugging (ICD). Figure 3-1 shows the location of the ICSP/ICD connectors. The board features two
ICSP/ICD connectors - an RJ12 jack and a 6-pin single row, latched header - to provide compatibility with
a broad selection of PIC programmers and in-circuit debuggers. The ICSP signals are routed to the
appropriate pins of both PIC MCU sockets.

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 8/ 12 February 2008
Some 40-pin PIC microcontrollers have the optional PGM programming signal on pin 38 (RB5), others on
pin 25 (RB3). If you use a programmer that requires the PGM signal, make sure you connect it to the
correct MCU pin, by setting jumper PGM_sel according to the table below.
PGM_sel
position 40-pin PIC Socket Pin
# (Name)
1-2 PGM_RB5 38 (RB5)
2-3 PGM_RB3 36 (RB3)
The board’s RJ12 ICSP/ICD jack is connected as shown in the figure and table below.
Figure 3-3: RJ12 PIC ICSP Connector
1
1234 5 6
Signal Name Board ICSP/ICD
Connector Pin 28-pin PIC Socket
Pin 40-pin PIC Socket Pin
/MCLR 1 1 1
Vdd (Vcc) 2 20 11 & 32
Vss (GND) 3 8 & 19 12 & 31
PGD 4 28 40
PGC 5 27 39
PGM (optional) 6 24 36 or 38 (depending on PGM_sel
Jumper position)

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 9/ 12 February 2008
The board’s 6-pin, single row ICSP/ICD header is connected as shown in the figure and table below.
PG
C
PG
D
GN
D
Vd
d
Signal Name Board ICSP/ICD
Connector Pin 28-pin PIC Socket
Pin 40-pin PIC Socket Pin
/MCLR 1 1 1
Vdd (Vcc) 2 20 11 & 32
Vss (GND) 3 8 & 19 12 & 31
PGD 4 28 40
PGC 5 27 39
PGM (optional) 6 24 36 or 38 (depending on PGM_sel
Jumper position)
For compatible PIC ICSP programmers, see:
http://microcontrollershop.com/default.php?cPath=112_97
For compatible PIC ICD in-circuit debuggers & programmers, see:
http://microcontrollershop.com/default.php?cPath=112_152
3.6. RS232 Interface
RS232 devices are classified as Data Terminal Equipment (DTE) or Data Communications Equipment
(DCE). This defines for each device which wires will be sending and receiving each signal.
PCs or terminals have male connectors with DTE pin functions; the PIC-P40-28 board has a female
connector with DCE pin functions.
As a minimum requirement for communicating with a PC or Terminal, only the RxD and TxD signals are
required. All other signals are optional. If hardware flow control is desired, connect the CTS and RTS/DTR
signals to free PIC I/O pins (you must then implement the hardware handshake in your PIC firmware).
The RS232 standard defines RTS/CTS as the signaling protocol for hardware flow control for data
transmitted from DTE to DCE.
Figure 3-4: 6-pin, Single Row, PIC ICSP
Connecto
r
with Latch and 0.1” Spacin
g
/MC
LR
PGM
1
2
3
4
5
6

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 10/ 12 February 2008
Figure 3-5: D-Sub 9 RS232 Connector
RS232 Pin #
- DTE Name Connected to
(28/40 pin package) Function
1 - CD Not connected Carrier Detect. Asserted by DCE when a connection has
been established with remote equipment (dial-up modem).
2 - RXD PIC TxD pin (6/8) TX solder pad: PIC transmit, PC receive (Data sent from
DCE to DTE)
3 - TXD PIC RxD pin (5/7) RX solder pad: PIC receive, PC transmit (Data sent from
DTE to DCE)
4 - DTR Jumper J1 DTR position Data Terminal Ready handshake signal. If jumper J1 is in
DTR position, pin 4 of DB9 connector is connected to
RTS/DTS solder pad via RS232 Transceiver R2OUT.
Asserted by DTE to indicate that it is ready to be
connected. If the DCE is in power save mode, this may
“wake up” the DCE, bringing it out of a power-saving
mode. When this signal is de-asserted, the DCE may
return to its power-save mode.
5 - GND GND Ground
6 - DSR Not connected Data Set Ready. Asserted by DCE to indicate an active
connection .
7 - RTS Jumper J1 RTS position Request to Send handshake signal. If jumper J1 is in RTS
position, pin 7 of DB9 connector is connected to RTS/DTS
solder pad via RS232 Transceiver R2OUT. Asserted by
DTE to prepare DCE to receive data. This may require
action on the part of the DCE, e.g. asserting the CTS
signal.
8 - CTS CTS solder pad Clear to Send handshake signal. Asserted by DCE to
acknowledge RTS and allow DTE to transmit.
9 - RI Not connected Ring indicator. Asserted by DCE when it detects a ring
signal from the telephone line.

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 11/ 12 February 2008
3.7. Reset Circuit
An RC reset circuit (R2 and C13) is connected to the MCLR pin to assure that a proper power-on reset is
generated when a PIC microcontroller is used that has no integrated Brown-Out-Reset (BOR) or where
BOR is disabled. C13 is not mounted. If you use a PIC chip without BOR or with BOR disabled, then you
should mount C13. See the PIC datasheet for recommended values.
Using the RC reset does not assure a proper reset in brown-out conditions (sudden, short voltage drops).
Certain brown-out conditions may corrupt the PIC’s on-chip Flash or EEPROM content. Some PIC chips
feature on-chip brown-out reset (BOR) circuitry that can be enabled (check the datasheet of your
particular device). It is recommended that you enable the PIC’s on-chip brown-out to avoid memory
corruption.
The PIC chip can also be reset by pressing and releasing the RST switch on the board.
3.8. LED
An LED is connected via jumper LED_J to a PIC I/O pin (see schematic).You can disconnect the LED by
removing jumper LED_J. You can easily connect the LED to any unused PIC I/O pin of your choice by
running a wire from the LED connect side of the jumper header to the desired PIC pin.
The LED is turned on by programming the I/O pin as a high output.
The table below shows to which PIC pin, depending on the jumper LED_J setting, the LED is connected.
LED_J 28-pin PIC Socket Pin
# (Name) 40-pin PIC Socket Pin
# (Name)
closed 2 (RA0/AN0) 2 (RA0/AN0)
open N.C. N.C.
3.9. Push Button
A push button S1 is connected via jumper S1_J to a pin on the PIC MCU sockets.
The table below shows to which PIC pin, depending on the jumper S1_J setting, S1 is connected.
S1_PB4 28-pin PIC Socket Pin
# (Name) 40-pin PIC Socket Pin
# (Name)
closed 7 (RA5/AN7) 10 (RE2/AN7)
open N.C. N.C.
3.10. Board Dimensions & PCB Material
•112 mm by 110 mm
•FR-4, 1.5 mm (0.062″), single layer, electroless nickel/immersion gold (ENIG) plating, green
soldermask, white silkscreen component print
•RoHS compliant
•Four mounting holes

The MicroControllerShop
http://microcontrollershop.com
MicroController Pros Corporation
PIC-P40-28 User Manual 12/ 12 February 2008
Appendix A. Board Schematic
A
B
C
D
D
C
B
ATitle
Number RevisionSize
A4
Date: 17-Jan-2008 Sheet of
File: PIC-P40-28 Drawn By:
B-DIL
IN
3
1
OUT 2
ADJ
LM317
C7
470uF/16vdc
C2
1uF/16VDC
C8
100uF/16vdc
C6
100nF
R3
390/1%
R5
330/1%
R4
240/1%
G1 VR1
C1+ 1
VDD
2
C1- 3
C2+ 4
C2- 5
VEE
6
T2OUT
7
R2IN
8R2OUT 9
T2IN 10
T1IN 11
R1OUT 12
R1IN
13
T1OUT
14
GND 15
VCC
16
U2
C3
1uF/16VDC
C4
1uF/16VDC
C5
1uF/16VDC
1
2
3
4
5
6
7
8
9
RS232
GND
GNDGND GND GND
1
2
3.3V
1
2
3
J1
GND
GND
GND
C1
1uF/16VDC
GND
+5V
RX
TX
PIC-P40-28
Copyright 2008 MicroController Pros Corp.
1.9
CTS
RTS/DTR
1-2 = RTS
2-3 = DTR
RD2/PSP2 21
RD3/PSP3 22
SDI/RC4 23
SDO/RC5 24
TX/RC6 25
RX/RC7 26
PSP4/RD4 27
PSP5/RD5 28
PSP6/RD6 29
PSP7/RD7 30
INT/RB0 33
RB1 34
RB2 35
PGM/RB3 36
RB4 37
RB5 38
PGC/RB6 39
PGD/RB7 40
OSC1/CLKIN
13
OSC2/CLKOUT
14
RC0/T1OSD
15
RC1/T1OSI
16
RC2/CCP1
17
RC3/SCK
18
RD0/PSP0
19
RD1/PSP1
20
RE2/CS#/AN7
10 RE1/WR#/AN6
9RE0/RD#/AN5
8RA5/AN4
7RA4/TOCK1
6
RA3/AN3
5RA2/AN2
4RA1/AN1
3RA0/AN0
2
MCLR#/THV
1
VDD 32
11
12
VSS
31
PIC_40
U1
C9
22pF
C10
22pF
C13
NA
C12
100nF
C11
100nF
1 2
Q1
R1
330
R2
10K
R6
10K
1
2
3
4
5
6
ICSP
D1
RST
S1
1
2
3
PGM_sel
GNDGNDGND
GND
1
2
LED_J
12
LED
GND
GND
GND
1
2
S1
GND
1N4004
+5V
+5V
1
2
3
4
5
6
ICSP1
RJ12
MCLR
+5V
GND
PGD
PGC
PGM
4-20MHz
S1
SDI/SDA/RC4 15
SDO/RC5 16
TX/RC6 17
RX/RC7 18
INT/RB0 21
RB1 22
RB2 23
PGM/RB3 24
RB4 25
RB5 26
PGC/RB6 27
PGD/RB7 28
OSC1/CLKIN
9
OSC2/CLKOUT
10
RC0/T1OBO
11
RC1/T1OSI
12
RC2/CCP1
13
RC3/SCL/SCK
14
RA5/AN4
7RA4/TOCK1
6RA3/AN3
5RA2/AN2
4RA1/AN1
3RA0/AN0
2
MCLR#/THV
1
VDD 20
19
VSS
8
PIC_28
U3
GND
OSC1
OSC2
+5V
LED
MCLR
PGD
PGC
PGM
MCLR
LED
S1
OSC1
OSC2
GND
GND
PGD
PGC
PGM
RX
TX
1-2 = RB5
2-3 = RB3
RX
TX
Table of contents