EEPROM and STM32 || I2C || Multi Page Write and Read

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

Комментарии • 107

  • @ControllersTech
    @ControllersTech  3 года назад +7

    Now you can write the floats and decimal numbers to EEPROM. The latest updates to the Library will pushed to github.com/controllerstech/STM32/tree/master/EEPROM_STM32

    • @akaStarboyy
      @akaStarboyy 8 месяцев назад

      where do i specify data read or data write
      like EEPROM_Write(1,0,dataWrite,1500);
      only by using this i can see data read in live expression right?

  • @laurentjenni7202
    @laurentjenni7202 2 года назад +1

    Thank you, you saved me probably half day of work !

  • @ing.tomasferenc1276
    @ing.tomasferenc1276 3 года назад +4

    I just wana thank you for sharing your knowledge with us !!
    Thank you, i really appreciate that!

  • @ChristianBeltrame
    @ChristianBeltrame 2 года назад

    Great tutorial!
    To save code and memory, I have added a define instead of the LOG calculations:
    #define PADDRPOSITION 5 // int PADDRPOSITION = log(PAGE_SIZE)/log(2);
    Needs to be modified for each EEPROM type

  • @marianofpv
    @marianofpv 3 года назад +1

    You are awesome. Thanks for the clarity.

  • @yerarZ750
    @yerarZ750 Год назад

    Great totorial! How can we use our internal flash as eeprom if we don't have an external eeprom? I have use del HAL_Flash but with takes a lot of time and I want to use to save somo data in a power off.

  • @narendrasuryawanshi1708
    @narendrasuryawanshi1708 Год назад

    What a great video. Thank you for your efforts.

  • @gabrielfienco2531
    @gabrielfienco2531 3 года назад

    Thanks good video, have you ever work with spi W25Q## ??? that would be a good one too.

  • @marinchiriac1341
    @marinchiriac1341 3 года назад +1

    Hi. please make tutorial how to use the hall sensor interface driver. From hal library. To control the motor, speed and position. Thanks.

  • @bobby9568
    @bobby9568 3 года назад

    This person is a legend! Amazing content!

  • @ebelectronics
    @ebelectronics 3 года назад

    I love your explanations! Could you make a video of i2c slave mode on stm32 blue pill or others? It will be alsome to see how to use registers or hal.
    Thank you for sharing your videos

  • @alexanderurezchenko6446
    @alexanderurezchenko6446 3 года назад

    hi, thanks for your video, it helps a lot. why dont you use log2() function for paddrposition evaluating ? what's wrong with it?

  • @gggg-iu3sk
    @gggg-iu3sk 3 года назад

    So amazing tutorial! Thanks

  • @sakugava
    @sakugava 3 года назад +1

    Great work , as allways.

  • @eduardodelarosaferrer2205
    @eduardodelarosaferrer2205 3 года назад

    Thanks for your videos.

  • @kateiry4719
    @kateiry4719 2 года назад +2

    Hello, Controllers Tech! I found 2 bugs in your code while I'm working on my project. First, the code is only limited to EEPROMs that have 2-byte memory addresses like AT24C256, while 1-byte memory address EEPROMs like AT24C02 only use 1 byte as an address, which is unsupported by the hard-coded 2-byte function call. Another issue is that when you try to commit data that has a length multiple of 8, the last page will be committed as an empty page, and will, in some AT24C alternative parts, erase the next page unwantedly.
    I fixed these bugs in my own repository, and if you would like, I can file a pull request. Thanks!

    • @ArsenMikitov
      @ArsenMikitov 2 года назад +1

      Hi, Kate Iry! Can you publish your own version of the code for AT24C02? I will be very grateful. Thanks!

    • @kateiry4719
      @kateiry4719 2 года назад +2

      @@ArsenMikitov No problem! Check out pastebin.com/vELjnicZ

    • @ArsenMikitov
      @ArsenMikitov 2 года назад

      @@kateiry4719 Thank you very much, dear friend! It really works! 🙏🙏🙏 I'm a newbie to STM32 and some things are hard for me to write myself. :) And of course thank you very much Controllers Tech!

    • @kateiry4719
      @kateiry4719 2 года назад +1

      @@ArsenMikitov My pleasure! Don't forget to include the HAL header file of your own MCU 😉

    • @nagasobhana9067
      @nagasobhana9067 2 года назад

      @@kateiry4719 Hi, I am getting error in EEPROM_pageErase like undefined symbol. Do you know how to solve .

  • @CrizzyD91
    @CrizzyD91 3 года назад

    Hi Controllers Tech, brilliant series about STM32. Could you explain why the Arduino and STM32 uses different addresses for i2c? It appears that the address on the Arduino appears to be shifted to the right by one bit. Why is this? For example, the address is 0x50 in Arduino but 0xA0 on STM32. Thanks

    • @ControllersTech
      @ControllersTech  3 года назад

      At the mcu level all of them use 8 bit address. There is no such thing as 7 bit register.
      Arduino IDE takes 7 bit (higher 7 bits) value. If you don't use the arduino functions and instead use registers for programming, you need to give 8 bit value in arduino too.
      I suppose they did that because the 0th bit of the i2c address denotes read or write operation. So they would want to minimise the confusion of changing address with read or write cycle..

  • @martinpalomino8627
    @martinpalomino8627 Год назад

    I was trying to use your library to save the frequency values of fm module tea5767 but that don´t works at least for me , however I found other way that make it works without your library . Anyway, thanks to share knowledge

  • @barrykeane2716
    @barrykeane2716 3 года назад

    Very well done! Thank you!

  • @eng.shh80
    @eng.shh80 3 года назад +1

    Great work as usual 👍

  • @VishalKumar-pj9vq
    @VishalKumar-pj9vq 3 года назад

    Hi can you make a video on sending data to https client by POST request using esp8266 by AT commands...As I have tried.. http work but https not.....I have studied.... Found about slip command for rest api....But not getting any reference about this with stm32 by udatt using AT commands....

  • @arifkhan-rb7dl
    @arifkhan-rb7dl Год назад

    are these the remaining bytes of the startpage?

  • @lucasorlebeke2130
    @lucasorlebeke2130 7 месяцев назад

    why do you not left shift the eeprom address by 1

  • @miraclewu2544
    @miraclewu2544 2 года назад

    thanks so much,it helps me a lot

  • @Filipx87page
    @Filipx87page 3 года назад

    Hi, is the library compatible also for 24AA256? Thanx.

    • @ControllersTech
      @ControllersTech  3 года назад +1

      Yes. But watch the video instead of using library. I have explained the steps in case if anything is different

  • @arifkhan-rb7dl
    @arifkhan-rb7dl Год назад

    i tested the code and it works but when i keep the OFFSET for datar1 [ ] zero than i can see the whole string " hello world" but when i increase the OFFSET value then the whole string moves up in live expression window although it should go down, can you please explain this

    • @ControllersTech
      @ControllersTech  Год назад

      You are not keeping offset for anything, you are reading from an offset. Of course it will move up.
      Say your data is in 10th place. If you read with an offset 0, then the data will show at 10th place in the RXBuf. But if you read from an offset of 8, then the data will show up at 3rd place.

  • @hero21number18
    @hero21number18 2 года назад

    can you please explain how to find the endpage with the help of offset and the size of the data

    • @ControllersTech
      @ControllersTech  2 года назад

      What ?
      Just add the offset to the data size. Now compare with the page size. If it exceeds then you are on the next page..
      This is just simple math

  • @saeedsoleimani5200
    @saeedsoleimani5200 2 года назад

    Hi I'm using this on stm32l4 and AT24C16 , there is a problem in multipage writing...it writes the intended content of the last page over all of the pages!!!

    • @ControllersTech
      @ControllersTech  2 года назад

      I need to check the c16 datasheet. Better Open the issue in the github.

    • @ДенисСемёнов-н4ф
      @ДенисСемёнов-н4ф 2 года назад

      I have exactly the same problem with writing in 24WC16P (16 bytes/128 pages). ALL data is recorded only on the first page. But in 24C64 (32 bytes/256 pages), the recording is performed correctly. And there is also a restriction on setting the byte offset in the page being written: writing does not occur if the offset exceeds the page size (in bytes). Apparently, it is necessary in the recording function to check for the offset output beyond the number of bytes in one page and make the appropriate correction?

    • @ДенисСемёнов-н4ф
      @ДенисСемёнов-н4ф 2 года назад

      According to the documentation for 24C16, the addressing of memory cells is different. The highest byte of the cell address is placed in the lowest tetrad of the device address byte (excluding bit '0'). I had to change the code and it worked correctly.

  • @amirhosseini4689
    @amirhosseini4689 3 года назад

    That’s perfect.
    how to write & read variable (int,double) in eeprom?

    • @ControllersTech
      @ControllersTech  3 года назад

      haven't tested with that.. Will update once i do

  • @martinhladik1422
    @martinhladik1422 13 дней назад

    Hi all! I add to write and read function "automatic calcul the page from offset" I hope it is correct.
    page = offset / PAGE_SIZE;
    offset = offset % PAGE_SIZE;
    Have a nice day!

  • @dayanandkilledar7308
    @dayanandkilledar7308 2 года назад

    EEPROM is M24C04-R. I am trying to do write page and Read page of Structure values. But it's not reading after 16byte. So provide me solution for this.

    • @ControllersTech
      @ControllersTech  2 года назад +1

      As it's mentioned in the video, it targets the AT24 series from microchip..
      Can't say about others..

    • @SoMadCoffee
      @SoMadCoffee 2 года назад +1

      Have you changed page settings? if not try these.
      #define PAGE_SIZE 16
      #define PAGE_NUM 32

    • @SoMadCoffee
      @SoMadCoffee 2 года назад +1

      Explanation:
      Your EEPROM is 4kbit, in bytes that would be 4096bits/8bits = 512bytes. The datasheet says the page size is 16bytes. So, the number of pages would be 512bytes/16bytes = 32.

  • @ucontrolchannel5967
    @ucontrolchannel5967 3 года назад

    heeeeeyyy, veerryyy gooood. Thank youu verryy muuuch :)

  • @manasmandal6988
    @manasmandal6988 Год назад

    how can i see the memory location of external memory module ?

    • @ControllersTech
      @ControllersTech  Год назад

      What do you mean ? How do you want to see it exactly ?

  • @gtcollection6933
    @gtcollection6933 3 года назад +1

    I love your tutorials! Unless you revert back to the OOTB/Default CubeIDE color style I'll unfortunately have no choice but to pass on the upcoming tutorials. I simply can't see anything, its all black with some light tones of gray here and there man :(( Maybe your monitor settings are very high contrast, I don't know, but here on two computers its practically non-readable. Keep up the good work, thumbs up

    • @ControllersTech
      @ControllersTech  3 года назад +3

      Noted... I'll switch to light theme...
      Actually never had that issue on any device i see the video on. But anyway there is no harm with light theme also

    • @gtcollection6933
      @gtcollection6933 3 года назад +1

      Haven't played with dark themes much to know but perhaps the font color can be brighten a bit, closer to white'ish. As-is and with those dark gray shades on black it definitely does not work for a general audience, need some seriously sharp eyesight *_* ;)

  • @attilahcen8194
    @attilahcen8194 2 года назад

    I try write and read using EEPROM AT24C256 and STM32F103C8 (Bluepill) but it's read just the first 6 adress the others give y(255)

    • @ControllersTech
      @ControllersTech  2 года назад +1

      This mostly is the issue from your end. Need to see your code. Ask in the telegram group or discord

  • @kumarm1780
    @kumarm1780 3 года назад

    EEPROM II SPI II STM32H743I please ...assume M95512(EEPROM)

  • @mostafakh5075
    @mostafakh5075 3 года назад

    it works great when i write on one page,but when i write in 2 or more seperate page it doesn't work properly unless i write and then exactly read the next line.i dont know where i'm making a mistake. EEPROM_Write(0, 0, (uint8_t *)dataW,strlen(dataW));
    EEPROM_Write(3, 0, (uint8_t *)dataW2,strlen(dataW2));
    EEPROM_Read(0, 0, dataRead, 15);
    EEPROM_Read(3, 0, dataRead2, 15);
    i use at24c08.

    • @ControllersTech
      @ControllersTech  3 года назад

      So it is working if you do the same but using write read write read... But not working with write write read read ?

    • @mostafakh5075
      @mostafakh5075 3 года назад

      @@ControllersTech yes it doesn't work when write write, read read

    • @ControllersTech
      @ControllersTech  3 года назад +1

      Ok I'll test it and get back..

    • @ControllersTech
      @ControllersTech  3 года назад

      It's working alright here. I tried With both the methods and results were same

    • @mostafakh5075
      @mostafakh5075 3 года назад

      @@ControllersTech tnx. maybe i made a mistake

  • @behzadabf
    @behzadabf 2 года назад

    perfect..!

  • @MrJamshaiddar1
    @MrJamshaiddar1 3 года назад

    can this be used in register level programming?

    • @ControllersTech
      @ControllersTech  3 года назад +2

      Sure. Instead of hal i2c mem write, use the function from my old video

    • @MrJamshaiddar1
      @MrJamshaiddar1 3 года назад

      @@ControllersTech can you send link of that video? And do we need to add same libraries also you mentioned in this video?

    • @ControllersTech
      @ControllersTech  3 года назад +2

      Look in the register programming playlist.. the i2c video
      Yes you can use same libraries..

    • @MrJamshaiddar1
      @MrJamshaiddar1 3 года назад

      @@ControllersTech thanks. These have been very helpful

  • @arifkhan-rb7dl
    @arifkhan-rb7dl Год назад

    // function to determine the remaining bytes
    uint16_t bytestowrite (uint16_t size, uint16_t offset)
    {
    if ((size+offset)

  • @metehandemirel4914
    @metehandemirel4914 6 месяцев назад

    if size is 30 and offset is 40 how is total data is 80?

    • @ControllersTech
      @ControllersTech  6 месяцев назад

      Mention the time please.

    • @metehandemirel4914
      @metehandemirel4914 6 месяцев назад

      ​@@ControllersTech8:48

    • @ControllersTech
      @ControllersTech  6 месяцев назад +1

      Yes that seems like a mistake. Just assume that size is 40 and you are good to go.

  • @anupnadagouda8240
    @anupnadagouda8240 3 года назад

    Hi Sir, I am unable to understand RTOS please can u help me, how to write codes, about variables

    • @ControllersTech
      @ControllersTech  3 года назад

      There is a whole series on RTOS. Look in the playlist

  • @aaronpadilla458
    @aaronpadilla458 Год назад

    bytestowrite is undefined