Read three thousand two hundred and fifty | return six

twenty-nine

Posts

zero

TA resources

A grain of gold sand (medium)

Building owner
 

About MSP430F149 Flash [Copy Link]

About MSP430F149 Flash

In order to realize data collection and storage in on-chip Flash, the board made by myself uses an 8M crystal oscillator instead of a 32K one. Now the program can be downloaded to the MCU, but the data cannot be written into Flash. The program can write the data into Flash in the development board. The reason has been found for three or four days, but I still don't know the reason. I hope experts can give me some advice.

This post is from Microcontroller MCU Forum

Latest reply

Let's talk about how to solve the problem.   details reply Published on 2012-3-28 07:46
 
give the thumbs-up follow

reply
report

Initial growth of bare film (primary)

sofa
 
What you mean is that the user FLASH cannot be used normally. This mainly depends on the configuration of the FLASH controller

[ This post was last edited by wstt on March 26, 2012 at 10:34 ]

flash.zip

2.51 KB, downloads: 17

This post is from Microcontroller MCU Forum
 
 

reply

twenty-nine

Posts

zero

TA resources

A grain of gold sand (medium)

Bench
 

Thank you for your help. Can you help me look at my program? See what's wrong

#include <msp430.h>
#include "BoardConfig.h
uint *Flash_ptr;                           // Flash pointer
unsigned int i;

void flash_write(void)
{
  while(FCTL3 & BUSY);
  FCTL2 = FWKEY + FSSEL0 + FN4+ FN1+ FN0;              // MCLK/20 for Flash Timing Generator
  Flash_ptr = (uint *) 0x2080;               // Initialize Flash pointer
  FCTL1 = FWKEY + ERASE;                     // Set Erase bit
  FCTL3 = FWKEY;// Clear Lock bit
 
  *Flash_ptr = 0;                            // Dummy write to erase Flash segment
  FCTL1 = FWKEY + WRT;

}


void int_clk(void)
{
   BCSCTL1&=~XT2OFF; //Open XT oscillator
    do
 {
        IFG1 &= ~OFIFG; //Clear oscillation error flag
        for(i = 0; i < 100; i++);
   _NOP(); //Delay waiting
        }
    while ((IFG1 & OFIFG) != 0); //If the flag is 1, continue the cycle waiting
    BCSCTL2|=SELM_0;                    //MCLK 8M  
}

void main( void )
{
    WDTCTL = WDTPW + WDTHOLD; //Turn off the dog
    int_clk();
    flash_write();  
    while((FCTL3&BUSY)==BUSY) ;// Wait for FLASH memory to complete operation
    for(i=0;i<8;i++)
      {
       *Flash_ptr=0x30;                // Move results;
      
        Flash_ptr++;
       
      }
    FCTL1 = FWKEY; // Clear WRT bit
    FCTL3 = FWKEY + LOCK; // Reset LOCK bit
    _EINT();

}

This program can write 8 flash 0030s on the development board, but not on my board

This post is from Microcontroller MCU Forum
 
 
 

reply

twenty-nine

Posts

zero

TA resources

A grain of gold sand (medium)

four floor
 

Reply to sofa wstt's post

Thank you for your help. Can you help me look at my program? See what's wrong

#include
#include "BoardConfig.h
uint *Flash_ptr;                           // Flash pointer
unsigned int i;

void flash_write(void)
{
  while(FCTL3 & BUSY);
  FCTL2 = FWKEY + FSSEL0 + FN4+ FN1+ FN0;              // MCLK/20 for Flash Timing Generator
  Flash_ptr = (uint *) 0x2080;               // Initialize Flash pointer
  FCTL1 = FWKEY + ERASE;                     // Set Erase bit
  FCTL3 = FWKEY;// Clear Lock bit
  
  *Flash_ptr = 0;                            // Dummy write to erase Flash segment
  FCTL1 = FWKEY + WRT;

}


void int_clk(void)
{
   BCSCTL1&=~XT2OFF; //Open XT oscillator
    do
{
        IFG1 &= ~OFIFG; //Clear oscillation error flag
        for(i = 0; i < 100; i++);
   _NOP(); //Delay waiting
        }
    while ((IFG1 & OFIFG) != 0); //If the flag is 1, continue the cycle waiting
    BCSCTL2|=SELM_0;                    //MCLK 8M   
}

void main( void )
{
    WDTCTL = WDTPW + WDTHOLD; //Turn off the dog
    int_clk();
    flash_write();   
    while((FCTL3&BUSY)==BUSY) ;// Wait for FLASH memory to complete operation
    for(i=0;i<8;i++)
      {
       *Flash_ptr=0x30;                // Move results;
      
        Flash_ptr++;
        
      }
    FCTL1 = FWKEY; // Clear WRT bit
    FCTL3 = FWKEY + LOCK; // Reset LOCK bit
    _EINT();

}

This program can write 8 flash 0030s on the development board, but not on my board
This post is from Microcontroller MCU Forum
 
 
 

reply

twenty-nine

Posts

zero

TA resources

A grain of gold sand (medium)

five floor
 

Reply to sofa wstt's post

The problem has been solved, thank you very much for your help!
This post is from Microcontroller MCU Forum
 
 
 

reply

four hundred

Posts

zero

TA resources

Multicolor wafer (intermediate)

six floor
 
Let's talk about how to solve the problem.
This post is from Microcontroller MCU Forum
 
 
 

reply

twenty-nine

Posts

zero

TA resources

A grain of gold sand (medium)

seven floor
 

Reply to the post of Triton.zhang on the 6th floor

The crystal oscillator didn't start, and then it was solved^_^
This post is from Microcontroller MCU Forum
 
 
 

reply
You need to log in before you can reply Sign in | register

Guess you like it
look around
Find Data Book?

EEWorld Datasheet Technical Support

Related articles More>>
close
Recommended by webmaster Previous one /10  Next
Copyright Electronic Engineering World Beijing B2-20211791 Jing ICP Bei 10001474-1 TSSP [2006] No. 258 Jinggong Network Anbei No. 11010802033920 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
Quick reply Back to top Back to list