LPC55x clocks & timer configuration

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC55x clocks & timer configuration

424 Views
steffen_norbert
Contributor II

Hi there,
I am starting a project on LPC55S69 and got stuck with very basic things.
I hope to get some help, in order to be able to carry on:

Iam using MCUXpresso IDE and the SDK for the mentioned board.
I started with:
lpcxpresso55s69_ctimer_match_example
bcause there is no example about a free running timer, which is what I need.
It was easy to get rid of the "match stuff" from the example and to read the
free running counter with:
CTIMER_GetTimerCountValue(CTIMER); // where CTIMER is e.g. CTIMER2 or 4
However I need microseconds and milliseconds and the clock attached in the
example is 12 Mhz.

Therefore I tried to replace the 12 MHz clock with a 1 MHz clock:
CLOCK_AttachClk(kFRO1M_to_CTIMER4);  // when CTIMER was defined as CTIMER4
This gave the following error, when executing the above statement:
"15: Target error from Register access
Wire ACK Fault in DAP access"

BTW: when using:
kOSC32K_to_CTIMER4
it did work as expected (with 32 768 Hz).
 What was the mistake?
 And could some one give me a hint how to configure a prescaler (or two) to get down to
 1 Mhz and 1 Khz.
 
 Thank you in andvance for your help
 Steffen

Labels (1)
0 Kudos
3 Replies

237 Views
steffen_norbert
Contributor II

I found the solution, meanwhile:

Although the 1 Mhz clock is routed to some "consumers" (e.g. wdt), it is disabled by default. Therefore I had to:

open the clocks view and

1. configure the clock input of ctimer 3 & 4 to the 1 Mhz clock

2. enable the 1 Mhz clock

3. update code

and return to development view

0 Kudos

237 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Steffen,

Thanks for your sharing.

0 Kudos

237 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Steffen Norbert ,

Could you please send your project to me, I will test it on my side.

0 Kudos