Hi!
I am using MSP430F5636 in my device to communicate to the PC via USB. I am able to transfer USB data through the MSP430 on TI's target board, but cannot replicate the same USB communication when the device is attached to my new board. The MSP seems to work fine on the new board such that I am able to toggle LEDs, but the USB code does not work at all. Does anybody have any clue about this issue?
I am using an HID example provided in the USB Developer's code During debugging, I found out that the code gets stuck in an infinite while loop in one of the USB files called HAL_USC.c. Here is the while loop, along with the entire function.
uint16_t XT2_Start_Timeout(uint16_t xtdrive, uint16_t timeout){ // Check if drive value is the expected one if ((UCSCTL6 & XT2DRIVE_3) != xtdrive) { UCSCTL6 &= ~XT2DRIVE_3; // Clear XT2drive field UCSCTL6 |= xtdrive; // Set requested value } UCSCTL6 &= ~XT2OFF; while ((SFRIFG1 & OFIFG) && timeout--) { // Check OFIFG fault flag UCSCTL7 &= ~(DCOFFG+XT1LFOFFG+XT1HFOFFG+XT2OFFG); // Clear OSC flaut Flags SFRIFG1 &= ~OFIFG; // Clear OFIFG fault flag } if (timeout) { return UCS_STATUS_OK; } else { return UCS_STATUS_ERROR; }}
Does the new board have a crystal fitted to XT2?
For the USB to operate on the MSP430F5636 a crystal of 4 MHz or greater is required to be fitted to XT2, and it is the XT2_Start_Timeout function which attempts to start the XT2 crystal oscillator.
Thank you for your reply!! Adding in the crystal to XT2 definitely helped, and the board is now able to "detect" the USB device when I connect it to the PC. However, there seems to be some enumeration problem since the PC detects my device as "unknown". If I use the same code on the development kit provided by TI, the device is detected correctly. The only thing that is different on my board and the dev kit is that the MSP is powered externally on the board, while the dev kit powers the MSP via USB. So, I am not sure what must be going wrong in the enumeration stage.
Thanks,