LPC1857  Performance

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1857  Performance

1,193 Views
lpcware
NXP Employee
NXP Employee

Content originally posted in LPCWare by nesrine on Fri Feb 13 07:26:40 MST 2015
Hi,
I work with MCB1857 KEIL eval board, and i use µvision V5.13.0.0
I do the portage of the coreMark in the LPC1857 architecture;
My problem that in my project i have difficulties to decrease frequency and to manipulate flash acceleration  because it is the first one that i use NXP product,
Please find Attached my project and help me to configure my LPC in different frequency:

I think taht in the projct I should modify this function but haw i modify it in order to have differents frequency

/* Set up and initialize clocking prior to call to main */
void Board_SetupClocking(void)
{
int i;

/* Setup FLASH acceleration to target clock rate prior to clock switch */
Chip_CREG_SetFlashAcceleration(MAX_CLOCK_FREQ);

Chip_SetupCoreClock(CLKIN_CRYSTAL, MAX_CLOCK_FREQ, true);

/* Setup system base clocks and initial states. This won't enable and
   disable individual clocks, but sets up the base clock sources for
   each individual peripheral clock. */
for (i = 0; i < (sizeof(InitClkStates) / sizeof(InitClkStates[0])); i++) {
Chip_Clock_SetBaseClock(InitClkStates.clk, InitClkStates.clkin,
InitClkStates.autoblock_enab, InitClkStates.powerdn);
}

/* Reset and enable 32Khz oscillator */
LPC_CREG->CREG0 &= ~((1 << 3) | (1 << 2));
LPC_CREG->CREG0 |= (1 << 1) | (1 << 0);

/* Setup a divider E for main PLL clock switch SPIFI clock to that divider.
   Divide rate is based on CPU speed and speed of SPI FLASH part. */
#if (MAX_CLOCK_FREQ > 180000000)
Chip_Clock_SetDivider(CLK_IDIV_E, CLKIN_MAINPLL, 5);
#else
Chip_Clock_SetDivider(CLK_IDIV_E, CLKIN_MAINPLL, 4);
#endif
Chip_Clock_SetBaseClock(CLK_BASE_SPIFI, CLKIN_IDIVE, true, false);

/* LCD with HX8347-D LCD Controller                                         */
/* Attach main PLL clock to divider C with a divider of 2 */
Chip_Clock_SetDivider(CLK_IDIV_C, CLKIN_MAINPLL, 2);
}

Thank you

Labels (1)
0 Kudos
Reply
3 Replies

929 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nesrine on Mon Feb 16 07:44:25 MST 2015
it so difficulte to configure the best frequency :(
0 Kudos
Reply

929 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nesrine on Sat Feb 14 06:08:44 MST 2015
Hi
Thank you for the response
so when I need ti change other frequency i should to change parameters of  this function
Chip_SetupCoreClock(CLKIN_CRYSTAL, MAX_CLOCK_FREQ, true);
by this:
Chip_SetupCoreClock(CLKIN_CRYSTAL, 160000000, true);//160MHz
Chip_SetupCoreClock(CLKIN_CRYSTAL, 120000000, true);//120MHZ
Chip_SetupCoreClock(CLKIN_CRYSTAL, 100000000, true);//100MHZ
Chip_SetupCoreClock(CLKIN_CRYSTAL, 90000000, true);
Chip_SetupCoreClock(CLKIN_CRYSTAL, 60000000, true);
Chip_SetupCoreClock(CLKIN_CRYSTAL, 30000000, true);
Chip_SetupCoreClock(CLKIN_CRYSTAL, 12000000, true);

but for example when i put 160000000 in the parameter "core_freq",i have in the SystemCoreClock=156000000
SystemCoreClock = Chip_Clock_GetRate(CLK_MX_MXCORE);
so when i dont have the best frequency i can't have the best coremark score
Thanks,
Nesrine
0 Kudos
Reply

929 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by embd02161991 on Fri Feb 13 16:29:07 MST 2015
Hi,

To set a Core frequency other than the maximum frequency Chip_SetupCoreClock() API must be used. The declaration of the function as seen in "chip.h" is :
Chip_SetupCoreClock(CHIP_CGU_CLKIN_T clkin, uint32_t core_freq, bool setbase);

The parameter "core_freq" is the desired output frequency of the PLL1.

Thanks,
NXP Technical Support
0 Kudos
Reply