Building and programming a micro-controller

Higher education teachers: Vidmar Matjaž
Credits: 4

Subject description


Passed all exams of the first year of any study programme in the field of science and/or engineering that includes mathematics. Knowledge gained in the course “Practical manufacturing of prototypes of electronic circuits” or similar.

Content (Syllabus outline):

  • A rough breakdown of content:
  • Overview of micro-controller cores PIC, AVR, ARM, CORTEX, MIPS,
  • Properties and instructions of the simple 8-bit PIC core and 32-bit ARM core,
  • Programming micro-controllers in assembly language, corresponding programming tools,
  • Internal memories RAM and FLASH, FLASH programming,
  • Micro-controller peripherals: general purpose I/O, serial communications, A/D and D/A converters, Ethernet,
  • Practical work: manufacturing of a PIC and/or ARM micro-controller board (transfer of theory into practice),
  • Individual work: designing a working device including a micro-controller and programming it in related language of their choice in the form of a seminar.

A detailed breakdown of content:

Theoretical part:

  • Comparison of properties and capabilities of different cores: 8-bit PIC and AVR, 32-bit ARM, CORTEX, MIPS,
  • Instruction set of a simple 8-bit PIC core, full use of its capabilities and programming tricks, subroutine calls and interrupts,
  • Programming PIC micro-controllers, using MPASM assembler, program FLASH access, data FLASH access and flags access, PIC programmers and their software support,
  • ARM core registers, ARM, Thumb and Jazelle instructions, ARM-core exceptions, errors and interrupts, ARM4 instruction set, conditional execution and ARM7TDMI core properties,
  • ARM assembler, command syntax, ARM shifter operand, ARM subroutine calls and returns, link register, ARM assembler pseudo instructions: LDR=, LTORG, ALIGN, SPACE, DCD,
  • ARM assembler compilation: using ARMASM, ARMLINK, and FROMELF,
  • Using GNU compilers AS, LD and OBJCOPY, syntax differences,
  • Bootloader access to built-in FLASH: JTAG, USB, UART (FlashMagic and lpc21isp),
  • General purpose I/O ports, inputs with/without hysteresis, push-pull and open-drain outputs, pull-up and pull-down resistors, slew-rate control, damping resistors,
  • Hardware counters, timers and PWM (Pulse-Width Modulator) as micro-controller peripherals,
  • Asynchronous serial communication via UART, UART registers and settings, UART programming and interrupts, FIFO usage, other serial communications AART, USART, HDLC, CRC computation, SLIP protocol,
  • Serial I/O ports SPI, I2C, JTAG, hardware and software implementations,
  • A/D converters with successive approximation, sample and hold, conversion time, A/D converter programming and interrupts, different implementations of D/A converters: R2R, PWM etc,
  • Nonvolatile storage, EEPROM and battery-backed static RAM,
  • Ethernet interfaces, MAC and PHY, RMII bus signals,
  • Liquid-crystal displays (LCD), alphanumeric andgraphic modules, microcontroller interface, LCD module programming.
  • Installation of a microcontroller chip, requirements for the printed-circuit board, using IC sockets, using ISP (In-System Programming), supply, clock and reset requirements, brown-out detection, requirements of I/O,
  • Requirements of the target application, selection of a suitable micro-controller hardware, task splitting among analog circuits, programmable logic and micro-controller,
  • Basic concept of a microcontroller program, initialization of micro-controller support (clock, watchdog etc.), initialization of peripherals, main program loop, task switching, selection and reasonable use of interrupts.

Practical part:

  • Practical manufacturing of a PIC and/or ARM micro-controller printed-circuit board,
  • Practical soldering of PIC and/or ARMmicro-controller components,
  • Check-out of the micro-controller with test software,
  • Correction of errors in soldering, replacement of wrong and/or damaged components,
  • Installation of the assembler and other compilers in Windows, Linux or MAC-OS environments,
  • Installation of FLASH programmer or ISP support software in Windows, Linux or MAC-OS environments,
  • Basic programming of micro-controller support functions: clock, PLL, FLASH support, watchdog, brown-out detect,
  • Basing programming of built-in peripherals, simple I/O, UART, timer, SPI, A/D converter,
  • Basic programming of the LCD module, command input from a simple keyboard.


  • Selection of topics,
  • Product design including a micro-controller,
  • Basic software design,
  • Practical micro-controller programming,
  • Software troubleshooting,
  • Presentation for the other participants.


The ability to build a micro-controller, efficient use of its built-in peripherals and writing the corresponding software to solve a practical problem in an apparatus that requires some form of a micro-controller support. Testing the final product, hardware and software error detection and correction.

Competences (occupation specific):

  • Knowledge of different-technology micro-controllers and their capabilities,
  • Knowledge of programming methods and corresponding programming tools for micro-controllers,
  • Problem solving in an apparatus that requires micro-controller support.

Knowledge and understanding:

  • Knowledge of the internal structure of a micro-controller,
  • Knowledge of core and peripheral programming,
  • Knowledge of programming tools,
  • Understanding the capabilities of micro-controllers to solve practical problems,
  • Knowledge of writing efficient micro-controller software.

Learning and teaching methods:

Lectures, laboratory courses, practical construction and programming of prototype devices in the laboratory. Participants can also carry out part of the practical work independently, outside of the laboratory exercises and then bring the final product to the review and assessment on the last laboratory exercise. After the pedagogical work, participants independently design, construct and test their own product.

Study materials

The literature is available only in Slovenian language

Study in which the course is carried out

  • 0 year - cycle - Extracurricular activities