Referring to the MSP430 microcontroller device datasheet, the current consumption in active mode (CPU on) is usually specified around 10-40% lower if the code is executed from SRAM than from flash memory. For example:

  • The MSP430F22x4 datasheet specifies the current consumption in active mode (CPU = 1MHz, Vcc = 3.3V) to be 340 uA when running code from SRAM and 390 uA when running from Flash.
  • The MSP430F543xA datasheet specifies current consumption in active mode (CPU= 1MHz, PMMCOREVx=0, Vcc = 3.0V) to be 0.17 mA when running code from SRAM and 0.29 mA when running from flash.

Therefore in an application which has very limited power source and has small routines which are executed quite often, it is useful to execute the routine from SRAM instead of flash memory to reduce the current consumption. Onwards let’s call such function executed from RAM/SRAM during run-time as “RAM function”. The basic principle is quite simple: the code needs of course to be first stored in a non-volatile memory (e.g. flash memory), however these code will then be copied into RAM during initialization to enable executing it from RAM during run-time.

The following guide shows the implementation of code example for implementing RAM function in C programming language for MSP430 microcontroller device on the IAR Embedded Workbench (IAR EWB) compiler and Code Composer Studio (CCSTUDIO), inspired by the flash write code example of MSP430F543x. The example uses the MSP430G2553 on MSP-EXP430G2 Launchpad development board as target device. The MSP430G2553 microcontroller basically has 16 KB Flash (address range 0xC000 – 0xFFFF) and 512 bytes SRAM (address range 0x200 – 0x3FF) on-chip. Although practically it is not really suitable to use the MSP430G2553 for implementing RAM functions due the small SRAM memory size, the example codes basically tries to give a proof of concept on how RAM functions which can even implement ISR (In terrupt Service Routine).

Continue Reading

Recently I was working on a small project for USB host of FTDI chips. The goal is to create a small application on a ARM Cortex-M microcontroller with USB interface which shall be the master/host of a FTDI chip. Since FTDI only delivers compiled drivers, it was quite hard to find any references this until I found the open source project libFTDI. libFTDI is based on another open source project called libusb and although per default both projects are intended for Linux operating System, there are already some ports for Windows operating system.

One of the libFTDI developer called Xiaofan posted recently his port of libFTDI for Windows. At first I was really confused how to make the libFTDI works since I tried to install libusb manually, and it took me several days to get it running. So for the sake of others, I am posting here what I did to make the libFTDI under windows.

Continue Reading

#include <stdio.h>

int main(int argc, char *argv[])
  printf("Hello, world!\n");
  return 0;

So the question might be: why “Embedded Funk”?

Embedded system is always my passion, and that’s where “Embedded” comes from. Most of things that i will write here shall also relate to the embedded systems and programming.

Although I am not a devoted listener, funk jazz is the music genre that I always enjoy listinening to. On the other hand, the word “funk” means “wireless”/”radio” in german language (I am currently living in south east Germany), and embedded wireless is something that really catches my interest at the moment.

So I hope that this blog can be useful for any reader.

The post above was the first post in my previous blog hosted on I am moving the contents to this my new personal domain and will also start writing new posts here. The main content of this blog shall be the same, mainly about embedded stuffs that I have been working in my extra free time.