9 years, 2 months ago.

modifications to mbed-src

Paul

Can you list the changes you needed to make to get the KL25Z to run from a 32.768kHz crystal. I want to build a device using the KL14 (no USB) with RTC so want to have just the low frequency crystal. My concern is that mbed-src keeps getting updated so I would like to fold your changes into the latest version.

Thanks, Tom

1 Answer

9 years, 2 months ago.

Tom, only two files to change, and yes it is a pain if you update the SRC, I find I have to add them back quit often.

/media/uploads/star297/system_mkl25z4.c

/media/uploads/star297/peripheralpins.c

Clock set up 3 has been added to the system file and you will see the commented changes in the RTC section in peripheralpins, only a couple of lines there.

Paul

Thanks. It seems easy enough. I wonder if I can reduce the system clock by a factor of 2 or 4 to reduce current without breaking anything else. Also, I will need to change some of the CMSIS stuff because I plan to use a 64k device. Can you suggest a 32.768kHz crystal to match the input requirements of the device?

I guess a good idea would be to allow the user to tag a file as locked so that it does not get updated.

Tom

posted by Tom Russell 10 Feb 2015

Almost any crystal will do, if you want a more stable RTC then get a better quality one. Two 12pF load capacitors will be required unless you enable the MCU built in capacitors.

In general with the KLxx series, it is more energy efficient to run the MCU at full speed when needed around 8mA, then go into deep sleep mode when you can @ 3.5uA. I use Eriks WakeUp library all the time, depending on the application I can get 12 weeks running with a 1000mA 3.6v lithium Ion cell. Best to use a LDO 3.3v regulator rather than the MCU regulator (if it has one). One issue at the moment is analog function if you use it will draw 100uA both in wake and deep sleep unless you work a way to shut it off when not used.

https://developer.mbed.org/users/Sissors/code/WakeUp/

edit....

Erik Olieman has kindly modified the ADC and WakeUp API's and now this extra leakage has been removed. Good result :)

posted by Paul Staron 11 Feb 2015