0% found this document useful (0 votes)
32 views

EE-712 Embedded System Design Lab2 - Parallel IO and Basic Operations in Assembly

This document provides instructions for an embedded systems lab involving interfacing switches and LEDs to a TivaC microcontroller board using assembly programming. The program is to read 4 switch inputs to form a 16-bit input value, perform an operation on the input defined by the operation code and operands, and display the 8-bit output values on an LED array using proper timing. Care must be taken when interfacing LEDs to ensure the microcontroller pins are not damaged by currents higher than 8mA by using 7406 buffer chips.

Uploaded by

Joginder Yadav
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

EE-712 Embedded System Design Lab2 - Parallel IO and Basic Operations in Assembly

This document provides instructions for an embedded systems lab involving interfacing switches and LEDs to a TivaC microcontroller board using assembly programming. The program is to read 4 switch inputs to form a 16-bit input value, perform an operation on the input defined by the operation code and operands, and display the 8-bit output values on an LED array using proper timing. Care must be taken when interfacing LEDs to ensure the microcontroller pins are not damaged by currents higher than 8mA by using 7406 buffer chips.

Uploaded by

Joginder Yadav
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

EE-712 Embedded system design

Lab2 - Parallel IO and basic operations in Assembly

Aim: To interface switches and LEDs to the parallel ports of the TivaC
board and to perform some basic operations on the inputs and give proper out-
put using Assembly programming.

Program is to loop for reading the inputs and displaying the outputs. TivaC
break out board is provided with 4 switches that are connected to port pins
PA.2 to PA.5. Use these 4 switches to take the input.

Task flow:
1. Input and output are of 16 bits. Lets say X15X14....X0 is input and
Y15Y14....Y0 is output. Operation to be performed is given by X15X14,
operand1 is given by X13X12..X7 and operand2 is given by X6X5..X0.

2. Input from the 4 switches should be taken for 4 times to form 16 bit data
using the protocol mentioned below.

(a) A notification of the board ready to accept new data should be given
by glowing any of the LED connected to port F.
(b) After the LED is on, user should set the switch position to give input.
(c) SW1/2 of the port F should be pressed to indicate the board to accept
the data.
(d) LED should be made off and the data read from switches should be
saved.
(e) After a delay, LED is made on and the process repeats.
3. Operations:

(a) When X15X14=00, whole input is copied to the output.


(b) When X15X14=01, Y15Y14=01, Y13Y12..Y0= X13X12..X7+ X6X5..X0.
(c) When X15X14=01, Y15Y14=01, Y13Y12..Y0= X13X12..X7 - X6X5..X0.
(d) When X15X14=01, Y15Y14=01, Y13Y12..Y0= X13X12..X7 x X6X5..X0.
4. Output should be given 8 bits at a time to the LED array. Sufficient delay
should be given between the display of MS Byte and LS Byte. Port B can
be used to connect the LED array.

NOTE:

1. GPIOs on TM4C123 can be configured for 2mA, 4mA, 8mA drive strength.
On reset, GPIOs are default to 2mA drive strength. While interfacing

1
Fig 1: Interfacing of 7406 buffer with TM4C

LEDs, if the LED current is more than 8mA then we cannot connect it
directly to the microcontroller pin. It may damage the chip due to high
current. Use 7406 buffer to avoid accidental damage to microcontroller
pins as shown in the figure above.
2. Refer to Supporting doc for Assembly.pdf for tips on assembly program-
ming.

You might also like