Module information on this degree can be found below, separated by year of study.

The module information below applies for the current academic year. The academic year runs from August to July; the 'current year' switches over at the end of July.

Students select optional courses subject to rules specified in the Mechanical Engineering Student Handbook,  for example at most three Design and Business courses. Please note that numbers are limited on some optional courses and selection criteria will apply.

Embedded C for Microcontrollers A

Module aims

This module aims to introduce students who are proficient in MATLAB programming to the C programming language: amongst the most widely-used ever amongst programming languages, and one which provides an excellent foundation for learning others (e.g. C++ and JavaScript). It also aims to develop, from the basic knowledge of mechatronics provided in ME2, an ability to build mechatronic systems containing typical sensors and actuators that are controlled by a microcontroller programmed in C. This is a level 6 version of the enhanced level 7 ECM module and students cannot take both for credit towards their final degree.

ECTS units:    5    
 

Learning outcomes

On completion of this module students should be able to: 

1. Explain the principal components of, and terminology used in, embedded computer hardware and software

2. Write simple C programs to manipulate numerical bit-pattern data and text, perform calculations and interface with external hardware

3. Design, make, test and document a functional mechatronic system containing an embedded microcontroller

4. Assemble working microcontroller-based mechatronic systems on a prototype board

Module syllabus

Introduction to C language: structure, types and variables, arrays, assignment operations, conditional expressions, flow control, switch.

Advanced C language: structures, functions, recursions, pointers.

Introduction to microcontrollers:  architecture, PIC18FXXX examples, the PICKit Programming Device, programming, debugging.

Bit operations: inputs and outputs: digital and analogue.

Interrupts: time-based interrupts, external interrupts.

Time measurement: oscillators, timers, counters.

Motor control: DC motors, PWM, RC servo motors, optical encoders.

Communication: RS232 PC interface.

Further applications: LCD, RFID, direction finding

Pre-requisites

In order to gain the maximum benefit from ECM, students are expected to have a good understanding of ME1 and ME2 mechatronics as well as ME1 computing, including:

  • Use of oscilloscope
  • Assembling simple circuits (breadboard)
  • Standard programming structures: conditional statements (if…  then… else), loops (e.g. for… next)
  • Binary and hexadecimal number bases.
  • Resistor network analysis
  • Pulse width modulation
  • Sampling
  • Data acquisition

Teaching methods

This module has a strong practical element and consists of one 3-hour lab-based tutorial per week, supported by in-situ lectures. Hands-on system construction and programming exercises  are used to support learning.

Assessments

Assessment details        
      Pass mark   
Grading method Numeric   40%
         
         
Assessments        
Assessment type Assessment description Weighting Pass mark Must pass?
Coursework Project 80% 40% N
Practical Labs 20% 40% N

Module leaders

Professor Ravi Vaidyanathan