Документ взят из кэша поисковой машины. Адрес оригинального документа : http://engineering.phys.msu.ru/en/branches/second-year-students-classes/microcontrollers-programming
Дата изменения: Mon Apr 11 22:36:02 2016
Дата индексирования: Mon Apr 11 22:36:02 2016
Кодировка: UTF-8
Microcontroller Programming

Course ?Microcontroller Programming? is presented in two formats:

  1. 32-bit microcontrollers
  2. 8-bit microcontrollers

32-bit microcontrollers

?32-bit Microcontroller Programming? course is divided into two sections: basic and extended, which allows students of any background successfully complete it..

  • Basic course. This special course is dedicated to the study of the theoretic and practical foundations of microcontroller programming of ARM family. Acquired skills: practical skill of microcontroller programming on C; working with standard peripherals such as UART, digital display, ADC, pulse-width modulator, timer, etc.
  • Extended course. This special course is devoted to the theoretic and practical foundations of programming cutting edge microcontrollers used in the complex control systems. Acquired skills: practical skill of microcontroller programming on C and Assembler; working with various peripherals such as UART, digital display, ADC, pulse-width modulator, timer, gyroscope, accelerometer, etc.

The duration of each special course within the frames of this program is two semesters. Each semester has 12 obligatory classes of four (4) academic hours each once a week, which totals in 48 hours per semester. Autumn semester hours are distributed the following way: 8 hours of lectures, 16 hours of seminars, 20 hours of practical classes, and 4 hours of examination. Apart from that, there might be additional classes appointed on agreement. In spring semester students have 44 hours to work on their course projects (coursework) on programming and then 4 hours for defending them.

Autumn Semester Syllabus

  • Class #1: System of microcontroller. The notion of a microcontroller. Families of microcontrollers. Microcontroller in use. The structure of a microcontroller: core, register, memory, cash, general input/output, timers, interrupts, watchdog, peripherals, debugging capability. Characteristics of a microcontroller: memory space, frequency, voltage supply, family and number of bits. Controller kits. Demonstration of how controller kits work.
  • Class #2: Programming on C for microcontrollers. C for ARM. Differences of the programming in comparison with PC. Input and output. Addressing. Binary and hexadecimal notations. IAR programming environment. Uploading a programme into a microcontroller. Design of the input/output programme.
  • Class #3: ARM Assembler. Introduction to the programming language of ARM assembler. Conditional execution and cycles. Repetition of the input/output programme using assembly language insertion.
  • Class #4: Basic elements of a microcontroller. Stack. Timers. Interruptions. Timing diagrams. Design of an asynchronous and periodic input/output programme.
  • Class #5: Data exchange. Data sharing with other devices. Consecutive and parallel data exchange, UART. The notion of a data exchange protocol. Noise margin and error control. RS232 for a microcontroller and a computer. Virtual USB-RS232 port. Writing an echo-programme using RS232.
  • Class #6: Managing currents and voltage. Currents and voltage in digital logic. Notions of pull-up, pull-down and tri-state. Pulse width modulation. Design of a programme for smooth control of output current.
  • Class #7: Digital-to-analogue and analogue-to-digital conversion. ADC, DAC. Design of a programme of a digital current controller.
  • Class #8: Working with a display. Structure of a display. Pixels, color, bit count of an image. Protocol for data recording on display. Design of a programme for display representation.
  • Class #9: Working on individual projects. Elaborating the structure of a programme.
  • Class #10: Working on individual projects. Design of a code project on C.
  • Class #11: Working on individual projects. Code debugging a test board.
  • Class #12: Working on individual projects. Presentation of a project.

By the end of the semester a student is to present an individual work on one of the following individual tasks:

  • Frequency definition of the external alternating TTL-signal with the display representation of the result.
  • Generation of PWM-signal with frequency settings and on/off time ratio with the help of in-built potentiometer. Switching between controls with the help of a button. Frequency and on/off rime ration should appear on display.
  • Capacity measurement using RC-chain and ADC. Capacity should be shown on display.
  • Inductance measurement using RC-chain and ADC. Inductance should be shown on display.
  • Signal generation uploaded form a computer with the help of modulation of short intentional glitches. Correct amplitude is not required.
  • Generation of a harmonic signal with the help of modulation of short intentional glitches. Frequency should appear on display. It is determined by an in-built variable resistor.
  • Measuring the distance between an acoustic radiator and a microphone by measuring the delay of sound propagation.
  • Voltage regulation in a RC-chain with feedback received through ADC. Voltage is determined by a computer and should appear on display.
  • Measuring timing statistics of the reports and its further forwarding to a computer and buffering in case of reports being frequent.

Spring Semester Syllabus

During the spring semester each student works individually or in a group of two on a project (coursework). The topic of a coursework is given either by the supervisor of the group or by the teacher of the course. In the former case, the topic of the project should be connected with the general programme of the course; in the latter the topic is formulated upon an interview with the student.

List of the possible topics for investigation:

  • Read output from a sub-band thermal fingerprint sensor. Determination of the application of the finger and its removal. Correlation recovery of partial fingerprints while scanning the finger. Recovered fingerprint-to-display.
  • Managing feedback of the vertical pendulum in conditions of instable equilibrium. Pendulum recovery with the help of a gyroscope and an accelerometer. Operating a brushless motor.
  • Operating a magnet pendulum. Fixed amplitude maintenance, maximum swinging and immobilization. Controlling the pendulum by way of electromagnet. Feedback is presented through magnetic induction in the field detector.
  • Building map of movement according to the data of the digital accelerometer. Trajectory should be shown in display. Trajectory is to be saved on an SD-card.
  • Design and programming a self-mobile servo robot. Control of its movement according to the data of inclinometer. Movement on a flat surface.

8-bit microcontrollers

Programming 8-bit microcontrollers. The given special course is devoted to the theoretical and practical foundations of the simplest and common microcontrollers. Acquired skills are the following: practical skill of programming 8-bit microcontrollers on C and Assembler; working with the in-built peripheral devices such as UART, interface USB, ADC, pulse-width modulator, timers, etc.

The duration of each special course is two semesters. Each semester has 12 obligatory classes 4 academic hours each once a week (in total, 48 hours per semester). In autumn semester there are 8 hours of lectures, 16 hours of seminars, 20 hours of practical classes and 4 hours for examination period. Moreover, there might be extra sessions scheduled on agreement. In the spring semester students work on the programming course projects (coursework). That takes 44 academic hours and then four (4) hours are devoted to defend their work.

Autumn Semester Syllabus:

  • Class #1: Introduction to 8-bit microcontrollers. The notion of a microcontroller. The structure of a microcontroller. Family of x51. The system of commands. Peripheral devices. Controller kits. Demonstration of work with a controller kit.
  • Class #2: Programming 8-bit microcontroller on Assembler. The programming language Assembler for microcontrollers of MCS-51 family. Programme model of a microcontroller. Keil ?Vision package. The structure of the simplest programme for a microcontroller. Basics of ASM-51 syntax. Compilation of the simplest programme on ASM-51 with the help of Keil ?Vision package.
  • Class #3: Debugging a programme for an 8-bit microcontroller. Emulation of programme execution on a microcontroller. Step-by-step debugging of a programme. Microcontroller C8051F330. Debugging interface JTAG/C2. Plugging a microcontroller to a computer. Microcontroller firmware. Software debugging for a microcontroller. I/O port.
  • Class #4: C programming language for microcontrollers. C51 language (Keil ?Vision package). Elementary programme on C51. Programme structure on C51. Initialization. Software debugging on C51.
  • Class #5: Elementary peripheral devices in use. Description of SFR registers. Initialization and software debugging of the peripheral devices after initialization. Counters/ timers. Generation of the digital signal of the given frequency. Interrupt system for microcontrollers. The model of a programme execution with interrupts. Switching between the banks of registers of a microcontroller. Stack. Interrupt set С8051F330. Generation of an arbitrary digital signal.
  • Class #6: Peripheral devices in use. UART/RS-232 (COM-Port). Serial port UART. UART control register. Operating speed, Baud Rate. Functions of sending and receiving bites. Working with UART with the help of interrupts. Sending commands to a microcontroller.
  • Class #7: Special peripheral devices in use. Signal generation from PWM. RSA control register. ADC in use. ADC control registers. DAC in use. DAC control registers.
  • Class #8: USB interface. Architecture of USB. Specification of USB 2.0. Implementation of a USB on a С8051F32х/С8051F34х microcontroller. USB control register. Command/data transport protocol. Job transfer on part of a microcontroller.
  • Class #9: Writing interface (USB) part of the programme for a microcontroller 1. Initialization of a USB. Request processing of connection initialization. Using the ENDPOINT0 element. Command request shipping.
  • Class #10: Writing interface (USB) part of the programme for a microcontroller 2. Operating peripheral devices with the help of USB. Using low priority USB requests. Using interrupting USB requests.
  • Class #11: Working on an individual project. Design of a project code and software debugging on a controller kit.
  • Class #12: Working on an individual project. Presentation of a project.

Spring Semester Syllabus

During the spring semester each student works individually or in a group of two on a project (coursework). The topic of a coursework is given either by the supervisor of the group or by the teacher of the course. In the former case, the topic of the project should be connected with the general programme of the course; in the latter the topic is formulated upon an interview with the student.

References (general list):

  • Wikipedia ? Microcontroller
  • Mayorov, S.A., Kirillov, V.V., Pribluda, A.A. Introduction to Micro-ECM.
  • Trevor Martin, The Insider?s Guide To The NXP LPC2300/2400 Based Microcontrollers. An Engeneer?s Introduction To The LPC2300 & LPC2400 Series.
  • Trevor Martin. STMicroelectronics Microcontrollers on Cortex-M3 core. STM32 Series.
  • Frunze, A.V. Microcontrollers Are Easy. (Volumes 1-3)
  • Kernighan, Brian W.Ritchie, Dennis M. (1978) The C programming language /Englewood Cliffs, N.J.: Prentice-Hall
  • Hamacher, C., Vranesic, Z., Zaky S. Computer Organization
  • Wikipedia: Pulse-Width Modulation
  • Wikipedia: ADC