(no subject)

Page 1.0 of 1.3599999999999999
  • giuliano - 2020-02-11

    Very happy to read this post. But I can't find where you set the runtime to use sram for retain variables instead of file (that is the default setting I think). Thanks

     
    • aliazzz

      aliazzz - 2020-02-11

      Hi,

      Thank you!

      Retain data is normally not supported by the raspberry pi runtime by design of the hardware. Raspberry Pi has to my knowledge never been released with built in SRAM or battery backed up ram or similar.
      This library focuses purely on realisation of retain data with an mcp7941x RTC Chip with built in SRAM.
      If you wish to implement a workaround via a textfile, you are free to do so yourself as it is not part of the mcp7941x RTC Chip.

      With kind regards

       

      Last edit: aliazzz 2020-02-11
    • Ingo

      Ingo - 2020-02-11

      AFAIK the driver doesn't change the retain strategy, but it stores and restores the data additionally into the external chip.

      @aliazzz what is the interval in which the data is stored?

       
      • aliazzz

        aliazzz - 2020-02-11

        Ehm, to rephrase it: the Retain mechanism in Codesys will compile but will not work in the standard raspberry pi hardware. This package enables the user to leverage battery backed up hardware sram support in a raspberry pi via the retain mechanisme which will work in combination with this library.

        The smallest working stable interval for me is T#1msec (see table)
        Your mileage may vary!

         

        Last edit: aliazzz 2020-02-11
  • wayne - 2020-03-31

    Hello aliazzz,

    I want to use the Eeprom AT24C (4096x8) on a DS3231.
    What do I've to change in the code?

    • The i2c-adress is also 16#57,

    At the moment, after a power failure, the retain data is "0"...

    Thx,
    wayne

     
    • aliazzz

      aliazzz - 2020-03-31

      Hi,

      Surely you can use this library as a basis for your needs. It would be even better if you would start a new CForge project for it. If you do, we can help even better you with implementation for it.

      You wote *The i2c-adress is also 16#57, At the moment, after a power failure, the retain data is "0"... *

      The AT24C is a dedicated EEPROM, while the MCP7941x is a multipurpose package (RTC, Calendar and EEPROM) made by a different brand, so if it works out of the box, that would be sheer luck.

      I think you should download and study the data sheets for your AT24C and the MCP7941x. After studying both data sheets and the library for the MCP7941x you can rewrite it to suit your specific needs.

      PS, I assume you run it on a Raspberry pi.
      Have you checked if the i2c master detects it? When your runtime sees the ic, then you can start debugging.

      Good luck!

       
  • wayne - 2020-04-02

    Ahh...
    I've looked into the data sheets (that was a good hint ;-) and there was the first problem.
    The adressing is different (2 bytes for the adress)

    Yes, i'll run it on a rpi and the i2c detects the 24c32.

    OK, i will study the data sheet a little bit longer and then create a new CForge project.

    Thx,
    wayne

     
    👍
    1
    • aliazzz

      aliazzz - 2020-04-02

      Some advice: Never try to use a library for hardware it is not written for (!)
      In the most negative scenario your hardware could brick or short circuit.

       

Log in to post a comment.