upc eetac_1 Bachelor's Degree in Telecommunications Systems and in Network Engineering

Week 10

Week 11: FSM in C and LCD displays

Week 12



Guided activities #11

[P11] Interfacing a LCD


- The LCD peripheral. Controller, interface, libraries, etc.



Lecture #11

 [P11] IExample of the Adder_BCD_1digit_LCD 

[P12] Peripherals: Timers


- A good assigment to solve may be: Enhance the 1-digit BCD adder project in P9 so that the result is represented in the LCD display instead of the 7-segment digits. Run the project copied to :


- How to add the LCD display hardware?, Which outputs is replacing?

- Which functions has to be modified?

- Which RAM variables are required now that we like to write text and numbers as ASCII messages?

Discuss what kind of numbers: char, int, double int, float, etc. When is necessary to use an array of char? What if instead of a simple addition, the circuit has to subtractmultiply or divide?

 - Which is the variable var_LCD_flag used for?

- Discuss the C code flowchart and its translation to C.

- Which is the function and especifications of a timer (a real-time counter)? What is the meaning or triggering and re-triggering?

- Reviewing the project of a programmable timer using VHDL (Chapter II and dedicated processors (P8)).

- Which is the difference if the timer timing period is ns, ms, minutes or weeks?

Phase #1: Let's invent a timer using as a datapath an external CLK signal (time base), a counter (RAM variable). Hardware-software diagram.

- Hardware. External CLK time base and trigger button (INT0). Counter RAM variable.

- Software. FSM controlled by the trigger button (INT1).



Laboratory #11

[P11] The LCD peripheral. Library of specialised functions. var_LCD_flag variable.

Example projects of digital circuits


Final project P_Ch3 proposals for cooperative group (oral presentation and written documents). Let's discuss on how to organise the cooperative group 10 minutes oral presentation and the final written report using a word processor. Each group will be in charge of presenting a different project. Here we'll propose you a list of projects and we'll assign them in class. Selection of projects: 3T1 - 3T2. You'll produce your oral presentation video in the recording studio available at our CBL library.

Examples o the use of the LCD library: For instance, enhance the P10 serial transmitter to be able to display messages on the LCD.

1. Copy and rename the P10 to the P11 location: L:\CSD\P11\Serial_Transmitter_LCD\ (files)

2. Compile and run the project and learn about the One-shot (single) trigger operation mode of the oscilloscope and how the frame of bit is transmitted once the ST button is detected.

3. Modify the hardware and attach the LCD copying for example from the Adder_BCD_1digit project.

4. Add the libraries and modifications in the sofware to represent messages.

- Some files to start the serial data transmitter

Demonstrations and experimentation with several circuits developed using CPLD/FPGA/μC. This is the step #5 in the design process: downloading the configuration file into the target chip, whatever it be a PLD or a μC using the corresponding device programmer.