7 Replies Latest reply on Jan 22, 2014 12:29 PM by hanns.kucer

    How to pull out AGND

    hanns.kucer

      Hi all!

         

      I need to make AGND available from outside a cy8c2714 (DIP-8 version) so I went ahead an placed a RefMUX, selected AGND as "Reference Select", routed the analoge column bus to port p0[4] with the output amplifier turned on.

         

      Pin drive mode is "High Z Analog" and globals are set according to the attached image.

         

      I was expecting Vdd/2 = ~2.5V on p0[4] but instead I see 5V - what am I doing wrong?

        • 1. Re: How to pull out AGND
          user_14586677

          You started the refmux with API and used the API call to select

             

          AGND ?

             

           

             

          W/o seeing your project tough for forum to help.

             

           

             

          Regards, Dana.

          • 2. Re: How to pull out AGND
            user_14586677

            The example code in the datasheet -

               

             

               
            #include "m8c.h"
               
            #include "RefMux.h"
               
            void main(void)
               
            {
               
                BYTE bRefSignal;
               
                RefMux_Start(RefMux_LOWPOWER);     // Turn on power to CT block
               
                bRefSignal = RefMux_AGND;          // Assign port number
               
                RefMux_RefSelect(bRefSignal);      // Apply AGND to ABUS2.
               
                
               
              // …Other code
               
            }   Regards, Dana.
            1 of 1 people found this helpful
            • 3. Re: How to pull out AGND
              user_1377889

              Did you issue a RefMux_1_Start() ?

                 

               

                 

              Bob

              1 of 1 people found this helpful
              • 4. Re: How to pull out AGND
                hanns.kucer

                 "Did you issue a RefMux_1_Start() ?"

                   

                Argh, that's it - how silly of me, I beg your pardon and should have known better by now - I tend to forget that a lot and I guess it's an extremely common beginner's mistake.

                   

                One could argue, the designer could add that line of code automatically but I know there are problems in doing so and personally, I'm allergic to automatic code insertion. I still remeber the frustration of using early "MS Front page" only too well :-)

                • 5. Re: How to pull out AGND
                  user_14586677

                  Odd, datasheet names module as "RefMux", but when placed its

                     

                  "RefMux_1" (w/o user edit).

                     

                   

                     

                  It would be nice if API generator flagged a warning the module, or any module,

                     

                  not started in user code. I will suggest that to team and fixes for data sheet

                     

                  consistancy.

                     

                   

                     

                  Lastly don't forget to error budget the Ref to Pin path in case you need a lot of

                     

                  precision.

                     

                   

                     

                  Regards, Dana.

                  • 6. Re: How to pull out AGND
                    user_1377889

                    To forget the initialization is done easily. I tried using a function InitializeHarware() to collect all usermodules to initialize which gave me a pretty good overview.

                       

                    Unfortunately I forgot sometimes to call InitializeHardware() from main

                       

                     

                       

                    Bob

                    • 7. Re: How to pull out AGND
                      hanns.kucer

                      LoL