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.

EEPROM

Other Parts Discussed in Thread: ENERGIA

Hi, I want to wirte in a EEPROM to TC4M1249XL, but display a error.

Eeprom was not declared in this scope.

I don't have idea what's the problem.

If you help me, I would appreciate it

  • Dear Marco hello.

    Are you using CC6/CC7, or ENERGIA? Or other environment?

    What is your code, included the #include(s)?

    John

  • I mean, which are your #include commands in your source. Because ENERGIA's libs are written on top of TIVA C-Series libs and there are differences on the used ROM/flash lib calls.
  • Hi John,


    I am using ENERGIA to program.

    My program is:

    #include <EEPROM.h>

    int addr = 0;

    void setup()
    {
    }

    void loop()
    {

    val=12;
    EEPROM.write(addr, val);


    delay(100);
    }

    Is simple but I have error.
  • Marco it's O.K.
    Note that val is not previously defined in you code before or inside setup()
    You need an, int val=0
    Seems that you also need to include, though not all or any;
    #include <stdio.h>
    #include <stdlib.h>
    #include <stdint.h>
    #include <inttypes.h>

    Note also that what you are actually doing, is that inside an endless loop you
    write into the same EEPROM address/locations 0 - 3, the same value,
    again and again.

    John
  • As I said it is a test program, I really want to record with a button the time that the rtc gives me for a data storage, but I have an error trying to save a simple variable with the Eeprom.

    Marco
  • The code you sent does not work
  • Hi, can you help with any program to save a variable in the eeprom
  • 
    Hello Mark.
    The example at page 128 of the TIVAWARE Peripheral Driver Library User's Guide is very simple
    to follow. You can download the document from TI or just 'google' the above title.
    You can even use a #define My_INFO 0x400 and use the My_INFO keyword instead of the address
    itself in the example. Remember that every location in EEPROM reflects to 4 physical bytes,
    a word. That is so even if you want to store just a '1' in an EEPROM location. In the example
    the first (0th) element of the uint32_t pointer pui32Data/pui32Read, extents from 0x400 to
    0x403, so the second (1st)element of the uint32_t pointer pui32Data/pui32Read starts at 0x404
    and ends at 0x407
    In that respect, since EEPROM on TM4C1294xxxx has been arranged as a 6k space, only 1536 distinct
    4-byte/32-bit word values can be saved there. More than enough for any application.
     
    So, if you would like to store a telephone number like 3416078932 you need to convert it in
    hex as:0xCB9D3A54 and then just use 4-bytes in just one address location in EEPROM. If you
    want to store it as distinct decimal digits then you would need 10 words = 40 bytes of EEPROM
    space (Not so useful). If you want to store a string with letters and numbers, you have two
    options.
    Either break it in separate characters and use one word for each, or use a common routine to
    convert each digit/leter of the string into a char/byte and then concatenate each four of them
    into uint32_t values and then store these values in sequential EEPROM locations. BEWARE --> each
    location must be 4-address locations apart from the former. So the best case for a string of let's
    say a length of 33 mixed characters/symbols/digits would require 8 + 1 = 9-word address locations
    or 36 total needed bytes --> 32 bytes for the first 32 characters and another 4 bytes for the 33th
    character. Hope this helps
    Regards,
    John
     
     
     
    -----