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

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
    

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.

   
0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

   

 

   

Bob

View solution in original post

0 Likes
20 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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.

Anonymous
Not applicable
        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..   
0 Likes
Anonymous
Not applicable
        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   
0 Likes
Anonymous
Not applicable
    

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      

    

     

    
   
0 Likes
Anonymous
Not applicable
        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.   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        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.   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

Anonymous
Not applicable
    

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.      

    

         

   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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 -

   

 

   

lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        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.   
0 Likes
Anonymous
Not applicable
        The spec of TLP521 is here.   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

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

   

 

   

Anonymous
Not applicable
    

 This might be the problem.      

    

On products, It be make pile of claims.      

    

Even if small number, will be waste the PCB board and Chips.      

    

        

    

I had review a book of PSoC1 then find a description like this.      

    

Output current ability of GPIO is IOH= 40mA but it using by Analog-output.      

    

Besides, On digital-output is IOH=10mA. What is the truth?      

    

If so, 7.3mA might marginal value in my case.      

    

Because have to consider over-shoot or under-shoot.      

    

        

    

Next point is characteristics of Photocoupler LED.      

    

Every diode has a reverse current characteristic.      

    

I had checking it.      

    

        

    

 diode.jpg       

    

When the falling edge,      

    

The difference of forward voltage with reverse voltage is 3.88+1.64=5.52v.      

    

Can it calculated as 10.38mA? (as 7.3mA for forward)      

    

Is it one possibility of this ploblem? I don't know.      

    

Thank you.      

    

      

              

   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The analog output buffer can drive a 32 ohm load to Vdd/2 + 1.3V, for 5V Vdd

   

thats 3.8 / 32 =~ 100 mA. The 40 mA I think is related to Ioh spec, 8 loads,

   

2 ports, 4 loads/port max.

   

 

   

The Ioh spec is total of 8 loads, 4 loads per port max, for a total of 80 mA.

   

 

   

The reverse current is irrelative unless you have very large undershoot, and then

   

you would treat it not as a summation of currents, but another case.

   

 

   

Regards, Dana.

lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        Dana-san Thank you so much for helpful informations. Since through the transister buffer, It been working with no problem. When connect directly a load of relative much current, we have to take care of them. Consider overshoot, undershoot and summarized current for a port. (previous post can't see the image occasionally so upload again)   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Not sure I understand source of 750 nS of undershoot in first scope picture,

   

that cannot be carrier recombination lifetime in LED, way too long I

   

would think.

   

 

   

2'ond picture undershoot looks like "normal" parasitic LC effects.

   

 

   

I think I will take a look at that first case myself. Curious.

   

 

   

Regards, Dana.

lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        This is a page of "Tips of Analog Technology" This undershoot is looks similar with TLP521. 1S1885 is a general rectifier diode. The undershoot is Reverse recovery characteristics (raw translation) A diode which has large undershoot is not suitable for fast switching. Thank you.   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Thats what took me by surprise, the last pic shows a Trr of ~ 80 nS, whereas

   

the LED ~ 750 nS, I just did not imagine an LED could be that bad in carrier

   

recombination.

   

 

   

Regards, Dana.