Minimal code on an AVR MCU with interrupt enabled - hard-coded interrupt table nostartfiles

Channel:
Subscribers:
539
Published on ● Video Link: https://www.youtube.com/watch?v=t1zun-na1a8



Duration: 2:19
46 views
1


Playing with interrupt with no start file compiled. This is playing low level stuff with semi-high level c code and assembly inline, and this is not the best example, but it works, and it saves 5 bytes of flash memory if it were to be done normally because the atiny13a tested has only few interrupt, and not much garbage has been generated by the default start file. More still can be done to trim some fat.

The interrupt tablet is located at first few address locations on the flash memory space. Total 9 interrupts are available in the 13a, so 18 bytes are dedicated for the interrupt table. Each lookup table is only 4 bytes wide, so nothing else but a rjmp instruction fits into that tiny amount of space. Essentially, when an interrupt has occurred, the MCU first jumps to the interrupt location, and then from here it jumps to somewhere else defined by the user.

This implies 2 things: 1, if the last interrupt and only the last is used, then it's very hard to utilize the top 16 bytes of memory, and so they are probably blanked anyway; 2, use polling interrupt when it's possible.




Other Videos By Flyandance


2024-01-02Juno FDxboot 1.32 - Universal Bootloader Test Atmega88 - Auto upload no reset button AVR MCU Atmel
2024-01-01Pre-Juno V4 - PWM controls LCD contrast - 1602 - Liquid crystal AVR MCU Advanced - 5x8
2023-12-31Juno FDxboot 1.31 - DEV 1 - Bootloader demonstration - Easy and Fun - Universal - AVR MCU Atmel demo
2023-12-29Juno FDxboot 1.3 - Auto upload no need to press reset button - Bootloader - AVR MCU Atmel
2023-12-23Juno FDxboot 1.2 - New Record: 18 kB/s Upload Speed - Atmega328p - fast Bootloader - AVR MCU Atmel
2023-12-20Juno FDxboot 1.1 - Atmega328p New Bootloader Test - 11kB/s Upload Speed AVR MCU Atmel 1Mpbs fast
2023-12-19Juno FDxboot 1.1 -- A sub-512-bytes self-programmable bootloader based on AVR109 AVR Atmel MCU
2023-12-16Ultimate test on minimal AVR code - 3 interrupts semi-manually coded jump to table -nostartfiles
2023-12-15Main-less minimal AVR code using GNU extension - Function pointer compiles into single rjmp instruct
2023-12-13Gameplay Moba
2023-12-11Minimal code on an AVR MCU with interrupt enabled - hard-coded interrupt table nostartfiles
2023-12-04Light Tower 3.0 - Macro cinematic close up view - 1 Removable nixie tube clock AVR Flyback
2023-12-01Light Tower 3.0 - Final Product - 21 neon lamps + 1 nixie tube clock + dual high voltage AVR
2023-11-29Light Tower 3
2023-11-28LT3.0 - Coding time lapse - Comment Clean up and Finalize
2023-11-27GamePlay - Mobile MOBA - Heroes Evolved
2023-11-24Light Tower 3.0 - Neon Lamp Crescent Patterns + Light weight Random number generator TM3 Nixie tube
2023-11-22PSC 2.0 - 12v fan controller + Vibration sensor as safety device
2023-11-19PSC 2.0 - Simple control - 2 buttons + 2 PWM channels + 5 LED - CD4017 Advanced AVR code
2023-11-18PSC 2.0 Demo + Advanced Application for the CD4017 counter
2023-11-15Light Tower 3.0 - display mode 0 + Precision LED blinking +Advanced AVR time management Nixie tube