UPC EETAC Bachelor's Degree in Telecommunications Systems and in Network Engineering EEL


Lecture 4

L9.4: Basic digital I/O. Write output port pins

[P9 truth_table(), write_outputs()


[23/5] truth_table(), behavioural description (plan B), algorithm

The same algorith and ideas presented in Chapter 1: plan B, behavioural truth table interpretation that now will be translated into C language.  Example are the C translation of these flowcharts in P9 and LAB9. write_outputs()

Our goal: How to inferface RAM memory bits to output pins? From internal RAM variables, write to output pins in a single instruction without modifying data available in pins of no interest. We will use bitwise logic operations such AND, OR, NOT, SHIFT.

These are two examples on how to write RAM variables in assigned port pins.

Writing a pin

Fig. 1. Example on how to write a single output pin.


Writing multiple pins

Fig. 2. Example on how to write a vector variable onto several port pins. Repeat the same proceeding for BCD(2..1) at PORTB.

Thus, once again, you see how the same entity can be yet designed using another plan in the list: implementing logic functions using microcontrollers and software programing (strategy number 9).