Hi Tsueno,
I disconnect the two resistor between VBUS and the port n.33 of the microC. Now the situation is: pin 1 of the USB connector is attached with ferrite and there is a polarized cap (4.7uF) in series with the ferrite.
In this configuration when VBUS in supplied but POWER SOURCE is not supplied VDD pin of the microC is about 20mV.
If VDD is supplied and VBUS is not supplied, the VBUS is about 1.70 - 1.80 V
Now the measure table, at the monet I have no external microC pin for detach when USB is connected, so I use this code, inseide the routine USB_CHECK_STATUS:
void Check_USB_Status(void){ //#ifdef SELF_POWER // if(PTCD_PTCD0 == USB_BUS_ATTACHED) /* Is JM60 attached on USB bus? */ //{ // #endif if(CTL_USBEN == 0) /* JM60 module off ? */ { EPCTL0 = 0x0D; INTSTAT = 0xBF; CTL = 0x00; INTENB = 0x00; /* disable USB interrupt*/ CTL_USBEN = 0x01; /* enable module */ USBCTL0 = UCFG_VAL; /* attach JM60 to USB bus*/ Usb_Device_State = ATTACHED_STATE; } //#ifdef SELF_POWER //} //else //{ // if(CTL_USBEN == 1) /* JM60 USB on ?*/ // { // CTL = 0x00; /* disable module */ // INTENB = 0x00; /* mask USB interrupt*/ // Usb_Device_State = POWERED_STATE; //} //} ////#endif if(Usb_Device_State == ATTACHED_STATE) { INTSTAT = 0xBF; /*clear USB interrupts*/ INTENB = 0xBF; } if(Usb_Device_State == USB_ENTER_SUSPEND) { // USB_Suspend(); }}
VDD VBUS | Vusb33
___________________
off off | at the begining 133mV, after some second (about 20) it is 5mV
off on | 130mV
on off | 1,40V
on on | 3,54 V.
If the microC does not restart but VDD is supplied and VBUS is SUPPLIED Vusb33 is about 130mV
THIS is the hardware connection of the microC USB pin:
- microC pin n. 59 ithe VBUS pin, it is connect betwenn the ferrite and the polarized cap. Ferrite and the cap is connected at the pin n.1 of mini -USB connector.
- microC pin. n.58 is connected with a 33 ohm resitor in series at a pin n.2 of the mini - USB connector.
- microC pin. 57 is connected with a 33ohm resistor in series at a pin n.3 of the mini- USB connector.
- microC pin n.56 is the VUSB33, it is connect with a 100nF capacitor.
It is this hardware connection right?
There is always a strange microC behavior when I attached and I detached the POWER SOURCE: sometime the microC does not restart. Vdd microC pin is not high, it is 130mV immediatly after the POWER SOURCE disconnect and after 20 second the VDD pin of the microC is about 20 - 30mV.
Today I attached port n.56 of the microC, VBUS33, directly to another pin of the microC with the aim to detach when USB is connect/disconnect. Well, strange thing was append: my device is a SELF POWER application, so when VDD and VBUS is on the VDD pin of the micro must be low. So if I the device is supplied and the VBUS is also supply and I decide to detached the POWER SOURCE I will aspoect that the microC is not supplied. But with my great surprise I discover that the VDD pin of microC is about 2.5V and after some minutes it is 20mV. If I not connect VUSB33 microC pin to another microC this problem does not appear.
Thank in advice
Francesco