Tuesday, November 2, 2010

MSP430G2231

        MSP430 is a product of Texas Instruments. MSP430 has a wide range of devices and we are using MSP430G2231 (MSP430 LaunchPad development tool). It is one of the smallest MSPs with only 14 pins. It has a flash memory of 2KB and a RAM of 128B. 
        
        The MSP430 CPU has a 16-bit RISC architecture. The CPU is integrated with 16 registers that provide reduced instruction execution time. The register-to-register operation execution time is one cycle of the CPU clock. Here 4 of the registers, R0-R3, are dedicated as program counter, stack pointer, status register and constant generator respectively and the remaining registers are general-purpose registers. Peripherals are connected to the CPU using data, address and control buses and can be handled with all instructions. The instruction set consists of the original 51 instructions with three formats and seven addressing modes and each instruction can operate on word and byte data. Instruction formats and addressing mode description are given below.




        MSP430 has one address space shared with special function registers, peripherals, RAM and flash memory. Code access arealways performed oneven addresses. Data can be accessed as bytes or words.

        The flash memory can be programmed via the JTAG port. The CPU can perform single-byte and single-word writes to the flash memory. Now we can move to the programming of MSP430.

        We can connect MSP430 launch pad to PC via USB. When connecting to PC, open a terminal and type the command 'dmesg' which shows all the connections that has been established. It shows a message that USB device is connected through some port. Kernel does not support the connectivity of this device. we do have only user space support. So we have to install a package called libusb for this connection. JTAG (Joint Test Architecture Group) helps in controlling the chip. All the modern PCs have the JTAG support. 

      After connecting to the PC and all necessary check has been done we can run the mspdebug. Here we have to specify the device type and MSP430G2231 belongs to rf2500.

        It will start the debugging of msp430 launch pad and will show a device name as MSP430F2013 which is compatible with MSP430G2231.  Now we have initiated a communication and JTAG resets the chip.

MSP430 commands
dis 0xf800 ->which is used to display the address. 0xf800 is the starting address of flash memory. The codes shown here are the actual machine codes.
erase -->will erase the flash memory and will occupy with 'ff'.

regs -->shows all the register  values.
mw 0x200 -->can be used to write to any memory location.
prog a.out can be used to burn the code in the executable file a.out.

        Now we can burn a program to msp430.  

No comments:

Post a Comment