热度 12
2013-10-30 18:02
1430 次阅读|
0 个评论
I get a lot of email, and the most common question is " How can I become an embedded developer? " Alas, that's tough to answer. I learned about it the same way we learn about the birds and the bees: talk to your friends, run a few experiments, and iterate. Efficient? Probably not. Reading about the subject is critical (uh, about embedded, that is). There are a lot of great books available. A new one by Rob Oshana and Mark Kraeling (Software Engineering for Embedded Systems) is highly recommended. But experimenting is just as important. In the old days it was costly to get the tools, but that has changed a lot. Some IDE companies make limited versions of their tools available. IAR, for instance, has a size-limited free version of their Embedded Workbench that is excellent. It's amazing how many low-cost evaluation boards have come out in the past few years. One of my favourites is the relatively-new FRDM-KL25Z from Freescale, which is populated with two of their Kinetis ARM-based microcontrollers. One manages the USB interface and acts like an uninteresting component. The other, a Cortex M0+, is a full-blown 32 bit MCU with 12k KB of flash and 16 KB of RAM that you can program to learn about ARMs and embedded engineering. I have a couple of these and find them useful for all sorts of experiments. The best part? The board costs just $12.95 and is available from distributors like Digikey. Thirteen bucks to get a development system is amazing. When I got started in this business a development system was an Intel MDS with a floppy disc drive. We paid $20k then, which an inflation calculator says is $105k in today's dollars. Gas was $0.30/gallon in those solid-dollar days; it wasn't uncommon to stock up the VW with just a quarter's worth. Geezing aside, Freescale has done a great job of building a line of Cortex M-series MCUs in their Kinetis line. The naming conventions are a bit confusing as all start with a "K", and one of the lines is called the "K series", but the part on the FRDM board ( Figure 1, below ) is a KL25Z128 (from the "L" series), a 2 buck part (in hundreds) which has gobs of peripherals, including a 16 bit SAR ADC and 12 bit DAC. A comparator is driven by a six-bit DAC, which suggests some intriguing applications. A capacitive touch sensor is included as well. Figure 1: The KL25Z128 MCU. The FRDM board is sparse; it doesn't take much to support the MCU. No headers are included, so to use the I/O you'll have to add them or solder directly to the board. Add headers, and the board is compatible with Arduino shields. The MCU's capacitive sensor is brought to a touch slider making it easy to experiment with this newish interface. I particularly like the board's accelerometer, though haven't actually used it for anything worthwhile. But it sure is cool to play with.( Figure 2, below ) Figure 2: The FRDM board driving a Logicport logic analyser. One of the nicest features of the FRDM board is not something you'll find on the PCB. It is supported by the mbed folks , a site that contains lots of example code, drivers, and a completely free web-hosted compiler. It's an odd thing: there's no IDE installation. Just write code in the window, press "compile", and an executable binary downloads to the FRDM board ( Figure 3 below ). Your embedded program starts running after pressing the reset button. This means debugging is crude, but for small prototypes and experiments your code is up and running from flash in a flash. I've never encountered a development environment so easy since Dartmouth Basic. Figure 3: Accelerometer program. The code shown in Figure 3 is shamelessly lifted from the mbed site and is a complete program to read the board's accelerometer and change LED colours based on the data. The important thing to note is that the LEDs are being PWMed and there's practically no code involved. The mbed libraries do all of the work once the code associates the LEDs with pins. One is left with making an application work, rather than figuring out how to set up dozens of control registers. There's a huge variety of Cortex M-series MCUs available from a lot of different vendors. The FRDM board makes it simple to dive into this expanding and important world. What do you think? What eval boards do you like?