0
885views
Explain status register of MSP430.
1 Answer
0
74views

Status register gives the status of the result of the operation performed by the ALU. For example if the carry is generated or not, etc. The figure below shows the structure of the status register of MSP430. The respective bits are explained below.

Fig: Structure of Status register

C (Carry flag): It is set to '1' whenever there is a carry out of the final bit when performing an addition operation. It also works as a borrow flag when performing subtraction.

 

Z (Zero flag): This flag is used to indicate whether the result of the ALU operation is zero or not. It is set when the result is zero, while cleared when the result is non-zero.

 

N (Negative flag): This bit indicates the sign of the result of the ALU operation. It is set if the result is negative, while is cleared if the result is positive. The programmer has to take care that this bit is referred to or used only if a signed operation is performed. In case of an unsigned operation this bit is to be ignored.

 

GIE (General Interrupt Enable): This bit is a control bit for the programmer to enable and disable the interrupts of the microcontroller. If the programmer sets this bit to '1', the interrupts are enabled, while if the bit is cleared to '0', the interrupts are disabled.

 

CPUOFF (Central Processing unit OFF): This bit when set, switches OFF the CPU and hence saves power when it is required.

 

OSCOFF (Oscillator OFF): This bit when set to '1' by the programmer, the oscillator is switched OFF and hence saves power.

 

SCG0 (System Clock Generator bit 0) & SCG1 (System Clock Generator bit 1): These bits are used to select the clock source for the operation of the microcontroller.

 

V (Overflow flag): This bit is set to '1' when the result is out of the range for signed operations. In case if the result is out of the range according to the 2's complement representation, this bit will be set to indicate the user that the result is out of range, and hence the result value is incorrect. In other words, you can say if the sum of two positive numbers gives negative result or sum of two negative numbers gives positive result, the overflow bit is set to '1'. In other cases it is cleared.

Please log in to add an answer.