Fujitsu MB91460 SERIES 애플리케이션 노트 - 페이지 23
{카테고리_이름} Fujitsu MB91460 SERIES에 대한 애플리케이션 노트을 온라인으로 검색하거나 PDF를 다운로드하세요. Fujitsu MB91460 SERIES 26 페이지. 32-bit microcontroller
Fujitsu MB91460 SERIES에 대해서도 마찬가지입니다: 사용자 설명서 (45 페이지), 시작하기 (41 페이지), 애플리케이션 노트 (23 페이지), 애플리케이션 노트 (29 페이지), 애플리케이션 노트 (29 페이지)
Once the above preconditions are met then the actual relocation would be carried out in the
following steps for MB91460 Series:
1. Copy the starting address of CAN0 ISR to relocated CAN0 vector in RAM (as reserved in
preconditions
step 2 above).
2. Copy the starting address of UART0 Receive ISR to relocated UART0 Receive vector in
RAM (as reserved in preconditions
3. Store the original TBR settings.
4. Configure the TBR to the new value value.
5. Call the function which erases the sector of Main Flash.
6. Restore the original TBR value.
The below code demonstrates the actual relocation of vector table.
/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
/* ELIGIBILITY FOR ANY PURPOSES.
/*
/*---------------------------------------------------------------------------*/
unsigned int
tbr;
void
Main(void)
{
InitIrqLevels();
__set_il(7);
__EI();
PORTEN = 0x3;
. . .
CAN0_ptr = CAN0_ISR;
UART0_ptr =
__DI();
__asm(" STM0 (R7,R6) ");
__asm(" MOV TBR, R7 ");
__asm(" LDI #_tbr, R6 ");
__asm(" ST R7, @R6 ");
__asm(" LDI #32000h, R7
__asm(" MOV R7, TBR ");
__asm(" LDM0 (R7,R6) ");
__EI();
EraseSector(0x09);
__DI();
__asm(" STM0 (R6) ");
__asm(" LDI #_tbr, R6 ");
__asm(" LD @R6, R6 ");
__asm(" MOV R6, TBR ");
__asm(" LDM0 (R6) ");
__EI();
. . .
© Fujitsu Microelectronics Europe GmbH
INTERRUPTS
Chapter 3 Interrupt Recommendations and Examples
step 2 above).
(C) Fujitsu Microelectronics Europe GmbH
/* First initialize all Interrupt Levels */
/* Set global Interrupt Level to 7
/* Enable Interrupt globally
/* Enable I/O Ports */
/* Store CAN0 ISR address to relocated vector */
UART0_Rx_ISR;/* Store UART0Rx ISR address to relocated
vector */
/* Disable interrupts */
/* Store R7 & R6 */
/* Save original TBR */
");/* Configure TBR to point to vector table in */
/* RAM at the base address 0x00032000 */
/* Restore R7 & R6 */
/* enable interrupts */
/* Erase Flash sector 0x09 */
/* Disable interrupts */
/* Store R6 */
/* Load tbr address to R6 */
/* Restore original TBR value */
/* Restore R6 */
/* Enable interrupts */
- 23 -
*/
*/
*/
*/
MCU-AN-300055-E-V10