Hello,
I'm having a problem with LPC1114JBD48/333.
My project is in progress and I need to solve the consumption problem. In the datasheet it says that the consumption would be below 1mA to 4MHz but it is consuming 3.5mA. This is not acceptable.
Below is my code:
/* set_pll mode options */
#define CPU_FREQ_EQU 0
#define CPU_FREQ_LTE 1
#define CPU_FREQ_GTE 2
#define CPU_FREQ_APPROX 3
/* set_pll result0 options */
#define PLL_CMD_SUCCESS 0
#define PLL_INVALID_FREQ 1
#define PLL_INVALID_MODE 2
#define PLL_FREQ_NOT_FOUND 3
#define PLL_NOT_LOCKED 4
/* set_power mode options */
#define PWR_DEFAULT 0
#define PWR_CPU_PERFORMANCE 1
#define PWR_EFFICIENCY 2
#define PWR_LOW_CURRENT 3
/* set_power result0 options */
#define PWR_CMD_SUCCESS 0
#define PWR_INVALID_FREQ 1
#define PWR_INVALID_MODE 2
typedef struct _PWRD {
void (*set_pll)(unsigned int cmd[], unsigned int resp[]);
void (*set_power)(unsigned int cmd[], unsigned int resp[]);
} PWRD;
typedef struct _ROM {
const PWRD * pWRD;
} ROM;
ROM ** rom = (ROM **) (0x1FFF1FF8 + 3 * sizeof(ROM**));
unsigned int command[4], result[2];
int main (void) {
Delay_Ms(1000);
SystemCoreClockUpdate();
LPC_SYSCON->SYSAHBCLKCTRL = 0x1F;
command[0] = 4000;
command[1] = 4000;
command[2] = CPU_FREQ_EQU;
command[3] = 0;
(*rom)->pWRD->set_pll(command, result);
command[0] = 4;
command[1] = PWR_EFFICIENCY;
command[2] = 4;
(*rom)->pWRD->set_power(command, result);
while (1) /* Loop forever */
{
}
}
it's causes Hard Fault Handler.
There's something wrong?
Have a Nice Day!!!