AnsweredAssumed Answered

Using KDS generated SetClockConfiguration()

Question asked by Neil Hancock on Oct 21, 2014
Latest reply on Dec 16, 2014 by David E Seymour

I'd like to be able to use KDS 1.1 to generate ClockConfigurations and change then using SetClockConfiguration() on a Kinetis K20D

KDS Component Inspector-CPU is very powerful - however I'm having trouble stitching it all together and getting the processor to run afterwards, so any comments on methods of using KDS appreciated


The objective is to have 3 power modes (clock configurations)

1) 48MHz clock for USB Otg - Run modem

2) Low Power Run for a simple ADC and data logging to SPI/Flash

3) Low power suspend - timer expire or USB cable plugged in to wake up, or reset - CPU exists in this state 99% of time


I'm using the FRDM-K20D50 to prototype, which has an 8Mhz Xtal and 32KHz RTC Xtal


So in KDS Component Inspector - CPU - its best to increment the "Clock Configuration" first as it offers to create a "Clock Source" settings

CCS0 Clock Config/Settings 0/0 for 48Mhz

CCS1 Clock Config/Settings 1/1 for low power run - can use  RTC/IRC Clock

CCS2 Clock Config/Settings 2/2 for lowest power state while being able to periodically wake - disable 8MHz xtal

I have RTC 32Khz Oscillator Enabled

I have System Oscillator 0 - Enabled with External crystal - 8MHz

For CCS0  MCG=PEE from System Oscillator 0, Clock Monitor Enabled 

For CCS1  MCG=BLPI from IRC-fast/divider 4 - VLP disabled

For CCS2 MCG=BLPI from IRC-fast/divider 128 - VLP enabled, entry=Auto, sysClock prescalers can be adjusted for runtime cycles v power used

Generally the transitions are going to be PwrUp/Reset--> CCS1 <-->CCS2


I would like to be able to have the UART and internal timer tick adjust automatically between CCS1 and CCS0 - but haven't investigated this yet.

thanks for any comments as to if you think this is a viable way to try KDS 1.1 or anything to watchout for when using the code.