AT90PWM2B-16SE ATMEL [ATMEL Corporation], AT90PWM2B-16SE Datasheet - Page 59

no-image

AT90PWM2B-16SE

Manufacturer Part Number
AT90PWM2B-16SE
Description
8-bit Microcontroller with 8K Bytes In-System Programmable Flash
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
10.1.1
10.1.2
4317J–AVR–08/10
Moving Interrupts Between Application and Boot Space
MCU Control Register – MCUCR
When the BOOTRST Fuse is programmed, the Boot section size set to 2K bytes and the IVSEL
bit in the MCUCR Register is set before any interrupts are enabled, the most typical and general
program setup for the Reset and Interrupt Vector Addresses in AT90PWM2/2B/3/3B is:
The MCU 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 264
tables, a special write procedure must be followed to change the IVSEL bit:
Bit
Read/Write
Initial Value
;
.org 0xC00
0xC00
0xC01
0xC02
0xC03
0xC04
0xC05
Address Labels Code
;
.org 0xC00
0xC00
0xC01
0xC02
...
0xC1F
;
0xC20
0xC21
0xC22
0xC23
0xC24
0xC25
1. Write the Interrupt Vector Change Enable (IVCE) bit to one.
2. Within four cycles, write the desired value to IVSEL while writing a zero to IVCE.
RESET: ldi
RESET: ldi
SPIPS
R/W
7
0
out
ldi
out
sei
<instr>
rjmp
rjmp
rjmp
...
rjmp
out
ldi
out
sei
<instr>
R
6
0
r16,high(RAMEND); Main program start
SPH,r16
r16,low(RAMEND)
SPL,r16
RESET
PSC2_CAPT
PSC2_EC
...
SPM_RDY
r16,high(RAMEND); Main program start
SPH,r16
r16,low(RAMEND)
SPL,r16
xxx
xxx
for details. To avoid unintentional changes of Interrupt Vector
R
5
0
PUD
R/W
4
0
; Set Stack Pointer to top of RAM
; Enable interrupts
Comments
; Reset handler
; PSC2 Capture event Handler
; PSC2 End Cycle Handler
;
; Store Program Memory Ready Handler
; Set Stack Pointer to top of RAM
; Enable interrupts
“Boot Loader Support – Read-While-Write
R
3
0
AT90PWM2/3/2B/3B
R
2
0
IVSEL
R/W
1
0
IVCE
R/W
0
0
MCUCR
59

Related parts for AT90PWM2B-16SE