Usually I do *not* use floating point numbers in my projects. For this, I select ‘None’ during the project creation in CodeWarrior for MCU:
But what if I need to change my mind later? How to change such a ‘no-floating-point-needed’ project to one with floating point format support?
I’m working now on a lecture robot project using my Freedom Board. And for this I need a wireless communication. I already have IEEE802.15.4 (SMAC) working, but I wanted to add Bluetooth as a low-cost option. I have found an inexpensive Bluetooth module which is available for only around $4-8 which we use in another university class project. The module is an AT command module: that means the microcontroller communicates with AT serial commands with the module, and the Bluetooth stack itself runs on the module. In a minimal configuration I only need 3.3V, GND, TX and RX plus a CMD (Command) pin:
I’m working with the I2C bus recently a lot. I’m using it in a project to reverse-engineering skimming (credit card fraud) devices. I needed to improve one of my applications for the lecture classes where a MCF52259 is communicating with a TWR-LCD display over I2C. And I want to add RTC (Real-Time-Clock) capabilities to my Arduino Data Logger Shield which requires I2C.
The same time I want to have things working with ARM Cortex-M4 and M0+ devices. And here the challenge started: using the I2C_LDD (Logical Device Driver) Processor Expert components for the ARM Kinetis devices is definitely not simple and easy. I want to use my software compatible for both the ARM cores and say for S08 and ColdFire cores. So what I ended up is to write a ‘generic’ I2C driver on top of the low level Processor Expert components: named GenericI2C.
It has been a while I presented that universal USB CDC component in this blog. The component has received a larger re-architecture, I wanted to support more than just USB CDC. For this, the CDC part is now present in a separate sub-component:
Many compilers offer a way to allocate a variable at an absolute address. For example for the Freescale S08 compiler, I can place my variable at a given address:
unsigned char buf@0x2000;
This is very useful (and needed) e.g. if the hardware (like USB) needs a buffer at given address. The advantage of the above (non-ANSI and thus not portable) syntax is that I can define a variable at an absolute address, without the need to allocate it in the linker.
I wanted to do something similar with gcc for Kinetis/ARM, and searched many forums on the internet. Obviously, I’m not alone with this question. The solution I have found comes close to what I use e.g. for the S08 compiler.
In this post I have found settings for Eclipse Indexer to show the state if defines correctly. Usually I have something like this in my projects:
So I define the macro
DEBUG_ME on the compiler command line. And it is cool to see that the Eclipse editor correctly grays out the code which is not enabled. But for this the Eclipse Editor view needs to know about the macro, but how does this work?
Freescale offers a free wireless SMAC stack for their ZigBee and IEEE802.15.4 transceivers as found in the MC1321x (SRB and NCB) wireless kits, or as used on the MC13201 daughter card. The ‘S’ in SMAC stands for ‘Simple’. But it is not that simple to use that stack. So that’s why I’m using it transformed into a Processor Expert components. I have received recently requests and questions about it, and finally it is available on this site. If you are wondering for what it can be used, then read this post.
Occasionally I run into this kind of problem: I have downloaded my application, and it immediately crashes or looses the connection:
What is the problem? It is helpful to understand what happens if I press ‘debug’ in CodeWarrior or any other debugger:
Freescale S08 controllers have an internal clock generator (ICG) which allows the device to run without an external clock signal. But as devices differ, they need to be calibrated and trimmed. The microcontrollers are usually trimmed in the factory. How can I trim it myself if I need something better?