Content originally posted in LPCWare by cararra on Fri Jul 05 00:48:10 MST 2013
Quote: cararra
Thank you, that was 100% accurate.
I was searching the practically useless CMSIS files for the information
which is why I could not make head way.
Here is what it should have contained reading up the ARM Cortex M3 reference manual:
typedef struct { /*!< (@ 0xE000ED00) SCB registers structure */
__I uint32_t CPUID; /*!< (@ 0xE000ED00) CPUID register read only */
__IO uint32_t ICSR; /*!< (@ 0xE000ED04) Interrupt Control State Register */
__IO uint32_t VTOR; /*!< (@ 0xE000ED08) Vector Table Offset Register */
__IO uint32_t AIRCR; /*!< (@ 0xE000ED0C) Application Interrupt and Reset Control Register */
__IO uint32_t SCR; /*!< (@ 0xE000ED10) System Control Register */
__IO uint32_t CCR; /*!< (@ 0xE000ED14) Configuration and Control Register */
__IO uint32_t SHPR1; /*!< (@ 0xE000ED18) System Handler Priority Register 1 */
__IO uint32_t SHPR2; /*!< (@ 0xE000ED1C) System Handler Priority Register 2 */
__IO uint32_t SHPR3; /*!< (@ 0xE000ED20) System Handler Priority Register 3 */
__IO uint32_t SHCSR; /*!< (@ 0xE000ED24) System Handler Control and State Registser */
__IO uint32_t CFSR; /*!< (@ 0xE000ED28) Configurable Fault Status Register */
__IO uint32_t HFSR; /*!< (@ 0xE000ED2C) Hard Fault Status Register */
__IO uint32_t DFSR; /*!< (@ 0xE000ED30) Debug Fault Status Register */
__IO uint32_t MMFAR; /*!< (@ 0xE000ED34) MemManage Fault Address Register */
__IO uint32_t BFAR; /*!< (@ 0xE000ED38) Bus Fault Address Register */
__IO uint32_t AFSR; /*!< (@ 0xE000ED3C) Auxiliary Fault Status Register */
__I uint32_t RESERVED0[0x40]; /*!< (@ 0xE000ED40) reserved for CPUID registers */
__I uint32_t RESERVED1[0x02]; /*!< (@ 0xE000ED80) reserved */
__IO uint32_t CPACR; /*!< (@ 0xE000ED88) CoProcessor Access Control Register */
__I uint32_t RESERVED2[0x01]; /*!< (@ 0xE000ED8C) reserved */
} LPC_SCB_Type;
#define LPC_SCB_BASE (0xE000ED00)
#define LPC_SCB ((LPC_SCB_Type *) LPC_SCB_BASE)
Using above, entering the command
LPC_SCB->SCR = 0x02;
Will put the device to sleep.
I tried different modes of sleep. The deep sleep gives me 7.5mA at 2MHz and 5mA
when its in deep sleep. This is way off the mark.
I am reading the manual as best as I can, but I am lost as to why the unit still
drains nearly 5mA when its supposed to be in deep sleep.
The power chip drains 0.5mA and it has been subtracted already.
This is purely the CPU drain on a prototyping board without any additional loading.
Any ideas anyone what else I must do to get power drain into the <1mA region for an LPC1315?
The reason why the CPU drains 5mA despite being in deep sleep mode is that the GPIO pins, even if nothing connected must be turned into inputs.
:mad::mad::mad:
Totally useless feature this deep sleep I thought at first.
Then it turns out the GPIO pins have weak pull ups and pull downs that can be programmed. Then if I connect the CPU to FET inputs, I can control the state of the FET by programming in the weak pull up or pull down despite the IO port being an input!!!!
The circuit diagram of the GPIO pins is in page 32 LPC1315/16/17/45/46/47
summary data sheet. It works as well.:p