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

P_Ch3

Q&A

SP3_1: On basic digital I/O. Designing a combinational circuit

SP3_2

Lab9


NOTE: This subproject must be solved only after having completed successfully lab session Lab9 because you will copy and adapt materials from it.

1. Specifications

Symbol

Fig. 1. Symbol

Remember its truth table and how it works when applying input stumulus in time (Fig. 2).

Truth table and timing diagram

Fig. 1. Truth table and example of timing diagram.

 

2. Planning

Follow the same procedure studied in Lab9 tutoriaL{Dual_MUX_4} or in P9 {Adder_BCD_1digit}

Project location:

C:\CSD\P_Ch3\SP3_1\(files)

Schematic hardware

Fig. 3. Hardware circuit. Comp_4bit symbol and PIC18F4520 pin connections.


This flowchart below in Fig. 4 is an example of discussion (be aware that the pinning may be different from Fig. 3) on reading operations: from pins to RAM variables.

Reading inputs

Fig. 4. Procedure for reading/polling digital inputs.

And below in Fig. 5 is represented another example of flowchart on interpreting the truth table behaviourally. Complete the flowchart and deduce its C code equivalent.

Truth table

Fig. 5. Truth table interpretation.

 

3. Developing and 4. testing

And again: use separate sheets of paper and the correct folder location for your projects. Remember that this exercise must be solved only after having completed lab session Lab9.

Solve the circuit (develop & test) step by step using watch window for debugging purposes. One signal at a time.

-. This is the hardware circuit Comp_4bit.pdsprj that you can adapt and use to start capturing the schematic.

- This is the Comp_4bit.c source file with some operations. Run MPLABX project. You can start compiling verify that you can read correctly a pin like Gi --> Var_Gi. Watch variables in watch windows while debugging. Complete the application step by step.

 

5. Report

Follow this rubric for writing reports.