This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.
Freescale has added a new Freedom board: the FRDM-KL46ZFRDM-KL46Z:
My opinion? The best Freedom board so far, I love it!
Highlights
The board has the same form factor as the FRDM-KL25ZFRDM-KL25Z. Freescale lists a ‘budgetary price’ of $15 for the board. Prices might depend on region and distributor, but it is in the same range as the FRDM-KL25Z.
While the Freescale page links to Mouser and DigiKey as distributors, it seems they do not have it in stock (yet?). So it might worthwile to ask your local distributor if you cannot wait .
Features with differences to the FRDM-KL25Z marked in bold:
- 48 MHz ARM Cortex-M0+
- 32 KByte SRAM
- 256 KByte FLASH
- 2 user push buttons
- Capacitive touch slider
- 4 digit 7-Segment LCD
- MMA8451QR1MMA8451QR1 accelerometer
- MMA3110 magnetometer
- Ambient Light Sensor
- Green and red user LED
- OpenSDA onboard USB debug interface
- ‘Arduino compatible’ headers (unpopulated)
So many more components like buttons, LCD, magnetometer, ambient light sensor. Instead of the RGB LED on the earlier FRDM boards, the FRDM-KL46Z has a green and red user LED.
The biggest plus is the added ‘leg room’: twice as SRAM and FLASH compared to the FRDM-KL25Z .
Ambient Light Sensor
The ambient light sensor is the same as on the FRDM-K20D50MFRDM-K20D50M. The sensor can be disconnected with cutting the trace below the nearby J8 header:
Magnetometer
The board has the Freescale MAG3110 magnetometer on it:
According to the schematics, there could be boards with an FXOS8700CQ which combines an accelerometer and a magnetometer in the same package.
LCD
The KL46Z microcontroller features a LCD interface, so the board has a small display (LUMEX LCD S401M16KR) added to show the functionality:
The LCD has 8 front planes and 4 back planes, able to display four 7-segment characters, 3 dots and one colon (:).
Jumpers
The jumpers are very similar to the other Freedom boards, and most come unpopulated:
- J6: bypass of D4 Diode (avoid voltage drop)
- J7: configurable VREGIN
- J8: isolation of ambient light sensor
- J9: power isolation of the K20 (OpenSDA)
- J12: Power isolation for VLL3
- J15: support for 5VDC
- J16: Power for USB Host mode
- J17: power isolation and measurement for the KL46Z
Software and Tools
The board has the MSD OpenSDA bootloader installed. So as with the previous Freedom boards, it needs to be replaced with the OpenSDA Debug Application. Freescale has the ‘KL46_SC’ (Sample Code Package) and the ‘FRDM-KL46Z_QSP’ (Quickstart Package) available in their download section here. The board/microcontroller is supported in CodeWarrior for MCU10.4 out of the box in the New Project Wizard:
Keil just released the µVision 4.72. I had not a chance to use the board with Keil or IAR yet, but I do not see a problem why it would not be supported. And with little changes to the linker file it works as well with a stock Eclipse version (see the series of tutorials in the same Document section).
FreeRTOS on the FRDM-KL25Z
As first project, I have FreeRTOS V7.5.0 running on the board:
Nothing spectacular: the RTOS with tasks blinking LED’s The Codewarrior project and the Processor Expert components are available in attachement of this post. Additionally I’m working on a more complex project to use the components on the board.
Summary
With twice as RAM and FLASH compared to the FRDM-KL25Z, the FRDM-KL46Z is definitely a better board than the FRDM-KL25Z in my view, especially for the same amount of money. I will check if I could use the MAG3110 on the board for my Zumo project, as it would help making relative turns. With the extra SRAM,
I’m able now to collect much longer Percepio FreeRTOS+Trace data, which is incredible helpful.
I’m working on a driver for the MAG3110 which I should be able to release soon. Until then, I work on a board support package to use all (or most) functions on the board. I have not tried to the KL46Z USB yet, so this will be something to look into soon too.
While the FRDM-KL46Z is my favorite Freedom board for now, my wish list for a next board is
- ARM Cortex M4 >100 MHz
- plenty of on-chip SRAM and FLASH (I would be very happy with >=64 KByte SRAM and >=256 KByte FLASH)
- USB device and host
- WiFi?
- micro-SD card socket
- at a price around US$30?
Then the ‘Freedom’ might take over the world . What I dream of is something below the Raspberry Pi, but for hardcore realtime with no need for Linux, as I have Linux running on the Raspy .