This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430G2553: Flash memory programming in msp430g2553

Part Number: MSP430G2553
Other Parts Discussed in Thread: ASH

Hello everyone,

I am doing a program to write/modify some data on flash memory but I can't modify the flash memory.After opening the Memory window I can't change the default values


.cdecls C,LIST,"msp430.h" ; Include device header file

;-------------------------------------------------------------------------------
.text ; Assemble into program memory
.global RESET
.retain ; Override ELF conditional linking
; and retain current section
.retainrefs ; Additionally retain any sections
; that have references to current
; section
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer

main
mov.w #0x100,r9
mov.w #0x200,r10

loop


clrc
mov.w @r9, r11
mov.w @r11,r10
mov.w @r10,r9

inc r9
inc r10
jmp loop
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
.global __STACK_END
.sect .stack

;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET
.end

ash memory.In the memory window I can't edit anything

  • Flash is intended for data that is normally read only.
    The behaviour of the flash memory is described in chapter 7 of the User's Guide; see especially section 7.3.2. In short: you cannot write to flash without erasing a whole segment first.

    The debugger does not support changing values in flash directly because that would affect other data.

    The G2553 has 256 bytes of SRAM (at addresses 0x0200–0x02FF) that can be changed arbitrarily.
  • If I am writing mov.w r9,#0x0200h or mov.w #0x0200h,r9 there is a compilation error. So how can I write to modify the data into the SRAM ?

**Attention** This is a public forum