LPC54102 PLL failure

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

LPC54102 PLL failure

Jump to solution
1,393 Views
newgeneration
Contributor I

Hello,

 

I'm new to this forum, so please be kind and forgive my errors.

 

General information

My current project is the evaluation of the LPC54102 processor. Until now, there were no serious problems, but:
I want to use the internal PLL (that seems different to other PLLs in LPC MCUs) and first configured it via LPCOpen and the libpower. That worked.

But I also was instructed to get the device working without any other libraries, which results in a ban of libpower.a.

Current status

So I recreated the whole project, that now uses makefiles and a custom startupcode/linkerscript, and rewrote the basic functions.
Now comes the PLL setup: I read the User Manual of the chip carefully and programmed the SYSCON-registers related to the PLL. The PLL sets also the lock-bit, which (for me) indicates, that its working.
The code of pll.c, which contains every relevant function, is attached.

Program

My current program uses this code:

#ifdef USE_OWN_CODE
flash_set_waitstates(96000000UL);
LPC_SYSCON->PDRUNCFGSET = SYSCON_PDRUNCFG_PD_SYS_PLL;
LPC_SYSCON->SYSPLLCLKSEL = SYSCON_PLLCLKSRC_IRC;
LPC_SYSCON->PDRUNCFGCLR = SYSCON_PDRUNCFG_PD_SYS_PLL;
pll_set_frequncy(12000000UL, 8);
while(!pll_is_locked()) ; /* wait for lock */
#else
Chip_POWER_SetPLL(8, 12000000);
Chip_POWER_SetVoltage(0,96000000);
#endif
LPC_SYSCON->MAINCLKSELB = SYSCON_MAIN_B_CLKSRC_SYSPLLOUT;

Problem

This code seems to work and sets the PLL registers to (as far as I can judge it) proper values.
But as soon as I switch the main clock to the PLL output the Debugger jumps to random addresses (e.g. 0xFFFFFEF00) and the execution of the application does not go on.

I compared the register values and they match (except the two registers AHBMATPRIO and ASYNCAPHCTRL that are not set, because the program does not reach the writes to them) as far as the memory view let me see. But I know that this view does not show everything (e.g. CPSTAT register). Maybe there is a register that is missing to be set in my code.

 

Basic question

How do I set up the PLL properly without using libpower?

I would be also interested in an user/reference manual to libpower.a.

Any help is welcome.

 

Best regards,
N.G.

Original Attachment has been moved to: pll.c.zip

Labels (3)
0 Kudos
1 Solution
922 Views
jeremyzhou
NXP Employee
NXP Employee

Hi N. G.,

Thanks for your reply.

I've ran the periph_pllfract demo with my my board (LPCXpresso54102 Rev A OM13077).

As a result, the demo works well (Fig 2) without encountering the same issue as you mentioned above, and I've attached the screenshot of testing result.

So I'd like to suggest that you'd better to check the hardware of your board again.

399120935970960205.jpg

Fig 1

2017-02-24_9-41-37.jpg

Fig 2

Have a great day,
Ping

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
922 Views
jeremyzhou
NXP Employee
NXP Employee

Hi N. G.,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.

In the periph_pllfract demo, the static void setPllRate(uint32_t rate) function has provided the appropriate flow to setup PLL configuration, please refer to it for details.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
922 Views
newgeneration
Contributor I

Hello,

thanks for your reply!

Unfortunately this example does not work!? The codes doesn't even reach main().
I investigated this issue and found out:
- the device powers normally up and jumps to the reset-handler
- normal startup-behavior is done
- everything is fine until Board_SetupClocking() is called
- this function itself calls Chip_SetupIrcClocking() which sets up the PLL using the internal RC-oscillator as its source
- the failure occurs exactly at the line Chip_Clock_SetMainClockSource(SYSCON_MAINCLKSRC_PLLOUT); which indicates that even in this basic example the PLL does not work.

Thus I haven't had a look on the source code of the periph_pllfract-example.

Thank you for your help.

Best regards,
N.G.

0 Kudos
923 Views
jeremyzhou
NXP Employee
NXP Employee

Hi N. G.,

Thanks for your reply.

I've ran the periph_pllfract demo with my my board (LPCXpresso54102 Rev A OM13077).

As a result, the demo works well (Fig 2) without encountering the same issue as you mentioned above, and I've attached the screenshot of testing result.

So I'd like to suggest that you'd better to check the hardware of your board again.

399120935970960205.jpg

Fig 1

2017-02-24_9-41-37.jpg

Fig 2

Have a great day,
Ping

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos