beautypg.com

4 register description, 1 mcucr - mcu control register, Atmega128rfa1 – Rainbow Electronics ATmega128RFA1 User Manual

Page 216

background image

216



8266A-MCU Wireless-12/09

ATmega128RFA1

0xF073

out SPH,r16

;Set Stack Pointer to top of RAM

0xF074

ldi r16,low(RAMEND)

0xF075

out SPL,r16

0xF076

sei

;Enable interrupts

0xFO77

xxx

15.3 Moving Interrupts Between Application and Boot Section

The MCU Control Register controls the placement of the Interrupt Vector table, see
Code Example below. For more details, see

"Reset and Interrupt Handling" on page 15

.

Assembly Code Example

Move_interrupts:

; Get MCUCR

in r16, MCUCR

mov r17, r16

; Enable change of Interrupt Vectors

ori r16, (1<

out MCUCR, r16

; Move interrupts to Boot Flash section

ori r16, (1<

out MCUCR, r17

ret

C Code Example

void Move_interrupts(void)

{

uchar temp;

/* Get MCUCR */

temp = MCUCR;

/* Enable change of Interrupt Vectors */

MCUCR = temp|(1<

/* Move interrupts to Boot Flash section */

MCUCR = temp|(1<

}

15.4 Register Description

15.4.1 MCUCR – MCU Control Register

Bit

7

6

5

4

3

2

1

0

$35 ($55)

JTD

Res1

Res0

PUD

Res1

Res0

IVSEL

IVCE

MCUCR

Read/Write

RW

R

R

RW

R

R

RW

RW

Initial Value

0

0

0

0

0

0

0

0

The MCU Control Register contains control bits for general Microcontroller Unit
functions.

Bit 7 – JTD - JTAG Interface Disable