0% found this document useful (0 votes)
74 views29 pages

Pt-51 Test Procedures

The document describes a test program for the peripherals on a Pt-51 microcontroller board. The test uses different switch positions to test the LEDs, timers, PWM, counter, SPI, UART and LCD. For each test, it provides the objectives, procedures, expected outputs and results. The tests are displayed on an LCD screen and aim to verify that each peripheral functions as expected.

Uploaded by

game hacker
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views29 pages

Pt-51 Test Procedures

The document describes a test program for the peripherals on a Pt-51 microcontroller board. The test uses different switch positions to test the LEDs, timers, PWM, counter, SPI, UART and LCD. For each test, it provides the objectives, procedures, expected outputs and results. The tests are displayed on an LCD screen and aim to verify that each peripheral functions as expected.

Uploaded by

game hacker
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Pt-51 Test Program

by
Varun Warrier
Objective
• To test the peripherals of the microcontroller
and the hardware on the Pt-51 board, i.e.
– LEDs
– Switches
– PCA Module
– SPI
– UART
– LCD display
– Port Pins
Test Procedure
• Putting the switches in various positions from
0 to 7 (bit values) will test each of the
peripherals
• The switches are connected to pins P1.0-P1.3
of the microcontroller
• The switches corresponding to P1.0 to P1.2
will be used for the test, with P1.0 being the
LSB and P1.2 being the MSB
• Ongoing test and results displayed on LCD
Test Procedure
Key Position (P1.2-P1.0) Tested Peripheral
000 Timers
001 PWM module
010 Counter Module
011 SPI Module *
100 UART Module **
101 LCD Display
110 Clear Screen
All others Timers

*Pins MOSI and MISO are to be shorted during this time


**Pins 3.0 and 3.1 (UART Rx and Tx) are to be shorted during this time
Please refer to the Pt-51 manual for identifying the pins
Defaults
• Keeping the switches in position 6(0b110)
clears the LCD Screen
• All other key positions (0x07 to 0x0F) run the
default test, i.e., the Timer Test
• If the test fails because the loopback wires are
not connected, plug in the wires and restart
the microcontroller.
• If the test fails in spite of the wires being
connected, inform your TA
Failed Test-SPI/UART
Starting the tests
Timer Test
• How many timers does the microcontroller
AT89C5131A have?
• Switches in Position 0 (0b000) for test
• Timer 0 blinks LED4 (P1.4)
• Timer 1 blinks LED3 (P1.5)
• Timer 2 blinks LED2 (P1.6)
• Try to guess the frequencies
Timer Test
PWM Test
• Uses the PCA module of the microcontroller
• What does PCA stand for?
• Called CCP module in some microcontrollers
• Switches in Position 1(0b001)
• Signals of different duty cycle with the same
pulse width are fed to the 4 LEDs
PWM Test
• Average voltage
applied to LEDs
varied by varying
duty cycle
• As a result they light
up with different
intensities
• Try to guess duty
cycles used in the
program
PWM test
Counter Test
• Uses the PCA module of the microcontroller
• Microcontroller can capture events on a pin
and save it into a register
• Switches in Position 2(0b010)
• Toggle switch 3(P1.2) to increment the count
• When the count reaches 5, test is finished
• Because of bounce, count may increment by
more than one for 1 toggle
Counter Test
Counter Test
Counter Test
SPI Test
• What does SPI stand for?
• Used for communication between uCs and
peripherals(1 or more) or between uCs (1 or
more)
• Switches in Position 3(0b011)
• Short pins MOSI and MISO before test
• Data sent over MOSI is received by MISO
(Called looping back)
• If both bytes match, test is a success
• Procedure repeated 5 times
SPI Test
• SPI uses shift registers to send and receive data
• When bit 7 is transmitted by master, it is put in bit 0 of the
slave. Then both registers are shifted right by one
• Transmission and shifting continues 7 more times till data is in
the right place
SPI Test
SPI Test
SPI Test
UART Test
• One of the most popular communication
interfaces
• Stands for Universal Asynchronous Receiver
Transmitter (Also called RS232)
• Switches in Position 4(0b100)
• Performs loopback as with SPI. Hence need to
short UART Rx and Tx pins (P3.0 and P3.1)
• If sent data = received data, test successful
• Performed 5 times
UART
UART Test
UART Test
UART Test
LCD Test
• Switches in Position 5(0b101)
• LCD has 2 lines with 16 characters each
• Program verifies if the LCD is able to display all
alphanumeric characters
• The program quickly over all alphanumeric
characters at every display block in both lines
• Displays 32 “Z”s at the end of the test
LCD Test
LCD Test

You might also like