简体   繁体   中英

MSP430 execution banks

I am new to MSP430 architecture and I am porting an RTOS which is written for ARM Cortex M3 into this architecure. In ARM Cortex architecture, there are PSP and MSP registers to hold stack values for execution modes.

As I understand from MSP430 architecture there is only just one stack pointer register (SP).

Here are my questions:

-Is there only one register bank for SP within interrupt/execution context?

-Can I use regular C functions for interrupt handling in MSP430 as in ARM Cortex?

-How does MSP430 handle (save/restore) registers during interrupt execution (specifically SP, SR and PC)?

  1. There are no banks in terms of MSP430 registers, it is the only one SP register within context. 在此处输入图片说明

  2. Yes, you can use C functions for interrupt handling link

__interrupt void MyFuncISR(void)

or it also can be like

#pragma vector=TIMER0_A0_VECTOR    
__interrupt void
ta0cc0_isr (void)

in this case compiler will set the proper interrupt vector by the define/name you provide

3. The interrupt logic executes the following: 1. Any currently executing instruction is completed. 2. The PC, which points to the next instruction, is pushed onto the stack. 3. The SR is pushed onto the stack and so on, see below: 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM