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

 

3. Projects: a taste of real-world applications

Skills

PLA3, PLA7 and PLA11 consist of designing an application where you have to apply knowledge acquired during the course. PLA3 and PLA7 are based on hardware design (VHDL) and PLA11 is based on μC but following adaptations of Chapter 2 on FSM and dedicated processors. These are some ideas on how to organise and (self-)assess oral presentations and written reports.

This is the expected outcome from you as cooperative groups: three files to be uploaded to Atenea task PLA3, PLA7 and PLA11 before the deadline:

 

Examples ideas and projects from former CSD courses based on PLD and FPGA

VHDL project will be targeted to a Xilinx, Intel or Lattice Semiconductor CPLD or FPGA chips. Some projects are based on the analysis of circuits already written in CSD as tutorials. Other projects are new developments that has to be designed following the usual planning and organisation in CSD.

N.

Title

Description and details

1.

Programmable timer

Full project development and testing of the programmable timer already available in P8. It is the analysis of the tutorial circuit.

2.

8-bit hardware series multiplier

Analysis of this circuit. Dedicated processor: FSM + datapath for multiplying sequentially using only adders and data shift registers. 

3.

Serial data transmitter and receiver

Analysis of this USART module circuit: 9200 b/s, parity odd, 1 bit stop.

4.

Tachometer up to 200 km/h

It is a frequency meter. How to measure the frequency of an external signals using a dedicated processor? The pulsed input will be generated by means of an inductive sensor connected to the car. Speed computation from the measured frequency of pulses. This is an similar problem solved using classic chips  (1) - (2). Hall effect sensors.

5.

Bicycle taillights LED sequencer

This project is like the Johnson Counter in P10 but in VHDL. FSM controlled by an ST/SP button click to begin the sequence generation. A Datapath  includes basically shift registers. Clicking again the same ST/SP button the sequence stops when it finishes.

6.

 HH:MM:SS real-time clock

Study the tutorial P8 and attach to it Hours_Counter tutorial in P7 to be able to enhance the counter up to a modulo 86400. What buttons are required to set time?

7.

A stepper motor controller

This project, in its first design phase, is practically a FSM similar to the ones developed in P6. This is a sample circuit proposed by J. C. Arco (download, unzip the file and visualise it as a web page).

8.

LED dimmer

The idea behind a LED dimmer or a DC motor speed controller is the PWM generation. Here there is an example in Arduino to figure out how it works. In this case, the PWM generator must be organised as a dedicated processor. For instance, imagine how an 8-bit vector input can program up to 256 different PWM values. 

9.

TV remote control. PWM generator

Similar to the PWM generator from the LED dimmer. For instance, this encoder circuit 16key_matrix_encoder_reg may be used as input to generate 16 different duty-cycle rectangular waves. This is an initial sketch idea: a FSM will control a datapath (programmable counter) to set the duty cycle of a fixed frequency signal (for instance 1 kHz). Another source for studying how a PWM works is the TMR2-PWM peripheral in PIC18F µC.

What about the receiver end? How to demodulate 16 binary values from an incoming PWM waveform?

10.

8-bit I/O port expander with SPI bus  serial interface

How to design a chip like  MAX7301 or MCP23S17? These are peripheral subsystems or a dedicated processors that can be conceived using the architecture of an advanced digital circuit presented in P8. Study the commercial chip features, and try to order them so that it becomes possible to conceive such chip by means of several design steps.

11.

8-bit I/O expander with I2C bus serial interface

How to design a chip like MCF8574, MAX7300 or MCP23017? These are peripheral subsystems or a dedicated processors that can be conceived using the architecture of an advanced digital circuit presented in P8. Study the commercial chip features, and try to order them so that it becomes possible to conceive such chip by means of several design steps.

 

Examples ideas and projects from former CSD courses based on microcontrollers 

µC projects will be based on PIC18F family, Arduino or  Raspberry Pi. Some projects are analysis of circuits already designed in CSD following our organisation: specify, plan, develop and test. Other project are new ideas or applications to be yet specified and planned. Some projects from this list may be also used as initial ideas for your degree final dissertation. 

N.

Title

Description and details

12.

Example tutorial. 6-bit Johnson counter.  

Timer TMR2

Using the TMR2 to replace the external time-base CLK signal, like studied in P12. These are the video recording and the project files produced by R. Castro, J. Figueras and C. García: report, video presentation, project development in successive design phases until the final solution.

13.

Design of the HH:MM:SS real-time clock.

The idea is to study P8 programmable timer and organise this real-time clock in the same way: a dedicated processor with a FSM and a datapath (the counter modulo 86400 be translated into C). These are the sample schematic (1) and the C code (2)  to develop design phase #1. This is an example schematic to start planning next design phase #2 (3). This is another multiplexed digit system that can be used after replacing the classic internal design using TTL chips by a microcontroller. 

14.

Design of a programmable timer like the Timer_MMSS.

Timer TMR2, LCD display

Dedicated processor, FSM + Datapath in C language. This project can be organised in two design phases:

A) Analyse Timer_MMSS in P8 already solved using VHDL and a FPGA. Sketch the main blocks and resources for this circuit.

B) Analyse this Timer MMSS so that you can infer how hardware-software diagrams and datapath routines can be planned. For the datapath design, you better start studying a simple 1-digit BCD counter and chain them to get a 2-digit BCD module 60 counter, and so on. Finally, define a FSM to act as control unit.

15.

Serial data transmitter and receiver.

9200 b/s, parity odd, 1 bit stop.

Embedded USART peripheral.

Microcontroller peripheral.  A very interesting material to start learning about serial communications is this USART module solved using VHDL.

16.

Temperature acquisition system based on µC: thermometer from -10 °C to +40 °C.

 A/D embedded peripheral.

Concepts:

- Timer0 (or Timer1 or Timer2) to generate the sampling frequency for the A/D converter, for instance 2 Hz, two temperature samples per second.

- A/D converter to translate an analogue value from 0V to 5V into a digital 12-bit (or 10-bit) vector variable representing the value (Var_meas_Temp). The A/D technology: analogue multiplexer, successive approximations conversion, etc.

- Equations in int-float that has to be implemented in the code, to be able to deduce temperature (Var_Temp) form Var_meas_Temp. Indeed, you can deduce two formulas, one to obtain the temperature in °C and another formula for calculating temperatures in Fahrenheit.

- The sensor and its signal conditioner or amplifier. Technology, calibration curves, precision, range, resolution, etc.

17.

Bike speed meter and odometer (100 km/h, 1000 km).

Counter TMR0, time-base TMR2.

Idea: solve it as in Chapter II as a dedicated processor and then adapt it to a µC. These are some notes and a Proteus project. It is a frequency meter. How to measure the frequency of an external signals using timer/counter peripherals? The pulsed input will be generated by means of an inductive sensor (hall effect) attached to the fork of the bike wheel and a magnet on the wheel spoke. Speed computation from the measured frequency of pulses. Riding distance measurement accumulating pulses. For example: 20" tire, TMR2 as time-base for gate-time counting period and TMR3 for counting external pulses from the magnetic sensor attached to the bike wheel.

In this introductory project TMR2 has been interfaced at low-level programming directly configuration bits in RAM registers. However, as in many other peripherals, all commercial C compilers contain high-level C libraries (drivers) that can be used instead of programming at bit level. These libraries (example from ST)  become a hardware  abstraction layer (HAL) to allow the programmer to control peripherals without having to know specific details of a microcontroller family or vendor. Remember how LCD was programmed in P11, without much attention on Hitachi HD44780 chip or liquid crystal technology because this highly specific hardware was abstracted. As projects grow this hardware abstraction becomes indispensable.  

18.

Digital altimeter based on an absolute pressure sensor.

I2C pressure transducer.

I2C transducer already contains: pressure sensor, signal conditioner (resistor's bridge), amplifiers, A/D and digital circuit to generate a high-level digital output ready for the I2C interface. SCL and SDA outputs is what you must connect to a micro-controller I2C bus.

Study how I2C bus works and how is implemented as a µC peripheral, where to find an XC8 library to talk to the sensor.

Sensor variables such Var_meas_Temp and Var_meas_Pressure will be read in the ISR() function at a given sampling rate provided by timer interrupts.

19.

Digital compass.

I2C transducer.

Similar to to the digital altimeter. The transducer, based on a MEMS magnetometer, probably will include I2C interface.

20.

16-key matrix keyboard based on μC.

RBIF (interrut-on-change)

How to interface a matrix keyboard at PORTB? Pull-up resistors and interrupt flag RBIF (interrupt-on-change feature recommended for wake-up on key depression operations.

Read the datasheet and find similar applications on books or the web. The objective is to design using a μC the same circuit studied in P6: a matrix key encoder or similar.

Data from keypads may be used to turn on a DC motor or open a door when a 4-digit code matches an internal password.

21.

Bathroom or kitchen electronic scale.

A/D

Commercial scale.

Concepts: pressure sensors, load cells, signal conditioners, Wheatstone bridge, amplifiers, signals conditioners, OpAmps. A/D converter, sampling frequency using TMR, ISR(), FSM, RAM variables, weight or mass calculation from pressure measurements, etc.

22.

Dot-matrix driver.

Starting problem to organise a dot-matrix driver is here.

23.

A stepper motor controller.

 

A dedicated processor to be adapted to μC. This is a sample circuit from J. C. Arco. 

What is a stepper motor, how does it works, which buttons/switches will be used to command it: start/stop, rotation direction, etc., how to control the rotation speed, how to measure axis position or rotation speed, commercial product such as steeper motor driver/controller.

24.

LED dimmer.

TMR2 and PWM peripherals

The idea behind a LED dimmer or a DC motor speed controller is the PWM generation. This is an example in Arduino to figure out how it works. 

25.

A data acquisition system for inertial navigation.

The project consists in the specification and planning of an Inertial Navigation System, designed to be on board of a rocket. The system is based on an analog 3-axis accelerometer (such as, for example: KX220-1071), that takes samples at a certain rate of the accelerations that the rocket is experiencing in-flight.

The output from the sensor must be conditioned and then entered into an A/D converter. The digitalized data will be stored in a memory chip, such as a RAM, for post-flight extraction and analysis. The device will get 'on'; that is, the accelerometer will start to record data; once an input signal 'Start' is equal to a logic '1'. The system will stop after a given timing period programmed by a timer circuit. 

     

 

Other materials of interest 

A few links on FSM that naturally can be implemented in hardware (VHDL -PLD) or in software (μC): (1) on traffic light controllers; (2) academic; (3) sequence recogniser and vending machines; (4) an excellent table of content and web page of resources (5); (6) academic; (7) a robot that avoid obstacles; (8) hobby robotics; (9) theory from AMD; (10) a complete book; (11) All about circuits FSM & μC (12) Software based FSM using μC (ARM paper); (13) A nuclear reactor shutdown system; (14) stepper motors; (15) Control for mobile robots; etc. etc.


This is a list of very interesting teaching experiments and projects based on platform Digital Systems Development Board (DSDB) also compatible with ELVIS III from National Instruments. A typical FPGA board populated with a Xilinx device. It can be programmed with VIVADO EDA tools.


Research papers 

This is an example of a reseach paper in the area of microcontrollers and peripherals on the topic of low power consumption, leaded by prof. Ferran Reverter of the dept. of Electronic Engineering

Reverter, F., "Toward Non-CPU Activity in Low-Power MCU-Based Measurement Systems", IEEE Transactions on Instrumentation and Measurement ( Volume: 69 , Issue: 1 , Jan. 2020 ). DOI: 10.1109/TIM.2019.2953374.

Abstract: This article evaluates the benefits of having peripheral-triggered peripherals in a microcontroller unit (MCU) intended for low-power sensor applications. In such an architecture, the functionality is moved from the central processing unit (CPU) to the peripherals so that a peripheral is able to trigger another peripheral with non-CPU intervention. For the sensor data logging application under study, both energy consumption and measuring time are reduced by a factor of 2 with respect to the case of applying an interrupt-based approach that requires the CPU intervention.

Download the full paper logging in through UPC intranet.


Bachelor dissertations

A pair of bachelor thesis (TFG) on the subject:

- Gómez Blázquez, A., "Autonomous low-power wireless sensor for a remote weather monitoring station", 2016. To examine the project documentation, download and unzip these two files: 1, 2.  

Wheater station

Fig 5. Weather station representation and its final prototype.

- García Moreno, A. "Autonomous low-power wireless sensor for greenhouse irrigation, 2016. To examine the project documentation download and unzip these two files: 1, 2.  

Greenhouse

Fig 6. Greenhouse irrigation system block diagram.

 


Remarks on projects in engineering context:

Students design solutions for a problem for which there is no single answer. The problem may require students working in cooperative groups to design a combination of plans, schematics, models, diagrams, simulations, source files and presentations. Going through the design process (specify, plan, develop and test) will require students to constantly adjust and modify their solutions to meet criteria. While designing a solution, it will be important to recognise that the idea of failure in engineering is a sign of growth in the cognitive process. Therefore, students may not get a viable solution on the first try or within the provided time constraints. In that case, the instructor can encourage them to reflect on their solution to identify what they have learned and look back to identify and correct design errors.