a LPC54xx main clock issue.

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

a LPC54xx main clock issue.

1,013 Views
yy0824_2006
Contributor I

what i did :

 1.  i set the lpc54606 main_clk:48Mhz

pastedImage_1.png

2. I initialize a GPIO as output, then in main i did this: 

pastedImage_2.png

so i got a clk . but  the frequency is 750khz according to my oscilloscope. I think it should be 24Mhz . Why?

forgive my poor English.

thanks.

0 Kudos
2 Replies

821 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello yangyong wu ,

Yes, as Con Verse said, the function " GPIO_PortToggle" not only one instruction.

You can check the instructions on Disassembly view. For MCUXpresso IDE example, you can open it as below:

pastedImage_1.png

Hope it helps,


Have a great day,
TIC

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

821 Views
converse
Senior Contributor V

Because you are executing MANY more than a single instruction when calling the function GPIO_PortToggle. Assuming that you have set up your clock correctly, I'd calculate that you are executing approx 15 instructions to toggle the GPIO.