2 Replies Latest reply on May 3, 2012 12:27 PM by shelby.allen

    How to make DAC start with last value?

    shelby.allen

      The goal is to have the DAC start at the last power level where it was set before being powered down.

         

      Looking at the API, I thought I would be able to save the config of the DAC (including its current level) with VDAC8_SaveConfig()

         

      With my testing, it doesn't seem to do the trick.  Do I need to write straight to some register?  Do I need to implement some EEPROM to save my value?

         

      Thanks.

        • 1. Re: How to make DAC start with last value?
          user_1377889

          To save any values surviving a power-down the only solution is to use EEProm.

             

          But:

             

          You need power to program the EEProm

             

           

             

          Sounds like a logical paradoxon?

             

          Well you'll have to detect the power-down situation early (lost of AC) and use a gold-cap that lasts for programming the eeprom and shut-down.

             

           

             

          The SaveConfiguration() of the DAC is only used to store some info for sleep-mode in SRam which will be lost at PD.

             

           

             

          Power to the PSoC!

             

          Bob

          • 2. Re: How to make DAC start with last value?
            shelby.allen

             Thanks for the information.

               

            Since this value isn't meant to change continuously during operation, it may be safe just to write it whenever the value is changed.

               

            Thanks again!

               

            Shelby