PIC LAB Manual
PIC LAB Manual
A B ANOOP B. K. (AUTHOR)
Excerpt
Contents
EXPERIMENT 1.
FAMILIARIZATION OF KIT
Aim:
Introduction
The VPUT-01 is a trainer kit for 8,16 and 32 bit microcontroller development system furnished with under
mentioned capabilities and can be used either as a stand alone system or as a system with serial interface to
personal computer to further enhance its performance and exploit it for maximum benefit.
CPUs Supported
89C51 Microcontroller
ARM-LPC2148 Microcontroller
Above all CPUs are provided as separate plug-in boards called piggy back boards. For working with any
controller, just plug-in the respective piggy back onto the board. The Trainer contains the CPU, I2C based
RTC, EEPROM, Stepper motor driver circuit, LCD display, 4x4 matrix keyboard, 8 digital input and 8 digital
output. All digital inputs, outputs and key board connections are terminated in individual 16 pin FRC
connector. We can communicate VPUT-01 trainer with PC via serial port. VPUT-01 Embedded Trainer is very
powerful and economical development system for advanced experimentation and research applications.
Depending of the need and applications, we can use VPUT-01 in any one of the microcontrollers. Normally,
the main board contains the CPU PIC 16F877.
FEATURES
On-Board Features:
On-Chip Features:
HARDWARE SPECIFICATION
Switches:
In VPUT-01 Universal Embedded trainer, two switches are provided. One switch is for programming and
execution( for PIC and 89C51 microcontrollers). If the switch is in Prog. mode, CPU goes to Boot mode. In
boot mode we can download the Hex files through windows serial downloader(PIC bootPlus,Win ISP). If the
switch is in Exec mode, CPU goes to Execution mode. User code going to be executed. Another one switch is
for selection of Internal and external peripherals. If the switch is in Internal mode, we can access the onboard
peripherals. If the switch is in the External mode, we can access the add-on cards without disturbing the
onboard peripherals.
Serial Port :
Data from the controller is transferred through the serial port to any media(e.g VPUT-01 trainer kit to PC or
Vice versa). Serial Port transmits data as +/-12v using the serial port driver ICL 232. ICL communication
software is used to verify the data transmission(e.g Win-Xtalk, Hyperterminal etc.,).
We are separately having isolated RS232 and USB portS for the purpose of transferring data. USB 2.0 port is
accomplished using the FTDI chip FT232RL USB-to-UART Bridge Controller. The VPUT-01 interfaces to
the FT232RL as a simple UART. The UART interface to FT232RL can run at speeds ranging from 300 to
115200 baud rate. The FT232RL is a highly integrated USB-to-UART Bridge Controller, providing a simple
solution for USB serial communications using a minimum of components and PCB space. The FT232RL
includes a USB 2.0 full-speed function controller, USB transceiver, oscillator, EEPROM, and synchronous
serial data bus (UART) with full modem control signals in a compact package. No other external USB
components are required.
ICSP Connector:
The connector uses two device I/O pins that are shared between In Circuit Debugging and In Circuit Serial
Programming. The kit is connected to PC using USB and can be connected to the device via ICSP connector
for In Circuit Serial Programming.
LED interfacing:
8 LED's are connected to PORTD lines through 74LS273 Latch. Latch is enabled via PORTB.4. Digital data
are sent to Port D lines. According to the digital data, LED glows.
8 DIP switches are connected to Port D lines through 74LS244 chip which is enabled by PORTB.6. Key status
is read by Port D lines and output is display through LEDs and serial port.
16 keys are formed in 4x4 matrix format. Port D lines are used for column scanning and row reading.
Buzzer and relay devices are connected in I/O Lines. Buzzer is connected in port B.0. Two relays are
connected in Port D.4 and Port D.5. Latch line used for relay is Port B.1.
1. Serial EEPROM:
24LS256 is I2C based Serial EEPROM. Device address = 0xA6
DS1307 is I2C based Real Time Clock. Device address = 0xD0 for I2C write and 0xD1 for I2C read
operations.
4. 8 Bit ADC:
PCF8591 is 8 bit ADC. ADC Input and output channel lines are terminated at 20 pin box type header and J801
connector. PCF 8591 device address is 0x98 for I2C write and 0x99 for I2C read operations.
5. 8 Bit DAC:
PCF8591 is 8 bit DAC. DAC output channel lines are terminated at 20 pin box type header and J801
connector. PCF 8591 device address is 0x98 for I2C Write,
Power Supply:
On VPUT-01 board, Multi output power supply is used. It provides +5v,+12v,-12 and GND.
LCD Module:
VPUT-01 supports 16x2 character based LCD. Data lines and control lines are from Port D.
Connectors:
MPLAB IDE
MPLAB IDE is a software program that runs on a PC to develop applications for Microchip microcontrollers.
It is called an Integrated Development Environment or IDE, because it provides a single integrated
"environment" to develop code for embedded microcontrollers.
MPLAB Features:
MPLAB IDE is a Windows® OS based Integrated Development Environment for the PICmicro MCU families.
The MPLAB IDE provides the ability to
The following are the steps for running MP Lab IDE to enter a new program in embedded C and to compile
and debug the program to generate the hex file.
PIC Boot plus is windows serial Downloader, which is used for downloading the hex file to the PIC 16 series
CPU. It supports Hex file format only.
Running PIC Boot Plus:
The following are the steps to run PIC Boot Plus to upload the hex file from PC into the PIC microcontroller.
This window is just like a hyper terminal, we can view serial port output in this window also.
Result:
EXPERIMENT 2.
BUZZER CONTROL
Aim:
Program Description:
Program:
#use delay(clock=20000000)
void main()
delay_ms(500);
delay_ms(500);
goto top;
Result:
RELAY CONTROL
Aim:
Program Description:
The relays are connected to pins RC1 and RC2. The latch line is RB1.
Program:
#include<16f877A.h>
#use delay(clock=20000000)
#use rs232(baud=19200,xmit=PIN_C6,rcv=PIN_C7)
void main()
{
while(1)
output_c(0x06); //make both relays 1&2 on. To make relay1 on, output 0x02 and to
output_low(PIN_b1);
delay_ms (1000);
output_low(PIN_b1);
delay_ms (1000);
Result:
EXPERIMENT 4.
To write an ALP to blink all the 7 LEDs 5 times and then to make on each LED one by one from left to right.
Repeat this sequence continuously.
Program Description:
The data lines for LEDs are RD0 to RD7 and the latch line is RB4. The delay between each blinking is 500
m.sec.
Program:
#include<16f877A.h>
#use delay(clock=20000000)
void main()
while(1)
for(i=0;i<5;i++)
output_low(PIN_B4);
delay_ms(500);
output_low(PIN_B4);
delay_ms(500);
for(i=0;i<8;i++)
output_low(PIN_B4);
delay_ms(500);
}
}
Result:
Wrote an ALP to blink the 7 LEDs 5 times with a delay of 500 m/sec. and then to make on each LED one by
one from right to left.
EXPERIMENT 5.
To write an ALP to read the DIP switches and display it on the LEDs and on computer screen.
Program Description:
Data lines for DIP switch are RD0 to RD7 and data lines for LED are RD0 to RD7. Read strobe signal for
switch is RB6 and latch signal for LED is RB4.
Program:
#include<16F877A.h>
#use delay(clock=20000000)
unsigned char a;
void main()
while(1)
Result:
Wrote an ALP to read the DIP switch status and to display the read value on the 8 LEDs and on the monitor
screen.
[...]
Details
Title
PIC LAB Manual. Examples for experiments using Microcontrollers
Subtitle
PIC 16F877 and LPC 2148 ARM 7 Trainer Kits
Author
Anoop B. K. (Author)
Year
2015
Pages
62
Catalog Number
V313312
ISBN (eBook)
9783668123397
File size
896 KB
Language
English
Tags
manual, examples, microcontrollers, trainer, kits
Quote paper
Anoop B. K. (Author), 2015, PIC LAB Manual. Examples for experiments using
Microcontrollers, Munich, GRIN Verlag, https://www.grin.com/document/313312
Comments
No comments yet.