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

 

Fixed-time timer. Phase #2: LCD

P12


Dedicated processor + LCD peripheral

1. Specifications

Design a fixed-time timer (for instance 18.5 s) as represented in Fig. 1.

Symbol

Fig. 1. The timer symbol and basic waveform in non-retriggerable mode of operation.

Features:

- Same features as in design phase #1 Timer.

- Use LCD to show ASCII messages.

2. Planning

Step 1: Hardware. Add the LCD interface copying and adapting a previous example from P11. 

Step 2: Software.

- Draw and discuss an state diagram and software organization. What states or signals have to be introduced to adapt the LCD? Hardware-software diagram

-  Modify init_system() function.

- Modify state-logic() and output_logic(). Truth tables and flowcharts.  

- Discuss read_inputs(), write_outputs() and ISR(). Truth tables and flowcharts.  

 

3. Developing the project using EDA tools

Phase #1. Study all the files in basic Timer, the same device fully operational without LCD. 

Phase #2. Include LCD display. This is an example Timer_LCD.pdsprj harware and Timer_LCD.c software code.

Circuit running

Fig. 2. Timer with LCD running.

 

4. Testing and validating the design

The idea is for easy debugging, write, compile and run a bit of code with both windows working interactevely: hardware Proteus environment and software IDE. Use the watch window and break points to stop and control the program sequence and monitor RAM variables of interest for each function.

Circuit running with watch window

Fig. 3. The timer running while watching the main variables of the software.

5. Report

Project report starting with the template sheets of paper, scanned figures, file listings, docx , pptx, or any other resources.

 

6. Prototyping

This project may be uploaded to a PICDEM2plus board for laboratory experimetation.

 

Other similar tutorial exercises

- In phase #3 Timer_LCD_TMR0, the datapath located in the main loop is replaced by the specialised peripheral TMR0. The use of microcontroller peripherals discharge the CPU of internsive processing speeding the execution of the main loop and leavins space for other functions.