What Is Vector Table In Microcontroller Upd -
Think of the vector table as the "GPS Map" or the "Master Directory" for the CPU. It is a critical data structure that maps specific events to the exact locations in memory where the code to handle those events resides. What is a Vector Table?
| Entry (from top of memory) | What it points to | Purpose | | :--- | :--- | :--- | | | A memory address (e.g., end of RAM) | Tells the CPU where to create the stack before any code runs. Critical for function calls and local variables. | | 2. Reset Vector | The address of the first instruction of your main() function or startup code. | The CPU reads this immediately after power-up or a reset. It says, "Start executing code from here ." | | 3. NMI Vector | Address of the Non-Maskable Interrupt handler. | For highest-priority, non-disableable events (e.g., power failure warning). | | 4. Hard Fault Vector | Address of the Hard Fault handler. | Catches serious errors like accessing invalid memory. | | 5... N. Peripheral Vectors | Addresses of handlers for timers, UART, GPIO, ADC, etc. | These are the "normal" interrupts for peripherals. | what is vector table in microcontroller
The CPU is happily running your main loop, blinking an LED. Think of the vector table as the "GPS
System-level events like powering on or a processor error. | Entry (from top of memory) | What
A periodic timer used by Operating Systems (RTOS) to manage tasks. 4. Peripheral Interrupts