lpc2468 isochronous usb transfer help

Started by Gurkan Karakus March 26, 2014
Hello friends,

I am trying to send audio data to usb audio class device. For this, i am using below code to schedule an isochronous transfer but couldnt acheive it.
steps1. on device initialization code (on device attached step), setup an isochronous transfer2. when isochronous transfer completes (in Writeback Done Head interrupt) setup another isochronous transfer .. so on
USB_INT32S Host_ProcessIsoTD (volatile HCED* ed, volatile USB_INT08U* buffer, USB_INT32U buffer_len){ int i = 0; USB_INT32U FrameNumber;
FrameNumber = Hcca->FrameNumber; FrameNumber = (FrameNumber + 1 ) & 0xFFFF;
TDIsoHead->Control = TD_CC | (FrameNumber << 5); TDIsoTail->Control = 0; TDIsoHead->BuffPage = (((USB_INT32U) buffer) & 0xFFFFF000) ; TDIsoTail->BuffPage = 0; TDIsoHead->Next = (USB_INT32U) TDIsoTail; TDIsoTail->Next = 0;
TDIsoHead->BufEnd = (USB_INT32U)(buffer + (buffer_len - 1 )); TDIsoTail->BufEnd = 0;
for (i=0; i< 8 ; i++) { TDIsoHead->OffsetX[i] = ( /*(1<<12) |*/ 0xE << 12 | ( ((USB_INT32U) buffer) & 0x0FFF) ) ; TDIsoTail->OffsetX[i] = 0; } ed->HeadTd = (USB_INT32U)TDIsoHead ; ed->TailTd = (USB_INT32U)TDIsoTail; ed->Next = 0; for (i=0; i<32; i++) Hcca->IntTable[i] = (USB_INT32U)ed; HcControl = HcControl | OR_CONTROL_IE | OR_CONTROL_PLE ; return (SUCCESS);}

What i see in usb analyser is:OUT transaction time-> 179.018 (second.milisecond)OUT transaction time-> 180.010 OUT transaction time-> 211.757 OUT transaction time-> 244.527 OUT transaction time-> 244.559 OUT transaction time-> 245.551 OUT transaction time-> 277.298 OUT transaction time-> 310.068
transfers should be at 1 ms intervals...
Thank you in advance
Gurkan

An Engineer's Guide to the LPC2100 Series

Ok I solved problem.
TDIsoHead->Control = TD_CC | (FrameNumber << 5);should beTDIsoHead->Control = TD_CC | FrameNumber;

To: l...
From: g...@hotmail.com
Date: Wed, 26 Mar 2014 08:46:07 +0000
Subject: [lpc2000] lpc2468 isochronous usb transfer help

Hello friends,

I am trying to send audio data to usb audio class device. For this, i am using below code to schedule an isochronous transfer but couldnt acheive it.
steps1. on device initialization code (on device attached step), setup an isochronous transfer2. when isochronous transfer completes (in Writeback Done Head interrupt) setup another isochronous transfer .. so on
USB_INT32S Host_ProcessIsoTD (volatile HCED* ed, volatile USB_INT08U* buffer, USB_INT32U buffer_len){ int i = 0; USB_INT32U FrameNumber;
FrameNumber = Hcca->FrameNumber; FrameNumber = (FrameNumber + 1 ) & 0xFFFF;
TDIsoHead->Control = TD_CC | (FrameNumber << 5); TDIsoTail->Control = 0; TDIsoHead->BuffPage = (((USB_INT32U) buffer) & 0xFFFFF000) ; TDIsoTail->BuffPage = 0; TDIsoHead->Next = (USB_INT32U) TDIsoTail; TDIsoTail->Next = 0;
TDIsoHead->BufEnd = (USB_INT32U)(buffer + (buffer_len - 1 )); TDIsoTail->BufEnd = 0;
for (i=0; i< 8 ; i++) { TDIsoHead->OffsetX[i] = ( /*(1<<12) |*/ 0xE << 12 | ( ((USB_INT32U) buffer) & 0x0FFF) ) ; TDIsoTail->OffsetX[i] = 0; } ed->HeadTd = (USB_INT32U)TDIsoHead ; ed->TailTd = (USB_INT32U)TDIsoTail; ed->Next = 0; for (i=0; i<32; i++) Hcca->IntTable[i] = (USB_INT32U)ed; HcControl = HcControl | OR_CONTROL_IE | OR_CONTROL_PLE ; return (SUCCESS);}

What i see in usb analyser is:OUT transaction time-> 179.018 (second.milisecond)OUT transaction time-> 180.010 OUT transaction time-> 211.757 OUT transaction time-> 244.527 OUT transaction time-> 244.559 OUT transaction time-> 245.551 OUT transaction time-> 277.298 OUT transaction time-> 310.068
transfers should be at 1 ms intervals...
Thank you in advance
Gurkan