To a brand new area of coding, coding on micro-controllers.
My first work is on the family of micro-controllers released by Texas Instruments, MSP430G2231(name of the micro-controller). MSP stands for Mixed Signal Processor. It is a micro-controller with 16-bit processor having von-Neumann architecture. It is primarily designed for low power applications.
This board has a 16-bit data bus and a 16-bit address bus. It’s address space is 2^16 i.e. 64Kb of memory.
It has memory mapped IO. The board contains USB port, reset switch, push button switch, two leds, JTAG /spy-by-wire and slot for external crystal. JTAG/spy-bi-wire are for debugging purpose.
The micro-controller contains 16 registers out of which 4 are special-purpose and rest are general purpose registers. The 4 special purpose registers are Program Counter, Stack Pointer, Status Register and Constant Generators. The rest are general purpose registers named R4-R15.
Flash memory can be programmed via the Spy-bi-wire or JTAG port.
How to Program the Micro-controller?
Compile the C code or assembly code written as shown below
This compiliation produce a binary code for MSP430G2231.
To burn the code into the micro-controller
The available options in debug are
The following code will erase the existing code in the micro-controller, burns the new code and run that code.
To debug the code, we can set the break point as
0xf834 is the starting address of ‘main’.
‘step’ will get us through single step. To view a memory we can use ‘md <memory location>’.
To view the disassembled code from the binary
MSP430 family is a low price and low power micro-controller family. We can even power up the micro-controller from potato.