Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > FX2 controller sometimes hangs on startup or on demand

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



FX2 controller sometimes hangs on startup or on demand
Moderator:
RSKV

Post Reply
Follow this topic



FX2 controller sometimes hangs on startup or on demand

GeriB posted on 22 Dec 2011 2:53 PM PST
Senior Member
11 Forum Posts

Hello

I have a custom design with CY7C68013a controller. Most of the time the device including software is working well but sometimes it seems that the there is a startup problem.

The problem occurs at random. Sometimes, after power up (without connecting to a PC), it seems that the controller does not start
Sometimes the controller starts and after I connect the USB cable the controller it hangs
I am also able to set this hanging state if I put my finger to the D+ line of the USB.

I already checked:
Reset circuit
Oscillator (24Mhz) and 22 pf capacitors
power supply should be O.K.
AVCC is separated from VCC by inductor MLB-160808-0300PN

Does anybody have an idea what the problem could be please?

Friendly regards and thak you for your hints in advance

Geri
 




Re: FX2 controller sometimes hangs on startup or on demand

aasi posted on 22 Dec 2011 05:52 PM PST
Cypress Employee
1090 Forum Posts

 Geri,

When you say hangs what is the behavior being seens?

i.e. device not recognized pop-up, you've visual indication designed in which does not happen etc??

Are you seeing this with only one board or all?

Does your board follow the layout guidelines http://www.cypress.com/?rID=12982 ??

Regards,

Anand



Re: FX2 controller sometimes hangs on startup or on demand

GeriB posted on 23 Dec 2011 11:47 PM PST
Senior Member
11 Forum Posts

Hello Anand

Thank you for your fast response. I currently only have one board available.

The USB-Controller is combined with an FPGA. The FPGA gets the clock from the USB-Controller. If the USB chip runs, then I can measure the clock signal (CLKOUT, pin 1 of USB controller) and also the FPGA starts and a led blinks. If it hangs the clock signal  from the USB chip is low.

So also without connecting the USB controller to a PC it sometimes hangs.

I also detected a further point. My power supply is on the same socket as my oscilloscope. If the USB device is connected to the PC and runs and I switch on the oscilloscope, the device will be disconnected for around two seconds an then resatarts working.

The power comes from a laboratory power supply to a DCDC (5V) and then 3.3 V linear regulator. The DCDC is not on board.

I used the layout guidelins for my hardware design. I have a double layer design:) but I studied some working of them. D+ and D- are very short (around 15 mm) without vias, Crystal very short lines (around 10 mm), power supply of the chip should also be OK, reset is done by a ST811TW16F IC.

Thank you for any hints and best regards

Geri

 



Re: FX2 controller sometimes hangs on startup or on demand

aasi posted on 23 Dec 2011 02:30 AM PST
Cypress Employee
1090 Forum Posts

Going by your description these are 2 things I would check

1. Is the power supply stable enough? When the oscilloscope is turned on/off is there a glitch seen on FX2LP supply lines?

2. When CLKOUT goes off (hang condition) what is the state of crystal input i.e. is FX2LP core running but CLKOUT or FX2LP itself is not running

Regards,

Anand



Re: FX2 controller sometimes hangs on startup or on demand

GeriB posted on 23 Dec 2011 03:37 AM PST
Senior Member
11 Forum Posts

Hello Anand

@1: I will think about how to measure this event

@2: The crystal stops to oscillate:

If the crystal oscillates (controller is working) then I can measure 24 Mhz clock with Minimum Peak 1V and maximum peak 1.6 V. I see a sin wave with my 100 MHz-oscilloscope.

If the USB-controller hangs, the crystal stops to oscillate.

Friendly regards and thank you for your help

Gerhard



Re: FX2 controller sometimes hangs on startup or on demand

aasi posted on 23 Dec 2011 08:03 AM PST
Cypress Employee
1090 Forum Posts

Following are few of things that can cause the oscillation to stop

1. The crystal is being overdriven. (Does the crystal used meet all the requirement specified in FX2LP datasheet?)

2. FX2LP is detecting a suspend (is your code written to stay ON when no USB connection is there?)

Regards,

Anand



Re: FX2 controller sometimes hangs on startup or on demand

GeriB posted on 23 Dec 2011 12:19 PM PST
Senior Member
11 Forum Posts

Hello Anand

Thank you very much for your hints!

@1: I know the specification of the crystal but I will replace it on my board.

@2: If the USB cable is not connected to my board then the oscillator is still oscillating.  PA3 is used for USB wakeup.

Then if I put my finger to the D+ line the crystal stops to oscillate. Moste of the time a reset is enough to restart the USB-controller, sometimes not. For my understanding, if the crystal normally do not stop, the USB-controller do not switch to suspend mode.

Attached the code of the main code:

void main(void)
{

...  

EZUSB_IRQ_ENABLE();            // Enable USB interrupt (INT2)
   EZUSB_ENABLE_RSMIRQ();            // Wake-up interrupt

   INTSETUP |= (bmAV2EN | bmAV4EN);     // Enable INT 2 & 4 autovectoring

   USBIE |= bmSUDAV | bmSUTOK | bmSUSP | bmURES | bmHSGRANT;   // Enable selected interrupts
   EA = 1;                  // Enable 8051 interrupts
 

..... 

// Task Dispatcher
   while(TRUE)               // Main Loop
   {
      // Poll User Device
      TD_Poll();

      // Check for pending SETUP
      if(GotSUD)
      {
         SetupCommand();          // Implement setup command
         GotSUD = FALSE;          // Clear SETUP flag
      }

      // check for and handle suspend.
      // NOTE: Idle mode stops the processor clock.  There are only two
      // ways out of idle mode, the WAKEUP pin, and detection of the USB
      // resume state on the USB bus.  The timers will stop and the
      // processor will not wake up on any other interrupts.
      if (Sleep)
      {
         if(TD_Suspend())
         {
            Sleep = FALSE;     // Clear the "go to sleep" flag.  Do it here to prevent any race condition between wakeup and the next sleep.
            do
            {
               EZUSB_Susp();         // Place processor in idle mode.
            }
            while (!Rwuen && EZUSB_EXTWAKEUP());
            // above.  Must continue to go back into suspend if the host has disabled remote wakeup
            // *and* the wakeup was caused by the external wakeup pin.

            // 8051 activity will resume here due to USB bus or Wakeup# pin activity.
            EZUSB_Resume();   // If source is the Wakeup# pin, signal the host to Resume.     
            TD_Resume();
         }  
      }

   }
}
 

Friendly regards

Geri



Re: FX2 controller sometimes hangs on startup or on demand

aasi posted on 23 Dec 2011 01:37 PM PST
Cypress Employee
1090 Forum Posts

A self-power design cannot differentiate between disconnect and suspend condition using USB lines. So a GPIO is needed to do this. Please look at http://www.cypress.com/?docID=4633 for details on VBUS monitoring.

When you plug out the cable the USB lines are floating so they MAY NOT go to idle state as expected. So the USB device (any device for that matter) MAY detect a suspend condition or it MAYNOT. In your case it is not detecting and when you place a finger it is most probably getting grounded and FX2LP is detecting suspend state.

Your code is working with the normal suspend execution (if suspend detected put FX2LP in suspend to meet the current requirement), if you want your design to work under "no USB connection" condition as well then you've modify that routine accordingly. 

Cheers,

Anand



Re: FX2 controller sometimes hangs on startup or on demand

GeriB posted on 24 Dec 2011 04:17 PM PST
Senior Member
11 Forum Posts

Hello Anand

Thank you for the important hint! I changed the firmware according to the datasheet with IO polling method and the USB-Controller works very fine. The problem with the finger also no more exists as the D+ line is switchd off if the USB-cable is not plugged in.

The only problem I still have is the sensitivity against other devices if they are switched on or off. In my case e.g. if I shut off my soldering iron, the USB connection is lost for a short time.
I assume it is someting with the power supply. If you have an idea what I could do to improve the situation, it would be very fine.

Merry Christmas

Geri



Re: FX2 controller sometimes hangs on startup or on demand

aasi posted on 24 Dec 2011 05:14 PM PST
Cypress Employee
1090 Forum Posts

 Observe the supply line of FX2LP to see if the glitch on the line is the reason behind your issue. If so add enough capacitance on the supply to withstand the glitch.

Regards,

Anand



Re: FX2 controller sometimes hangs on startup or on demand

GeriB posted on 26 Dec 2011 04:22 AM PST
Senior Member
11 Forum Posts

Hello Anand


Thank you for your hints. I will try to improve the power supply and let you know about the results. Before I try to do some measurement to get an estimation about its quality.

Friendly regards and thank you very much again!

Gerhard






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20