Hi All , Presently Iam working on LPC2468 OEM board for developing USB Device Stack using KEIL uVision2 IDE.
I want to see the connection and removal status when i insert and remove the Device from Host Port.But Iam unable to see those status in my code.
I am configuring the VBUS pin as GPIO Input(Fast GPIO)(Pin no.1.30) according to the errara sheet.After that Keep on poll it to determine when VBUS goes to zero signalling disconnect event.
Iam giving my code below:
main( ) { volatile CPU_INT32U regVal; regVal = PINSEL3; regVal &= 0xcfffffff; /* configure as GPIO */ PINSEL3 = regVal; regVal = SCS; regVal &= 0xfffffffe; regVal |= 0x01; /* as FAST IO */ SCS = regVal; regVal = FIO1DIR; regVal &= ~0x40000000; FIO1DIR = regVal; /* Set as Input pin */ while(1) { regVal = FIO1MASK; /* check the mask value */ regVal &= 0x40000000; if (regVal == 0) { regVal = FIO1PIN; /* get status of the PIN */ regVal &= 0x40000000; if (regVal == 0) { Printf(">>> CLEAR <<<<\n"); } else { Printf(">>> SET <<<<\n"); } } DelayMS(1000) ; /* kept some delay for our purpose */ } }
When excuting this program iam inserting and removing the device iam unable to see the changed status values?It is always giving the SET messgage if i remove/insert? "Device means only the usb cable (vbus,d+,d-, gnd)" and iam not talking about softconnect feature.
What is the mistake in the above code and How can i test inert/remove the device.