FRDM-KE02Z40M

This Freedom board is based on the KE02Z64VQH4 which is a 40MHz device from the 5V robust KE family with Cortex-M0+ core. This KE02 device has 64k Flash and 4k SRAM and is in a 64 pin QFP package, whereby the KE02 is also available in 44 and 32 pin LQFP and its memory ranges from 16k .. 64k Flash and 2k .. 4k SRAM. There is a 10MHz crystal on the board for clocking the part.

Full details and documentation for this board can be obtained from the Freescale web site: FRDM-KE02Z40M

To configure the µTasker project for this board simply enable the define FRDM_KE02Z40M in the project's config.h file. The compiler needs to be set to build for Cortex m0+ (and not Cortex M4) and the linker script KE_64_4.ld should be selected [KE_64_4_BM.ld for downloadable version] {the linker script extension may vary for different compilers, whereby *.ld is valid for GCC}

FRDM-KE02Z40M Binaries

Here are some binary files that can be loaded to the board. These were built using the µTasker applications (serial loader and V1.4 application) and can be simply generated using the supported compilers/IDEs [these were built using GCC], built using different configuration options or modified to suit specific requirements or hardware derived from this board :

  • uTaskerSerialBoot_FRDM-KE02Z40M_KBOOT_UART.bin KBOOT compatible UART loader [6.8k] allowing applications to be loaded at link address 0x8000. When operating, the green LED blinks at 5Hz. To force the loader reset the board with header J9-15 connected to GND. To disable the watchdog reset the board with header J9-13 connected to GND. This can be loaded using the FRDM-KE02Z's USB-MSD boot loader. Note that the loader limits application sizes to 22k - it can be built without limits using the µTasker project.
  • uTaskerV1.4.8_BM_FRDM_KE02Z40M_8000.bin KE02 application with command-line menu on the virtual COM connection and accelerometer operation (activate output in I2C menu). Low power modes can be set in the application menu and the processor runs at 40MHz [21k]. Linked to 0x8000, it can be loaded using the KBOOT PC tool. When the application is running the green LED blinks at 2.5Hz. The application also allows EEPROM operation as details in KE02 EEPROM Interface
  • uTaskerV1.4.8_FRDM_KE02Z40M.bin The same KE02 application as stand-alone software that can be loaded using the FRDM-KE02Z's USB-MSD boot loader [22k].

Software Based RTC (Real Time Clock)

The KE devices do have a simple RTC but this is no reason to not use a powerful clock functionality in an application that stays powered, even if resets are encountered during use. This application includes a software based RTC with Gregorian calendar (handling day of week, and leap years, etc.) and alarm function which keeps time based on a software timer that runs whenever the processor is in any mode or low power state that is still responding to the software's periodic tick. The second's value is maintained in a RAM area that is not otherwise initialised and so is maintained through software resets and even short power dips.

This functionality is enabled in the µTasker project framework by enabling the define SUPPORT_SW_RTC.

When the board is powered up for the first time it will show a date of 1.1.1970 (start of Unix epoch) and count from there. Using the time interface in the Administrator menu on the OpenSDA serial interface (115'200 Baud) the date and time can be set and then displayed. In the same interface an alarm can be programmed and there is a message when the alarm times out.

This is a session showing the date and time being set and then programming alarms, showing its versatility.

   Admin. menu
===================
up               go to main menu
show_config      Show configuration
save             Save configuration to FLASH
reject           Reset non-saved changes
restore          Restore factory settings
show_time        Display date/time
set_time         Set time hh:mm:ss
set_date         Set Date dd:mm:yyyy
show_alarm       Display alarm d/t
set_alarm        Set alarm (date)(+)[time]
del_alarm        Delete alarm
show_lp          Show low power mode and options
set_lp           [option] Set low power mode
reset            Reset device
last_rst         Reset cause
help             Display menu specific help
quit             Leave command mode  

show_time
1:01:1970 00:00:16                      [Note that there is initially no valid date/time set]

#set_date 2:2:2015
New date set
2:02:2015 00:00:34

#set_time 09:35:30
New time set
2:02:2015 09:35:30                      [Both date and time have now been entered]

#show_time
2:02:2015 09:35:35

show_time
2:02:2015 09:35:38                      [Note that the time increments]

#set_alarm +2                           [Alarm set for 2 seconds in the future (+3:45 would be 3 minutes, 45 seconds in the future, etc.]
New alarm set
2:02:2015 09:35:47

#RTC Alarm fired                        [Message when the alarm fired]

set_alarm 9:36:10                       [In this case the alarm is set for an absolute time in the present day -
                                         it can also be set for a day/time with 3:2:15 9:35:45, for example]
New alarm set
2:02:2015 09:36:10

#show_time
2:02:2015 09:36:02

#RTC Alarm fired                        [The absolute alarm fires]
show_time
2:02:2015 09:36:11
         

The application interface is equivalent to the µTasker RTC interface when working with a real RTC and includes, in addition to the user functions at the menu interface, configurable alarm call-backs every second, every minute, every hour or every day, plus a stop-watch alarm, as well as conversions between local time and UTC.

uTaskerV1.4.8_FRDM-KE04Z40M_SW-RTC_with_alarm.bin Stand-alone software that can be loaded using the FRDM-KE02Z40M's USB-MSD boot loader [24.6k].

ADC Sampling and LED color control using PWM based on Accelerometer Readings

This application has been configured with PWM support (SUPPORT_TIMER and SUPPORT_PWM_MODULE) with three PWM outputs connected to the three LEDs in the RGB LED (PWM_LED_CONTROL), which, together with the I2C based accelerometer operation, controls the intensity of the three LED colors in the RGB LED so that the LED's overall color depends on the orientation of the board.

ADC operation is enabled (SUPPORT_ADC) and with TEST_ADC enabled in ADC_Timers.h demonstrates regular sampling of the thermistor's positive terminal voltage, which is then displayed on the UART debug interface (115'200 Baud).

Since the LED is used by PWM outputs, the normal blinking green LED operation is not present.

uTaskerV1.4.011_FRDM-KE02Z40M_ADC_PWM_ACC.bin Stand-alone software that can be loaded using the FRDM-KE02Z40M's USB-MSD boot loader [25.9k].


Return to the Kinetis landing page


µTasker Kinetis support for FRDM-KE02Z40M. Copyright (c) 2004..2016 M.J.Butcher Consulting