Microcontroller fabrication and programming

University teacher: Vidmar Matjaž
Number of credits: 4

Description of the subject

Conditions for work or study:
Completion of all the requirements of the first year of the 1st cycle in any science or engineering course involving mathematics. Knowledge acquired in the course ‘Practical prototyping of electronic circuits’ or similar.


A rough breakdown of the content:

  • Overview of PIC, AVR, ARM, CORTEX, MIPS microcontroller cores,
  • Features and commands of a simple 8-bit PIC and a 32-bit ARM core,
  • Programming micro-controllers in the bus, related software tools,
  • Internal RAM and FLASH microcontroller memories, FLASH memory programming,
  • Microcontroller I/O: general I/O, timers, serial communication, A/D and D/A converters, Ethernet,
  • Practical work: building a PIC or ARM microcontroller (putting theory into practice),
  • Individual work: independent construction of a microcontroller device and associated programming of your choice in the form of a seminar.


Detailed breakdown of content:

The theoretical part:

  1. Comparison of the characteristics and performance of different cores: 8-bit PIC and AVR, 32-bit ARM, CORTEX and MIPS,
  2. The instruction set of a simple 8-bit PIC core, performance exploitation and programming tricks, subroutine calls and interruptions,
  3. Programming of PIC microcontrollers, use of the MPASM bus, access to program FLASH, data FLASH and flags, programmers used and software support,
  4. ARM kernel registers, ARM, Thumb and Jazelle instructions, ARM kernel exceptions, errors and interrupts, ARM4 instruction set, conditional execution and ARM7TDMI kernel properties with history,
  5. ARM bus, instruction write mode, ARM shifter operand, subroutine call and return to ARM, link register, ARM bus pseudo instructions: LDR=, LTORG, ALIGN, SPACE, DCD,
  6. Compiling the ARM collection: using ARMASM, ARMLINK and FROMELF,
  7. Using the GNU compilers AS, LD and OBJCOPY, differences of the compiler commands,
  8. Bootloader access to embedded FLASH: JTAG, USB, UART (FlashMagic and lpc21isp),
  9. Simple I/O units, input types with/without hysteresis, output types push-pull and open-drain, pull-up and pull-down resistors, speed control, damping resistors,
  10. Hardware counters, timers and PWM (Pulse-Width Modulator) as input/output units,
  11. Asynchronous serial communication over UART, UART registers and settings, programming and interrupts, use of FIFO, other versions of serial communication AART, USART, HDLC, CRC calculation, SLIP protocol,
  12. SPI, I2C, JTAG serial I/O units, hardware and software implementation,
  13. A/D converter with successive approximation, sampling of the input signal, conversion time, software use of the A/D converter and interrupts, different D/A converter designs: R2R, PWM, etc,
  14. Persistent memory, EEPROM and battery-powered static RAM,
  15. Ethernet interfaces, MAC and PHY, RMII bus signals,
  16. Liquid crystal displays (LCD), alpha-numeric and graphic modules, connection to microcontroller, programming of LCD modules,
  17. Microcontroller installation, PCB requirements, use of sub-circuits, use of ISP (In-System Programming), power requirements, clock, reset, power eclipse detection, I/O requirements,
  18. Requirements of the target device with microcontroller, selection of suitable hardware, division of tasks between analogue circuits, programmable logic and microcontroller,
  19. Program design in the microcontroller, initialization of support, initialization of I/O units, main loop of the program, switching between tasks, selection and meaningful use of interrupts.


Practical part:

  1. Making a printed circuit board of a PIC or ARM microcontroller,
  2. Practical soldering of PIC or ARM microcontroller components,
  3. Reviving and testing microcontroller circuits with test programs,
  4. Correcting soldering errors, replacing incorrectly installed and damaged components,
  5. Installation of the bus and other compilers in Windows, Linux and MAC-OS environments,
  6. Installation of the FLASH programmer or ISP software in Windows, Linux and MAC-OS environments,
  7. Basic programming of microcontroller support,
  8. Basic programming of I/O units, simple I/O, UART, timer, SPI, A/D converter,
  9. Basic programming of the LCD module, command input from a simple keypad.


  1. Choosing a topic,
  2. Designing a microcontroller device,
  3. Basic programme planning,
  4. Practical microcontroller programming,
  5. Correcting errors in the software,
  6. Presentation of the work to the other participants.


Objectives and competences:


Ability to independently build a microcontroller, to use the built-in I/O units efficiently and to write software in order to solve a specific task in a device that needs the support of a microcontroller. Testing of the final product, detecting and correcting hardware and software faults.


  • Knowledge of microcontrollers of different technologies and capabilities,
  • Knowledge of the programming method and associated software tools for microcontrollers,
  • Solving a task in a device that requires microcontroller support.


Working methods:

Lectures, tutorials and practical building and programming of a prototype device in the laboratory. Participants may also carry out part of the practical work independently outside the laboratory tutorials, and bring the final product to the final tutorial for review and assessment. After the tutorial, the participants will independently design, build and test the device according to their own ideas.



Manual in textbook format, freely available to participants 1
Digital material (programmes, support), freely available to participants 2

The literature is available to participants via an online classroom or website.

  • http://antena.fe.uni-lj.si/literatura/VajeOK/USB2138/prirocnik/Mikrokrmilnik.pdf
  • http://antena.fe.uni-lj.si/literatura/VajeOK/USB2138/

(eng.) The literature is available only in Slovenian language

Studies in which the course is conducted:

  • 0th year – level – Extracurricular activity

Stay up to date

University of Ljubljana, Faculty of Electrical Engineering Tržaška cesta 25, 1000 Ljubljana

E:  dekanat@fe.uni-lj.si T:  01 4768 411