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


Lecture 2

L9.2: Basic I/O. Planning projects: general organisation of hardware and software.

 [P9]  Hardware circuit, init_system()



3.4.2. Planning Hardware schematic Connecting switches and buttons Oscillator (OSC) and reset (MCLR_L) circuits

Crystal CLK

Fig. 1. Example of typical external quartz crystal Oscillator.


Fig. 2. Example of typical external MCLR_L circuit (CD_L): Power-ON reset (RC) network and active-low push-button for initialising the microcontroller. Interfacing LED Tri-state logic gates and wire bi-directionality. Bus concept.

The idea of tri-state gates and bidirectional wires and buses. Software program


Fig. 3.  Software organisation flowchart. RAM variables

In this charter, truth tables and all the software will be solved using RAM variables. For instance, if the input consist of D(3..0), the computer wil store a RAM variable type char named var_D. The four most significant bits of this memory position will be zeroed. init_system(): I/O port pin configuration register (TRIS).

Our goal: How to configure a port pin as input or as output. TRIS data direction register. 

Pin direction configuration

Fig. 4.  Example of pin direction configuration.


Let discuss all there ideas designing an example circuit. Adder_BCD_1digit


Exercise: Read the datasheet of the PORTC and draw the electronic circuit associated to a bidirectional pin.