What I missed so far was USB support for the KL46Z. So time to have a quick look at board(s) and to add USB support for it.
The TWR-KL46Z48M has the same processor on it as the FRDM-KL46Z, and includes the OpenSDA debug interface. It features the same MMA8451Q accelerometer, but no MAG3110 magnetometer :-(. Instead, it has infrared transmitter and receiver.
It features a larger (more segments) LCD connected to one of the connectors on the board:
In above picture, the red USB cable is used to debug, while the black (micro-B) connector is used for the KL46Z USB.
While the micro-B connector are used more and more, I’m not happy about it as to me they do not provide better value. It just happens to me that I always have the wrong cable with me
As a small detail: the push button SW4 is misplaced and conflicts with the LCD. Does not affect functionality, but hopefully a redesign of the board/footprint fixes this:
The TWR-KL46Z48M is a very flexible and great board. Although I think the $149 are somewhat prohibitive compared to the price and features of the FRDM-KL46Z (around $15).
Another board supported boards is the TWR-K21D50M:
Sold for $99 it comes with an ARM Cortex M4 (instead of M0+ in the KL46). The K21DN512 has 64 KByte RAM and 512 KByte FLASH, and runs up to 50 MHz. The board is using this time two micro-B connectors. At least Freescale ships the cable in the box.
It is using the slower OSJTAG as debug interface, and unfortunately the SD card socket is not populated:
The added leg-room with the 64 KByte SRAM and the power of the ARM Cortex-M4 makes this board very attractive. I still wish that CPU would be on a Freedom board *with* an SD card socket for a reasonable $20 price point.
USB for KL46Z and K21
But the topic of this post is not really a board review: it is about USB :-).
I have found that the KL46Z USB seems to be very compatible with the KL25Z one. So it would be possible to use my FSL_USB_Stack Processor Expert component with a KL25Z setting for the KL46Z. Because this can be confusing, I have added a dedicated entry for KL46Z. And there is an entry for the K21D50 too:
This is supported for following USB device classes:
More classes will be added over time.
As clock setup is not trivial (but outlined in the links of above tutorials with the supported device classes), I have committed on GitHub CodeWarrior MCU10.4 examples for each:
The whole GitHub repository can be downloaded here with the ‘Download ZIP’ button:
How to install the Processor Expert components is described in “Processor Expert Component *.PEupd Files on GitHub”.
With the KL46Z and the K21 added to the supported USB device list, I have now more choices. The price of the TWR-KL46Z50M let me belive not many of the boards will be sold: the FRDM-KL46Z provides a lot more value for 10% of the price. The K21 is an interesting ARM Cortex-M4 from Freescale as has an M4 with 64 KByte RAM and 512 KByte Flash.
Happy USB ARMing