7 Replies Latest reply on Dec 9, 2016 7:45 AM by user_1377889

    eeprom

    chiragmodesara_1567941

      how can i use eeprom on psoc-4.??

         

      i read emulated eeprom component datasheet. there is only write function which can write the data but i cant find the function which can read the data from eeprom.

        • 1. Re: eeprom
          user_296634034

          i hope PSoC5 works with the similar API than your PSoC4 (it's highly probable)

             

          it's used for EEPROM not an Em EEPROM, the functionalities between these 2 EEPROM are probably close. 

             

          After add this 2 points above, please find below a basic function to read EEPROM :

             

          void refresh_values(unsigned char *tab){

             

              int i=0;
              reg8 * Pointer = (reg8*) CYDEV_EE_BASE;
              EEPROM_Start();
              for(i=0;i<5;i++) tab[i] = Pointer[i];
              EEPROM_Stop();

             

          }

             

          I use this code to read 5 bytes into the EEPROM. You need to add a component EEPROM on your Topdesign.

             

          It's a simple proposal to read EEPROM without use the read API: i hope it will be useful for you.

             

          yours,

             

          rob1

          • 2. Re: eeprom
            chiragmodesara_1567941

            Thanks rob1 for your valuable Reply.

               

            but i want to tell you something.

               

             i think psoc-4 has not a eeprom component. There is only Emulated eeprom component.

            • 3. Re: eeprom
              user_1377889

              When reading from emeeprom it is quite the same as reading from flash, you just use a pointer / address and get the data. I frequently use a structure in flash and a copy in sram to work on. So I can check the number of eeprom writes and check for valid data.

                 

              On some BLE chips take care:  the clocks may be changed during the flash write, check the "System Reference Guide".

                 

               

                 

              Bob

              • 4. Re: eeprom
                chiragmodesara_1567941

                okay thanks bob,

                   

                can you give me basic syntax which can read the memory and transfer to the SRAM??

                • 5. Re: eeprom
                  user_1377889

                  See here ...

                     

                   

                     

                  Bob

                  • 6. Re: eeprom
                    chiragmodesara_1567941

                    okay Thanks bob,

                       

                    Can you tell me one more thing.

                       

                    which number of row or memory i use for flash memory like emulated eeprom example project using this code

                       


                     static const uint8 CYCODE eepromArray[]=
                                                    { 0x46, 0x69, 0x72, 0x73,0x74, 0x20, 0x72, 0x75, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00 };
                     
                     uint8 array[]             ={ 0x50, 0x6F, 0x77, 0x65, 0x72, 0x43, 0x79, 0x63, 0x6C, 0x65, 0x23, 0x20, 0x30, 0x00 };
                                                    /* P     o     w     e     r     C     y     c     l     e     #           0*/

                       

                     

                       

                    i want 10 array for non-volatile memory.

                    • 7. Re: eeprom
                      user_1377889

                      Didn't I comment in the example to use the upmost flash rows?

                         

                      The emulated eeprom example works differently and cares for data located anywhere in flash.

                         

                       

                         

                      Bob