ATAVRSB202 Atmel, ATAVRSB202 Datasheet - Page 56

no-image

ATAVRSB202

Manufacturer Part Number
ATAVRSB202
Description
KIT BATT MGMT FOR ATMEGA32HVB
Manufacturer
Atmel
Datasheets

Specifications of ATAVRSB202

Main Purpose
*
Embedded
*
Utilized Ic / Part
*
Primary Attributes
*
Secondary Attributes
*
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
12.3
12.4
12.4.1
8042B–AVR–06/10
Moving Interrupts Between Application and Boot Space
Register Description
MCUCR – MCU Control Register
The General Interrupt Control Register controls the placement of the Interrupt Vector table.
• Bit 1 – IVSEL: Interrupt Vector Select
When the IVSEL bit is cleared (zero), the Interrupt Vectors are placed at the start of the Flash
memory. When this bit is set (one), the Interrupt Vectors are moved to the beginning of the Boot
Loader section of the Flash. The actual address of the start of the Boot Flash Section is deter-
mined by the BOOTSZ Fuses. Refer to the section
Self-Programming” on page 191
tables, a special write procedure must be followed to change the IVSEL bit:
Interrupts will automatically be disabled while this sequence is executed. Interrupts are disabled
in the cycle IVCE is set, and they remain disabled until after the instruction following the write to
Bit
0x35 (0x55)
Read/Write
Initial Value
Assembly Code Example
C Code Example
a. Write the Interrupt Vector Change Enable (IVCE) bit to one.
b. Within four cycles, write the desired value to IVSEL while writing a zero to IVCE.
Move_interrupts:
void Move_interrupts(void)
{
}
; Enable change of Interrupt Vectors
ldi r16, (1<<IVCE)
out MCUCR, r16
; Move interrupts to Boot Flash section
ldi r16, (1<<IVSEL)
out MCUCR, r16
ret
/* Enable change of Interrupt Vectors */
MCUCR = (1<<IVCE);
/* Move interrupts to Boot Flash section */
MCUCR = (1<<IVSEL);
R/W
JTD
7
0
R
6
0
for details. To avoid unintentional changes of Interrupt Vector
R
5
0
PUD
R/W
4
0
ATmega16HVB/32HVB
”Boot Loader Support – Read-While-Write
R
3
0
R
2
0
IVSEL
R/W
1
0
IVCE
R/W
0
0
MCUCR
56

Related parts for ATAVRSB202