About USBDeviceTasks() in the USB-HID of PIC18F25k50

Discussion in 'General Electronics Chat' started by ahgan84, Dec 12, 2013.

  1. ahgan84

    Thread Starter Member

    Dec 19, 2011
    Hi guys,

    Currently my application of the pic is to become a converter of serial to usb. In other words, whatever I received on my serial side, I will transmit it out using USB port. I'm using baudrate of 9600.
    I know that we have to call USBDeviceTasks() every 1ms right? I put USBDeviceTasks() routine in the main() loop. And I'm using interrupt ISR to receive from serial.
    My problem is, whenever I have large amount of data (around 400 bytes) to received on the ISR of my serial, my USB side will hang. Is it because when I received large amount of data, the program will always be running the ISR routine causing that we need to wait more than 1ms to call USBDeviceTasks() and the USB connection is disconnected?
    How do we connect it back?