User Manual PIC Lab-III
User Manual PIC Lab-III
PIC Lab-III
User Manual
www.electronicsk.com
Introduction to PIC Lab-III
C
ongratulations on purchase of Microtronics Pakistan, PIC-Lab-III. This development board has
been designed after years of experience in making training as well as development boards for
students and hobbyists. PIC Lab-III is a feature rich board with lots of commonly required
peripherals already fabricated. Not only that these devices are needed in developmental projects,
but one needs to learn interfacing them. This facilitates an in depth exploration of the PIC microcontroller.
The board has been designed using standard through hole components, so that direct poking at them is
feasible, and in case you want to replace a component, can do so easily. Most of the components specially
integrated circuits are mounted on bases, so that they can be taken out and replaced.
Microchip produces a number of microcontrollers, having varying sets of on-chip peripherals. One such
chip is PIC 18F4550. This microcontroller has built in USB 2.0 slave module and can be used easily to
make USB compliant devices. This Board has been designed mainly PIC18F4550 in mind. You can use any
other pin compatible 40 pin PIC microcontroller if you want. However be notified that some peripheral
device pin connections of 18F4550 differ from other PIC microcontrollers. In that case you will have to re-
configure the board, that is very simple.
A first look shows feature packed development board with peripherals. The board itself is standard FR4
double sided with plated through holes. The board can be powered with 9-12V center positive, DC adapter.
There is a protection diode to protect against accidental reversed polarity.
Note the I-O Headers for expansion also have VDD and GND pins. These pins are there to supply 5V
power for your extension boards. Never put external power on these lines, as this will bypass the protection
circuitry and entire supply will reach the board damaging components, including microcontroller in case of
reversed or high voltage.
Board Features
This board features following peripheral devices:
• Supports 40 Pin PIC Microcontrollers (18F4550 is preferred)
• On Board 5V and 3.3V DC Power regulators
• USB Type B Connector and supporting circuitry
• In Circuit Serial programming as described by Microchip
• 10 Status LEDs
• Two Channel ADC input circuitry with POTs as voltage dividers and zener diode protection
• SD Card socket
• Buzzer
• 4 User programmable push switches
• 4 seven segment multiplexed LED displays
• HD44780 compliant Character LCD interface
• KS0108 compliant Graphic LCD interface
• USART with MAX 232 level shift IC
• RS485 Communication network
• I2C EEPROM
• I2C DS1307 Real Time Clock with battery backup
• DS1820 One wire protocol digital temperature sensor
• 38 KHz IR remote control sensor
• 4 channel power switching control, upto 500mA per channel (Can be used o drive stepper motor)
• All I-O lines available grouped as PORTs along with 5V power supply
• Two sources of 3.3V power supply for extension boards that need 3.3V (Upto 1A) power
Configuration Headers
A first look at the features available on board seems impossible, as microcontroller does not have so many I
-O lines. This was made possible by the use of configuration headers for each group of devices. The devices
are not hard wired to the microcontroller I-Os as in most of
the development boards, rather a jumper connection is
given, with most suggested I-O next to the jumper line. If
you are comfortable with the configuration that we have
designed, just put a jumper and your device is connected.
If you want to reconfigure the device to some other I-O
take the jumper off, and using a jumper wire connect the
device to I-O of your choice.
This has made the board 100% configurable. You are no longer bound to use it the way we have designed,
rather can connect the devices required, and use other I-Os from expansion headers for your expansion
circuit. Each configuration header is clearly labeled with device connections, and the PIC microcontroller I-
Os.
Power Supply
The board can be powered from external 9-12V DC adapter, or you can power it up from USB supply.
While powering from USB keep in mind that some devices like LCDs can take large amount of current that
USB may not be able to supply. In that case it will be advisable to use external power supply.
The board has on-board 5V (7805) power regulator to regulate the supply voltage down to 5V. This 5V rail
supplies all the necessary circuitry as well as available with PORT headers for your expansion boards. Note
7805 can give up to 1A current so be careful about drawing current from these sources.
Also the board has LF33CV, which is 3.3V regulator. The SD card works on 3.3V so this regulator is there.
Moreover many third party daughter boards, like Ethernet or Bluetooth etc are made to work with 3.3V
therefore we have made 3.3 V supply also available with PORTA and PORTE headers as VDD3.
USB configuration header has a jumper labeled 5V on one side and VDD on other side.
5V pin is connected to 5V supply from your USB cable and VDD is connected to VDD
rail of this board. Placing a jumper over this configuration switch will power the board
from USB source.
Please make sure, when powering from USB you do not plug in external supply as
this may damage the host USB port of your computer. Although theoretically it
should not, but as a precaution it is recommended not to do so.
Status LEDs
Although in any given project 3 to 4 status LEDs are enough to indicate the program or device status, many
beginners however love to play with LEDs to sharpen their programming skills we have therefore given 10
LEDs in a row to lay with.
The LEDs are connected with their cathode directly to GND and Anodes are connected through a current
limiting resistor to the configuration headers. First eight LEDS can be connected to RD0..RD7 by putting
jumpers over the configuration header, the last two can be connected to RC6 and RC7.
The first 8 LEDs have 220 Ohms current limiting resistor, however ones connected to RC6 and RC7 have
1K resistor. Therefore these two LEDs will appear slightly dim. The reason for 1K resistors is that RC6 and
RC7 are also pins for USART serial communication. When LEDs are connected to these pins they will
show up the status of communication, but also seal the current. When 220 Ohms resistors are used in this
setting too much current is drained via LEDs and USART communication fails.
USB Device
Microchip PIC18F4550 has built-in USB 2.0 module. Using this module you can make a
large variety of USB enabled devices, like mass storage device, mouse, keyboard or
simple communication. PIC Lab-III allows you to use this feature. It has The USB
connector, and a configuration jumper to connect the USB connector to respective lines
of microcontroller. Including power from USB source. In order to make a USB device
the pin 18, normally RC3 is named VUSB and has to be connected through a 470nF
capacitor to GND. Since this pin is RC3 in other microcontrollers, we have allowed a
configuration jumper to connect the capacitor to pin, or use it as RC3 in other
microcontrollers.
Note is 18F4550 RC3 is not implemented, even if you do not want to use USB.
D+ and D– are the data wires of USB communication.
SD Card
SD cards are quite cheap and easily available, they can serve as media for storage of huge amount of data.
This board has been configured to use SD card in SPI mode for data communication. Many compilers like
MikroC have built-in libraries to write and read data from SD cards using microcontroller’s built-in SPI
module.
Since we have designed the board to work with 18F4550, preferably, the SPI connections on SD card
configuration switch are according to 18F4550. due to the USB taking RC3, RC4 and RC5 in 18F4550
they have moved the SPI module to RB0 and RB1 pins. Therefore when working with 18F4550, just put
jumpers and SD card is properly connected, but when using other controllers like 18f452, unplug the SPI
jumpers and connect the pins to desired connections using jumper cables.
Only data communication has been implemented, and interrupt on insertion of card has not been
implemented in this board.
The common cathodes of each display digit are connected through an NPN type Darlington transistor to
GND. The inputs of Darlington transistors are in second configuration header labeled as D1..D4. Jumpers
will connect them to RB0..RB3. a logic one on corresponding I-O line will select the digit to turn ON.
Power DC Load
Sometimes you need little more power to drive some circuit like a solenoid, motor, relay or even LEDs.
The microcontroller I-O lines can provide only 25mA current.
This board has 4 Darlington transistors, shared with seven seg-
ment display in an IC ULN2803. These can source upto
500mA current per channel. The headers to control these tran-
sistors are located with Seven segment display, however out-
puts can be taken from T-Block terminals located on Board.
The terminal on extreme right, close to edge is labeled as Load.
This will provide 9-12V DC supply directly from the adapter input. All other four channels will provide
GND when the corresponding Darlington is turned ON.
So if you want to drive a small stepper motor, you will need to use uni-polar one, that has 5 wires. The
common wire will be connected to load terminal, and all others to GND terminals. Sequential signals to
Darlington inputs will make the motor step.
RS232, UART
In addition to USB, standard RS232 UART is also given on board with MAX232 level converter for com-
munication with devices like PC.
RS485
While RS232 is a reasonably standard communication protocol, it can con-
nect only two devices at a time, and the distance can not be more than few
meters. RS485 on the other hand allows a distance up to a few kilometers and
connection of multi-drop nodes on the same network.
This board has RS485 network, that can be configured as node or terminal as
you wish, using the configuration jumper.
Push Switches
There are 4 user programmable push switches on board, named SW1..SW4. They can be connected to
RB4..RB7 using configuration headers.
Note the silk screen label has wrongly labeled the I-O lines on configuration switch. The One labeled
RB4 is actually connected to RB7 and one labeled RB7 is actually connected to RB4.