4.2 Interfaces
The interfaces available for the host communication may differ
between end applications. While the example bootloader is utilizing a basic
configuration of the USART peripheral to receive the application code, this
can easily be updated as needed, by replacing the three UART functions in
boot.c
:- ‘
static void init_uart(void)
’ - ‘
static uint8_t uart_receive(void)
’ - ‘
static void uart_send(uint8_t byte)
’
The available peripheral interrupts can be used in the bootloader code by relocating the interrupt vector table to the start of boot section. This is done by enabling the IVSEL bit in the CPUINT.CTRLA register. For more information, see AN1982 - Interrupt System in tinyAVR 0- and 1-series, and megaAVR 0-series.
A bootloader code example using the TWI peripheral in Slave mode is
also available. It it located in a .zip
file related to
this application note.