7 Replies Latest reply on Feb 15, 2019 5:09 PM by MoTa_728816

    Unable to use ADC DMA construction to read input voltage

    user_58361

      Dear community,

       

      For my internship I am working with the CY8CKIT-059 PSOC 5LP. In order to implement an control algorithm, I am exploring the possiblities of the CY8CKIT. However, I am running into an issue of which I cannot detect the origin. I used the example project ADC_DMA_VDAC and removed the LCD screen part of the project. The project is attached.

       

      The issue I am running into is that I cannot read a voltage from the VDAC on P0[2]. I am supplying a DC voltage within the Vdda range using a waveform generator on P0[1]. Maybe it is a very trivial error, but I would very much like to solve this issue, as most of my future work for my internship is depending on this.

       

      With kind regards,

       

      Jim

        • 1. Re: Unable to use ADC DMA construction to read input voltage
          MoTa_728816

          Hi,

           

          Does inserting

              CyGlobalIntEnable;                                  /* Enable global interrupts */

          in front of

          VDAC8_Start() ;

          improve the situation?

           

          moto

          • 2. Re: Unable to use ADC DMA construction to read input voltage
            user_58361

            Hi,

             

            I added it, but still no voltage present on the pin connected to the VDAC. Furthermore, I changed the pins to prevent that my signals are affected by the capacitors that are connected to some of the pins. Input is now on P0[0] and VDAC output is on P0[1].

             

            Jim

            • 3. Re: Unable to use ADC DMA construction to read input voltage
              MoTa_728816

              Hi,

               

              I modified the schematic as below

               

              000-schematic.JPG

              ADC Config

               

              001-ADC-Config.JPG

               

              DAC8 Config

               

              002-DAC8.JPG

               

              The oscilloscope

               

              IMG_3421.JPG

               

              Since my hand made funcgen generates almost to 0V, the ADC detects as a negative so the bottom value come to negative value, I guess.

               

              moto

              P.S.

              P0_1 = P0[0] 48

              P0_2 = P0[1] 49

              • 4. Re: Unable to use ADC DMA construction to read input voltage
                user_58361

                Hi,

                 

                I tried your project, but it does not work for me. The result I get using an AC wave with 200 mVpp with 500 mV offset and 100 Hz is seen in the scope plot. This is not what I expect the VDAC to do.

                NewFile0.png

                 

                I am kind of confused why this happens. Also, why does the VDAC need the strobe input in order to give an output?

                 

                If you have any suggestions that will help me understand and solve this issue, that would be greatly appreciated! What I would like to recreate is this How to Create an Analog Filter with PSoC 5LP - YouTube , as I am interested in knowing what happens when I want to filer high frequency signals.

                 

                UPDATE #1

                I changed some settings and ran the test again. In blue is the output of the VDAC(0-1.020V), which is now the same as my input, which I already specified. The question for me still remains why the strobe input for the VDAC is needed to output a voltage.

                NewFile1.png

                 

                UPDATE #2

                There is also a difference when the VDAC is set to output between 0-4.080V, as seen in the scope plot. I expect that this happens due to the loss in accuracy.

                VDAC_0-4080V.png

                 

                Jim

                • 5. Re: Unable to use ADC DMA construction to read input voltage
                  MoTa_728816

                  Hi,

                   

                  I'm sorry for confusing you.

                  As the previous project is "a kind of result" after I tweaked with your project.

                   

                  So from the DAC8 dialog, I also thought "Register Write" option should work,

                  but I just wanted to sync the end of DMA and strobe of DAC8.

                   

                  So I hope that at least the initial "issue" of generating output from DAC8 is somehow solved.

                  (There could be better methods though.)

                   

                  Meantime, to be honest I am not an analog expert, so if you need help with Analog Filter,

                  please create another discussion with such title.

                   

                  moto

                  • 6. Re: Unable to use ADC DMA construction to read input voltage
                    user_58361

                    Hi,

                     

                    No worries, I am already very glad that I can generate an output with the VDAC. To figure out why the VDAC needs the strobe input, I will open a new forum post.

                     

                    An other curious issue I now ran into is the fact that I changed the my initial project based on the changes you also implemented. When I build and flashed this onto the PSOC, it gave me the same result as my initial scope plot (seen in my previous post). Did you make any other changes, besides the schematic changes you already indicated?

                     

                    Thank you very much for the help.

                     

                    Jim

                    • 7. Re: Unable to use ADC DMA construction to read input voltage
                      MoTa_728816

                      Dear Jim-san,

                       

                      Last night (it was after midnight), my brain was pretty exhausted,

                      so I tried to reproduce what I did to your project.

                       

                      But to my surprise, your original project is working with only the modification to the pins.

                      P0_1: P0[0] 48

                      P0_2: P0[1] 49

                       

                      Sine wave 0.9V p-p with 0.05V DC

                      IMG_3422.JPG

                       

                      Sine wave 100 Hz 0.9V p-p with 0.05V DC offset

                       

                      IMG_3423.JPG

                       

                      So after all, the strobe was not required to make this project work.

                       

                      BTW, I wonder why last night initially your program was not working...

                      May be it was because of the pin choice...

                       

                      Best Regards,

                      16-Feb-2019

                      Motoo Tanaka

                      1 of 1 people found this helpful