1 2 3 Previous Next 32 Replies Latest reply on Jun 14, 2013 3:55 AM by user_1377889

    GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave

    helmut.forren

      I'm using a CY8C5568LTI.  I have pin 61 P15[5] connected to a 1K resistor, which in turn connects to the center point of a stack of 100K resistors from a regulated 2V down to ground.

         

      I use instructions

         

      PIN_SetDriveMode(PIN_DM_ALG_HIZ); // Set as Hi-Z input,
      PIN_Write(0); // Really no impact since we're in Hi-Z input mode

         

      To put this pin into high impedance mode.  Neverthelss, I'm seeing a square wave at the center point of the resistor stack, varying from 0.9V to 1.1V.  The resistor stack is seeking 1.0V, and the pin is injecting current to cause this +/- 0.1V change. The square wave period is about 120ms (8.3Hz).  Whether I do DC analysis (101K to ground) or AC analysis (resistor network 51K), I come up with 1 to 2 uA of current coming out or going into this pin that's supposed to be high impedance.

         

      So I check the CY8C55 Family Datasheet. Table 11-6 for GPIO DC Specifications says input leaking max 2nA. That's a far cry from 1 to 2uA. I do find more leaking on SIO pins, but this is definitely a GPIO pin.

         

      So why do I seem to have 500 to 1000 times more current coming from/to the pin that the datasheet says?

         

      Note also that I found a knowledgebase article at http://www.cypress.com/?id=4&rID=33792 about a similar subject. It says a resistor of "few tens of K" will fix the problem noted.  But that also implies a leakage current much larger than the datasheet says.

         

      So what's up and how can I fix this offensive pin?

         

      Thanks.

        • 1. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
          user_1377889

          When there is something that should not be it is always better for us to have the complete project to check. Using the "Create Workspace Bundle" function and uploading the resulting archive would do.

             

          Are you using an own PCB or have you got a kit (which one)?

             

           

             

          Bob

          • 2. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
            user_14586677

            Possibly the following -

               

             

               

            1) The DC offset, due to tolerance of 100K's and 2 V supply ? If 100K's are

               

            5%, then two R's could be 10% off.

               

             

               

            2) The pin is adjacent to Vddio pin, would not be unusual for it to have a few hundred

               

            mV of noise on it, and via parasitic C coupling induce a sq wave on adjacent HiZ pin.

               

             

               

            Regards, Dana.

            • 3. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
              user_78878863

              Analog pins are always bi-directional. High-Z just means that they don't impose any load an connected outputs (or at least just a small load). But since you observe only a small signal (200mV peak-to-peak) I think Dana is right: you just observe a signal coupled in from somewhere. This might be from the outside, or even from the inside of the PSoC.

                 

              To check the latter, you can use the analog wire viewer in the design wide resources editor. There you can check how P15[5] is routed internal, and where it might cross a digital signal.

                 

              Otherwise it might come from the outside. 100k resistors won't do much to prevent noise from coupling in...

              • 4. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                user_14586677

                I may be mistaken but I do not think the analog viewer shows topologically

                   

                the physical layout, it is more a symbolic route view ? I could be wrong on this.

                   

                 

                   

                Regards, Dana.

                • 5. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                  user_14586677

                  I have changed my mind about coupling based on the fact

                     

                  you posted square wave as < 10 Hz, stray C of 5 pF at 10

                     

                  Hz is ~ 318 Mohms, so it cannot be coupling.......

                     

                   

                     

                  Your scope is not aliasing due to improper sweep settings ?

                     

                   

                     

                  So what is running in your design at this low frequency ?

                     

                   

                     

                  Regards, Dana.

                  • 6. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                    helmut.forren

                     Bob, Dana, and hli:

                       

                    Thanks very much for your suggestions.  Here's some itemized followup.  Your own followup from this is GREATLY appreciated.

                       

                    Back to fundamentals, if the noise *is* coming from the PSoC5, then is there something I can do to lessen the drive strength?

                       

                    I can't provide the project because of it's proprietary nature.

                       

                    The board is custom.

                       

                    FYI, I've been doing this type of work for over 20 years, so a snafu like scope settings, while always possible, is very unlikely.

                       

                    I removed the 1K resistor and the offending signal on the 100K stack went away.  The 1K resistor connects to the PSoC5 and nowhere else.  The the injection must be occurring on the electrical node that is the trace from the 1K resistor to the PSoC5. Now, this trace does go out to a test connector that currently has a plug in it with 5" pigtails.  However, I'm pretty sure the type of square wave signal seen, much less at 8Hz, can't ge generated by this extra baggage on this electrical node.  In fact, I'm pretty sure it can't be generated by anything else outside the PSoC5, such as capacitive coupling to another signal.  This trace does repond appropriately when I intentionally drive it low or high, which are two other configurable states for the output.  So it's not likely shorted to something else.  Furthermore, I'm not intentionally doing anything as slow as 8Hz.  (And, of course, it's a square wave, so please think again and it can't be resistor tolerances.)  

                       

                    I've attached an annotated photo of two test conditions.  The top is with the 1K in place.  You see it's definitely a square wave, with 1uA being inserted + and -.  The bottom is after the 1K is removed, probing the open resistor pad that is the same node as the PSoC5 pin.

                       

                    Regarding induced voltages from nearby, I calculate the induced current would have to be 1 to 2 uA.  Maybe this could be an induced voltage, but from where?  The 8Hz square wave nature shouldn't be anywhere else on the board.  I'm not prepared to get to this point YET, but the board is layed out such that I could cut this line very close to the PSoC5 pin and then measure the pin directly.  This would definitively eliminate all sources other than the PSoC5 itself, if I continue to assume it can't be noise on the scope, which is an extremely safe assumption under these conditions.

                       

                    The biggest question may be from where does the 8Hz come?  I'm not intentionally running anything that slow.  And the square wave is so relatively "square", that it's not some beat-down or low frequency harmonic of a higher frequency signal.  It's simply an 8Hz square wave, nothing more and nothing less.  I don't think I have such signals outside the PSoC5.  I have an 8MHz crystal on the PSoC5.  There's a 32.768 clock crystal on the PSoC5, and another on a DS1305 real time clock chip.  Inside the PSoC5, everything should be in the kHz range.  So, frankly, I don't see how the PSoC5 can be generating it, either.  But it must?

                    • 7. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                      user_14586677

                      Helmut, I am stumped.

                         

                       

                         

                      One other possibility, no linear regulator is oscillating in and out of thermal shutdown ?

                         

                      I have had that happen, and it is usually a Hz rate due to die thermal mass considerations.

                         

                       

                         

                      If you power everything off, 8 Hz gone ? Are you in a flourescent lighting environment, if so

                         

                      turn those off. Any other light dimmers off. Coffee pot heater turned off.......

                         

                       

                         

                      Just guessing now........

                         

                       

                         

                      Regards, Dana.

                      • 8. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                        user_14586677

                        Helmut, are you yourself generating the 8 Hz, from something you ate or drank ?

                           

                         

                           

                        Concerned, Dana.

                        • 9. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                          user_1377889

                          Is there a chance that you copy the project and reduce module-by-module until the error vanishes or the project has reached a state that is so common that you may publish it.

                             

                          Oh, and did you try to power your board with a battery?

                             

                           

                             

                          quivering with 8Hz

                             

                          Bob

                          • 10. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                            user_78878863
                                    I tried to reproduce this. Unfortunately neither the -001 nor the -050 kit has pin P15[5] on a header, so I used my -050 and used pin P4[0] (with a CY8C5588AXI-060ES1 on it). I added a Vref, and used a Opamp as buffer to get it on a pin P4[1] (not using the Opamp meant that adding the 200k load would drop its voltage from 1V to about 200mV...). I then configured a second analog pin on P4[0], and routed it to a DelSig ADC (so it won't get optimized out). But measurements showed no voltage drop, and I could not observe any signal (apart from the noise I could observe otherwise on the scope). Especially there was no square signal to be seen.   
                            • 11. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                              user_78878863
                                      Could it be that you switch some component on and of in a regular fashion? The signal to be seen in your image seems to have rather slow rise and fall times (several µs), it doesn't look like a real square wave. And it doesn't look like 50% duty cycle too.   
                              • 12. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                                ki.leung

                                1. Do you have any routine that would run at this frequency? ie a counter/timer ISR? 

                                   

                                2. Would it change if you change all the internal clocks to a different frequecy? 

                                   

                                3. If all failed. May be try a different chip. 

                                • 13. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                                  junichi.hiraoka
                                          Hi there, I have made a similar Pin and observe it. Yes, I can see 8Hz noise at the scope. So, for more detail try to see it on analyzer scope. I guess that is from utility power supply. Doubled frequency of 60Hz, 120Hz. It shows -76dBV, around 100uV. It was measured Battery supplied PSoC5 board, On well grounded Iron table however. There are many noise source around.   
                                  • 14. Re: GPIO pin P15[5] in Hi-Z Analog mode still outputting square wave
                                    ki.leung

                                    @PSoC73. 8hz is sub-mulitples of the power line frequency, not the harmonics. Did you have the noise with a battery supply? Is your configuation just setting the input and do nothing?

                                    1 2 3 Previous Next