Making and programming a microcontroller
University teachers: 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:
- Comparison of the characteristics and performance of different cores: 8-bit PIC and AVR, 32-bit ARM, CORTEX and MIPS,
- The instruction set of a simple 8-bit PIC core, performance exploitation and programming tricks, subroutine calls and interruptions,
- Programming of PIC microcontrollers, use of the MPASM bus, access to program FLASH, data FLASH and flags, programmers used and software support,
- 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,
- 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,
- Compiling the ARM collection: using ARMASM, ARMLINK and FROMELF,
- Using the GNU compilers AS, LD and OBJCOPY, differences of the compiler commands,
- Bootloader access to embedded FLASH: JTAG, USB, UART (FlashMagic and lpc21isp),
- 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,
- Hardware counters, timers and PWM (Pulse-Width Modulator) as input/output units,
- 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,
- SPI, I2C, JTAG serial I/O units, hardware and software implementation,
- 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,
- Persistent memory, EEPROM and battery-powered static RAM,
- Ethernet interfaces, MAC and PHY, RMII bus signals,
- Liquid crystal displays (LCD), alpha-numeric and graphic modules, connection to microcontroller, programming of LCD modules,
- Microcontroller installation, PCB requirements, use of sub-circuits, use of ISP (In-System Programming), power requirements, clock, reset, power eclipse detection, I/O requirements,
- Requirements of the target device with microcontroller, selection of suitable hardware, division of tasks between analogue circuits, programmable logic and microcontroller,
- 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.
- Making a printed circuit board of a PIC or ARM microcontroller,
- Practical soldering of PIC or ARM microcontroller components,
- Reviving and testing microcontroller circuits with test programs,
- Correcting soldering errors, replacing incorrectly installed and damaged components.
- Installation of the bus and other compilers in Windows, Linux and MAC-OS environments,
- Installation of the FLASH programmer or ISP software in Windows, Linux and MAC-OS environments,
- Basic programming of microcontroller support,
- Basic programming of I/O units, simple I/O, UART, timer, SPI, A/D converter,
- Basic programming of the LCD module, command input from a simple keypad.
- Choosing a topic,
- Designing a microcontroller device,
- Basic programme planning,
- Practical microcontroller programming,
- Correcting errors in the software,
- 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.
Competences (vocationally specific):
- 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.
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.
(eng.) The literature is available only in Slovenian language
Studies on which the course is based
- 0 year - cycle - Extracurricular activities