Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).
I am using the spectrum digital USB example code to interface the tms320c5509a with
labVIEW. Currently I can do a VISA write from labVIEW and a VISA read with everything working
correctly (everything being excited inside the USB_bulkOutEvHandler).
What I would like to do is a VISA read, without first doing a VISA write. I have been trying
to achieve this by having the DSP program call the USB_bulkInEvHandler which posts a
transaction and then doing a VISA read from labview but it does not seem to be working. It
seems like my approach is skipping the USB_evDispatch so it might not be setting up the USB
flags correctly??
There is also the commented section in the example code about using a SWI which might contain
the answer but I do not know how to use it. Any help/example code would be greatly
appreciated.
Here is the code.
void USB_bulkOutEvHandler()
{
// call the bulk out data handler routine.
// if DSP/BIOS used, a SWI can be posted to service the endpoint events.
// All USB event handler routines must be executed in the order the
// actual events arrived - to achieve this, if SWI used, all the USB
// event handler routines must be assigned the same priority level.
USB_bulkOutDatHandler(&usbEpObjIn2, &usbEpObjOut2);
}
void USB_bulkOutDatHandler(USB_EpHandle hEpIn, USB_EpHandle hEpOut)
{
// loop back data received from endpt2 out to endpt2 in
if(USB_isTransactionDone(hEpOut))
if(Endpt2Buff[1]==0x6161)
{
USB_postTransaction(hEpIn, 10, &usb_dataTest, USB_IOFLAG_NOSHORT);
}
else if (Endpt2Buff[1]==0x6262)
{
USB_postTransaction(hEpIn, 1024, output_buf_1K, USB_IOFLAG_NOSHORT);
}
}
/*******************************************************************/
/* Bulk In Event Handlers
*/
/*******************************************************************/
void USB_bulkInEvHandler()
{
// call the bulk in data handler routine.
// if DSP/BIOS used, a SWI can be posted to service the endpoint events.
// All USB event handler routines must be executed in the order the
// actual events arrived - to achieve this, if SWI used, all the USB
// event handler routines must be assigned the same priority level.
USB_bulkInDatHandler(&usbEpObjIn2, &usbEpObjOut2);
}
void USB_bulkInDatHandler(USB_EpHandle hEpIn, USB_EpHandle hEpOut)
{
if(USB_isTransactionDone(hEpIn))
{
// initiate packet read from endpt2 out - up to 64 bytes
USB_postTransaction(hEpOut, 10, &usb_dataTest, USB_IOFLAG_NOSHORT);
}
}
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467