PURPOSE: A method for a context switch in an ARM7 series micro controller is provided to support a multi-thread environment by being applied to the micro controller of an ARM7TDMI or a similar kind thereof. CONSTITUTION: If an interrupt is generated(S201), it is judged whether the generated interrupt is a timer interrupt(S202). If the generated interrupt is a timer interrupt, an interrupt masking bit and an interrupt pending bit are set, and a stable state is entered(S203). If a timer interrupt is generated, an FIR(Fast Interrupt Request) handler is executed, a micro controller moves a stack pointer to a timer interrupt exclusive stack(S204) and stores an access available register firstly(S205). A CPSR(Current program Status Register) register of an FIR mode is stored in a stack temporarily, and a user program mode is entered(S206). Contexts of the remaining registers capable of accessing to only a user program mode are stored(S207). The FIQ mode is returned(S208). If a register context storing job is terminated through the above stages, the stage is jumped to an OS routine(S209).
展开▼