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.

Keep Data For Calibration in C2000

Other Parts Discussed in Thread: TMS320F28030

Hi,

Firstly i am newbie, and try to keep data for calibration. I want to keep only one variable permanently. 

Is there an easy way to keep data ?

i look all examples about flash, also i examine SPRAB69, but i cannot find simply way to writing data to flash?

i am using "TMS320F28030 Piccolo™ Microcontrollers". 

Thanks & regards from Türkiye

  • Hi Mehmet,

    Mehmet Kucukgoz said:
    i look all examples about flash, also i examine SPRAB69, but i cannot find simply way to writing data to flash?

    The only way is to Emulate EEPROM on Flash. It's pretty much simple, please do share why do you feel it to be tough or tedious. Else, you'll have to use an external EEPROM and interface it using I2C.

    You can refer this link:

    http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/106228.aspx

    Regards,

    Gautam

  • Thanks for reply,

    I cannot open project, which you gave link.  I read "EEPROM Emulation With the TMS320F28xxx" but i could not understand completely.

    I try to create project manually, but i cannot find appropriate header files for my microcontroller.

    I changed cmd files   ".ebss    : >   RAML4    PAGE = 1" to ".ebss    :>   FLASHB    PAGE = 1".

    after that, i try to write data to my variable, but i cannot write.  

    I guess, i must work lot

  • I've edited the link, please do check now.

  • oh, sorry . 

    Actually, I opened your link. 

    But in this link Dave Foley gave answer and suggest  that  "http://focus.ti.com/lit/an/sprab69/sprab69.pdf " 
    I examined this pdf file, and i tried to open project which this pdf use it as an example. I can't open this project.

    Sorry for my bad English,

    Thanks.

  • Mehmet Kucukgoz said:
    I can't open this project.

    What is the name of the project? Also, what error do you get?

  • Finally, i solved my problem.

    That was easy, but for beginners like me, it took a time for understand.

    Basically, i added this codes below;


    #include "Flash2803x_API_Library.h"

    #include "Flash2803x_API_Config.h"

    #define FLASH_START_ADDR 0x3F4000
    #define FLASH_END_ADDR 0x3F7FFF

    FLASH_ST FlashStatus;

    Uint16 Status;

    typedef struct {
    Uint16 *StartAddr;
    Uint16 *EndAddr;
    } SECTOR;

    SECTOR Sector[4]= {
    (Uint16 *) 0x3F4000,(Uint16 *) 0x3F4FFF,
    (Uint16 *) 0x3F5000,(Uint16 *) 0x3F5FFF,
    (Uint16 *) 0x3F6000,(Uint16 *) 0x3F6FFF,
    (Uint16 *) 0x3F7000,(Uint16 *) 0x3F7FFF, };

    Status = Flash_Erase((SECTORB|SECTORC|SECTORD),&FlashStatus);

    if(Status != STATUS_SUCCESS)
    Example_Error(Status);

    Flash_ptr = Sector[0].StartAddr;
    Length = 0x2;
    Status = Flash_Program(Flash_ptr,sourceAdress,Length,&FlashStatus);

    if(Status != STATUS_SUCCESS)
    Example_Error(Status); }

    void Example_Error(Uint16 Status)
    {asm(" ESTOP0"); asm(" SB 0, UNC"); }

     

    Thanks for your help Gautam, Best Regards from Türkiye.