USB with the TWR-K60F120M and TWR-K70F120M

If you read my posts, then you probably know: I *love* the FRDM boards! But: Freescale has only the lower-end processors available with a FRDM board (yet?). As I need something more powerful for my Raspberry Pi Camera project, I’m using Tower boards instead. This gives me an ARM Cortex-M4 with 120 MHz, Floating Point unit plus 128 KByte SRAM :-).

For that project I need USB. So this post is about using the TWR-K60F120M and TWR-K70F120M with USB connectivity, using the USB CDC device class as example. Initially I thought I can do as easily with the FRDM boards. It turned out, that things are not that easy.

Freescale TWR-K70F120M Tower Board

Freescale TWR-K70F120M Tower Board

Continue reading

Eclipse Command Line Code Generation with Processor Expert

Eclipse based IDE’s have typically one limitation: the IDE has not much scripting capabilities. Yes, I can use things like JUnit for testing, but if it comes to build and debug C/C++ applications, then support gets really rare. An exception to this is CodeWarrior for MCU which features a command line version of the IDE which can be used for test automation as I used it in one of my tutorials. What I missed so far is to have a command line interface for Processor Expert to generate code. This is now possible with CodeWarrior for MCU10.5 :-).

Continue reading

Tutorial: Using the FRDM-KL25Z as Low Power Board

The FRDM-KL25Z is a great board: inexpensive (around US$15), small form factor, has easily accessible pins, and has a low power (capable, at least) microcontroller, and comes with an embedded debugging interface. So why not using this board right away ‘as is’ for a low power battery operated device? Great idea, you think? Yes, I thought too. Only to find out that the board needs 20 mA out of the box.

The good news is: It is possible on a week-end to get this 150 times better down to 132 μA, with an RTOS running all the time :-). I invite you to join a journey with board modifications, jumpers, schematics and many multi-meter pictures ;-)….

132 micro amps

132 micro amps!

Continue reading

How to Avoid Slow Processor Expert Projects

The Eclipse IDE is in my view the best IDE in the world :-). But it is not the fastest one: All the functionality and comfort has a price, and such a Java and highly flexible IDE requires its resources. The Eclipse community is continuously addressing that concern, and for example the Eclipse Juno 4.2 IDE in CodeWarrior for MCU10.5 shows this nicely: things are much smoother compared to the Eclipse Indigo 3.7 in MCU10.4. But if you feel that you do not want to use Processor Expert because it is too slow, then I have a trick how to improve performance by a factor of 10 :-).

Continue reading

Changing Initialization Sequence in Processor Expert

Now I have implemented a watchdog with Processor Expert for my system. But what I have found out? I ended up with a looping system, and the watchdog did not fire 😦

What went wrong?

Continue reading

Overview of ARM Microcontrollers and Tools

In this semester course, students (and myself too, of course :-)) are building a Mini Sumo Robot. That robot is using the Freescale FRDM-KL25Z board with an ARM Cortex-M0+ on it. Today I’ll give an introduction to the ARM core to the class, and timing is right: this morning I have found an excellent overview about ARM microcontroller and tools written by Jay Carlson.: Getting Started with ARM Microcontrollers.

Continue reading

New CodeWarrior for MCU10.5

On Friday, Freescale has updated CodeWarrior for MCU10 from V10.4 to V10.5, available on http://www.freescale.com/cwmcu10. I have not had much time to use it over the week-end, but here is a list of the things which in my view will make me switch my projects over to 10.5 and use it in my university classes:

  • Smaller: smaller setup and less disk space
  • Faster: faster debugging and flashing
  • Features: Eclipse Juno, detachable editor views, ‘unlimited’ breakpoints, simplified debugger attach/connect/download, and more.

Continue reading

Optimized FreeRTOS: Stack Check and SysTick for ARM Cortex Cores

The ARM Cortex specification includes the ‘SysTick’ (System Tick Timer): a dedicated system timer which is intended to be used as time base for an RTOS. While technically it would be possible to use any periodic interrupt timer, I’m using as well the SysTick for my FreeRTOS ARM ports. And because Processor Expert includes a nice timer interface, I’m using the TimerUnit_LDD:

TimerUnit LDD for SysTick

TimerUnit LDD for SysTick

While this is great for flexibility, it has its price in efficiency. That TimerUnit_LDD adds overhead. So I want to get rid of the TimerUnit_LDD and use a more efficient way.

Continue reading

USB for the Freescale ARM Kinetis KL46Z and K21D50M

As I was so pleased with the FRDM-KL46Z board, that I have ordered the Tower version of it, the TWR-KL46Z48M:

FRDM-KL46Z with TWR-KL46Z48M

FRDM-KL46Z with TWR-KL46Z48M

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.

Continue reading

Tutorial: FreeMASTER Visualization and Run-Time Debugging

“A picture says more than 1000 words.”

I don’t know the source of that quote, but for sure it is true for every developer and engineer too. Engineers need to work a lot with numbers. But numbers can be transformed into pictures and graphs which can make complex things and relationships easier to understand. Verifying proper functionality of a PID closed loop controller or watching sensor values with a nice plot is definitely something very useful. Would it not be great to watch sensor data changing over time in a chart like the one below?

Accelerometer Graph

Accelerometer Graph

One way is to export data and then show it e.g. in Excel (which has been great chart functions). But even better, if this could be done directly with data provided from the target board? If you think this is hard to do, then I can show you how this can be done in a few steps with the help of a very nice tool: FreeMASTER 🙂

Continue reading