1 2 Previous Next 20 Replies Latest reply on Apr 2, 2013 3:04 PM by user_14586677

    I/O port is breakdown slowly, one by one, a little by little.

    junichi.hiraoka
          

      Hi PSoCkes,

          

      A Strange Problem is happening.

          

      I/O port is breakdown slowly, one by one, a little by little.

          

      I have been design the control board for measurement device now.

          

       

          

      It's using Cy8C24794, first time it's been working.

          

      When some change was adding, a port become not make output value.

          

      It's not only one, 2 or 3, a few out port become does not work.

          

      It's a Strong drive and StdCPU.

          

       

          

      I wonder what's happend? And test by other board.

          

      Both was programed a same test design, It's lit LED at first of main()

          

      One is working, the other is not working.

          

       

          

      What a possible causes was happend, Let me know.

         
        • 1. Re: I/O port is breakdown slowly, one by one, a little by little.
          user_1377889

          How is the LED connected to the pin and how are you setting the LED?

             

           

             

          Bob

          • 2. Re: I/O port is breakdown slowly, one by one, a little by little.
            user_14586677

            You might consider posting your project for forum to look at.

               

             

               

            If you have a port with mixed I/O in it, and are doing read modify writes

               

            on the port, you need to use shadow registers. If you use the LED module

               

            to control the :LED it handles that for you, otherwise you have to place and

               

            use the shadow resgisters.

               

             

               

            www.cypress.com/

               

             

               

            www.planetpsoc.com/psoc1-articles-digital/13-basics-of-psoc-gpio.html

               

             

               

            Regards, Dana.

            1 of 1 people found this helpful
            • 3. Re: I/O port is breakdown slowly, one by one, a little by little.
              junichi.hiraoka
                      Bob-san, Dana-san Thank you. The LED whitch I said is one check LED. Actually is 8 photo-cupplers(also LED) These are use 7mA for each. (calculated value) I didn't consider to use shadow resisters. I didn't know usage of shadow resister. Posting my design is no problem cause it use for my hobby device. If/when realy needed I would be..   
              • 4. Re: I/O port is breakdown slowly, one by one, a little by little.
                junichi.hiraoka
                        I got the reason of this problem. I have 8 photocoupler output and also 2 input photocoupler. Some port has output and external input. That is why. We should do this. 1) Access via shadow register. 2) Summarizes the output only to a port.  This was the blind spot of GPIO. Thank you   
                • 5. Re: I/O port is breakdown slowly, one by one, a little by little.
                  junichi.hiraoka
                      

                  Hi Unfortunately, I had mistaken with the previous post.      

                   

                      

                  The port I/O was NOT mixed.      

                   

                      

                  Input is assigned to port-2, Output is assigned to port-3 and 4.      

                   

                      

                  There are no conflict of input and output.      

                   

                      

                  I wonder the the shadow-register is not useful for this.      

                   

                      

                  This is a fact.      

                   

                      

                  At first, CS was broken and I was replace to P4-7.      

                   

                      

                  Next, SCLK was broken.,      

                   

                      

                       

                   

                      
                      

                        

                                

                      

                  Port and Photocoupler Assignments      

                   

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                  PORT No.           

                   

                  Usage           

                   

                  I/O           

                   

                  Remarks           

                   

                  P2-0           

                   

                  RDY          

                   

                  i          

                   

                  ADC Ready (fast change)          

                   

                  P2-2           

                   

                  MISO          

                   

                  i          

                   

                  ADC Data Out to MCU (fast change)          

                   

                  P3-0           

                   

                  INS-A0          

                   

                  O          

                   

                  Slow Switch          

                   

                  P3-2           

                   

                  INS-A1          

                   

                  O          

                   

                  Slow Switch          

                   

                  P3-4           

                   

                  ZERO SW          

                   

                  O          

                   

                  Slow Switch          

                   

                  P3-6           

                   

                  EXT SW          

                   

                  O          

                   

                  Slow Switch          

                   

                  P4-0           

                   

                  DC SW          

                   

                  O          

                   

                  Slow Switch          

                   

                  P4-2           

                   

                  Ex CS          

                   

                  O          

                   

                  ADC Chip Select (broken)          

                   

                  P4-4           

                   

                  SCLK          

                   

                  O          

                   

                  SPI SCLK 2KHz bit clock (broken)          

                   

                  P4-6           

                   

                  MOSI          

                   

                  O          

                   

                  ADC Data In from MCU          

                   

                  P4-5           

                   

                  MCLK          

                   

                  O          

                   

                  ADC Clock (2MHz)          

                   

                  P4-7           

                   

                  New CS          

                   

                  O          

                   

                  ADC Chip Select (replaced to here)          

                   

                      

                        

                                

                      

                        

                                

                      

                        

                                

                      

                        

                                

                      

                        

                                

                      

                        

                                

                      

                        

                                

                      

                   

                      

                   

                      

                   

                      

                   

                      

                   

                      

                   

                      

                   

                      

                   

                      

                   

                      
                      

                  Other pins of Port-4 are not use.>

                      

                        

                                

                      

                  http://skory.gylcomp.hu/alkatresz/P521.pdf      

                   

                      

                        

                                

                      

                  Using TLP521 for photocoupler      

                   

                      

                  The LED has driving through resistor of 510 ohm      

                   

                      

                       

                   

                      
                     
                  • 6. Re: I/O port is breakdown slowly, one by one, a little by little.
                    junichi.hiraoka
                            I find it next suspicious point. P4-5: MCLK is drived global output (PWM output). Other pins are controled by MCU (StdCPU, Strong). It's mean synchronous control, but only P4-5 is Asynchronously and fast. It's very doubtful. I will be try to change this pin to other port. Thank you.   
                    • 7. Re: I/O port is breakdown slowly, one by one, a little by little.
                      junichi.hiraoka
                              It's become to the MyCase matter. Upload the bundle design and pdf. This design is in a progress, is not complete. Treat it "as is" condition. Thank you.   
                      • 8. Re: I/O port is breakdown slowly, one by one, a little by little.
                        user_1377889

                        When strolling through your code I stumbled over your LED_ON / LED_Off macros. You are using read - modify - write to set the appropiate bits which might lead to problems. I strongly suggest you to use the LED-usermodule (to be found under the "Misc Digital" tab. The LED usermodule uses a shadow register internally and is quite useful to drive a oin under program control, not even LEDs.

                           

                        Have a look here for read-modify-write http://www.cypress.com/?rID=39496 

                           

                         

                           

                        Bob

                        1 of 1 people found this helpful
                        • 9. Re: I/O port is breakdown slowly, one by one, a little by little.
                          junichi.hiraoka
                              

                          I'll summarize present state and problem here.      

                           

                              

                          There are 8 output pin and 2 input pin connected to the photocoupler.      

                           

                              

                          Each output is driving current of 7mA.      

                           

                              

                          Output pins and input pins are not mixed into a port.      

                           

                              

                          No conflict will not be occur.      

                           

                              

                          Total current consumption of PSoC board is around 100mA.      

                           

                              

                                 

                           

                              

                          Now I would trying all output drive to be parse through digital-transister.      

                           

                              

                          It's looks working well, but I'll have to watch for a while.      

                           

                              

                          Thank you.      

                           

                              

                                   

                           

                             
                          • 10. Re: I/O port is breakdown slowly, one by one, a little by little.
                            user_14586677

                            The input soide of the photo coupler, the LED, I assume you are driving from

                               

                            an poutput, set to a "1", and that you have a current limiting R in series with

                               

                            pin to LED in the photo coupler ? The R needs to be calculated such that if

                               

                            all photo coupler LEDs are on the sum total of all the drive current meets

                               

                            the specs -

                               

                             

                               

                            1 of 1 people found this helpful
                            • 11. Re: I/O port is breakdown slowly, one by one, a little by little.
                              junichi.hiraoka
                                      Thank you Dana-san, I'm using 510ohm resister for LED series resister, Measured forward voltage is 1.28v, Current is I=( 5-1.28)/510= 7.3mA, Total current is 58.4mA when all are lit. How much about maximum total current of ports? however on datasheet of 8c24794 said, max current is 50mA for each pin. Interface diagram and spec of TLP521 is here. Regards.   
                              • 12. Re: I/O port is breakdown slowly, one by one, a little by little.
                                junichi.hiraoka
                                        The spec of TLP521 is here.   
                                • 14. Re: I/O port is breakdown slowly, one by one, a little by little.
                                  user_14586677

                                  At a Vdd = 5, Iol = 10 mA, Voh = Vdd - 1.0 = 4.0

                                     

                                   

                                     

                                  So Iled = 4.0 / 510 =~ 7.8 mA. Thats sort of a nominal number as you do not

                                     

                                  have worst case Vled, Vdd, temperature, etc....

                                     

                                   

                                     

                                  The port specs are

                                     

                                   

                                     

                                   

                                  1 of 1 people found this helpful
                                  1 2 Previous Next