Arm Vardhan
Arm Vardhan
UNIT 2
2) Mention the data conversion operations available in ARM Cortex M4 for signed and
unsigned extensions. (8)
The 16-bit form of the instructions can only access low registers (RO to
R7).
The 32-bit form of these instructions can access high registers, and
optionally rotate the input data before the signed extension operations
These instructions are useful for converting between different data types.
These instructions are usually used for converting data between little
endian and big endian. The 16-bit form of these instructions can only
access low registers (RO to R7).
REV reverses the byte order in a data word, and REVH reverses the byte
order
REV R1, RO
REVH R2, RO
REVSH R1, RD
UNIT3
Discuss the low power features of ARM Cortex M4 (10 – 12) Or Discuss in detail the
operation of sleep mode in ARM Cortex M4
1. Sleep modes
What exactly happens during sleep modes depends on the chip design.
In most cases some of the clock signals can be stopped to reduce the
power consumption However, the chip can also be designed such that
part of it shuts down to further reduce power.
The SLEEPDEEP bit (bit 2) can be set to enable the Deep Sleep mode.
This register can also be used to control other lower power features like
Sleep-On-Exit and SEV-On- Pend.
The processor provides two instructions for entering sleep modes: WFI
and WFE
Both WFI sleep and WFE sleep can be woken up by interrupt requests
(depending on the priority of the interrupt, current priority level, and
interrupt mask settings)
4. Wake-up conditions
1. Before entering sleep mode, the PRIMASK is set, the clock source
switched to crystal clock, and then the PLL is turned off.
2. The microcontroller enters sleep mode with the PLL turned off to save
power
3. An interrupt request arrives, wakes up the microcontroller, and
resumes pro- gram execution from the point after the WFI instruction.
4. The software code re-enables the PLL and then switches back to using
the PLL clock, then clears the PRIMASK and services the interrupt
request.
5 Sleep-on-Exit feature
During Deep Sleep, when all the clock signals to the processor are
stopped, the NVIC cannot detect incoming interrupt requests. In order to
allow the microcontroller to be woken up by interrupt requests even
when clock signals are unavailable, a feature called the Wake-up Interrupt
Controller (WIC) was introduced in the Cortex- M3 revision 12p0.
UNIT4
Elaborate the four types of fault handlers that are available in ARM Cortex M4. (8-10)
By default the configurable fault exceptions are disabled. You can enable
these exceptions by writing to System Handler Control and State Register
(SCB->SHCSR). Be careful not to change the current status of system
exception active status, since this can cause a fault exception.
1. MemManage fault
The default name for MemManage Fault exception handler (as defined in CMSIS-
Core) is:
2 Bus fault
The default name for the Bus Fault exception handler (as defined in
CMSIS-Core) is:
void BusFault_Handler(void);
3 Usage fault
The default name for the Usage Fault exception handler (as defined in CMSIS-
Core) is:
vold UsageFault_Handler(void):
There is no need to enable the HardFault handler. This is always enabled and has
a fixed exception priority of -1. The default name for the Hard Fault exception
handler (as defined in CMSIS-Core) is:
void HardFault_Handler(void):