LPC1343 USB Isochronous mode?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1343 USB Isochronous mode?

509 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by BrunoF on Thu Aug 26 16:14:27 MST 2010
Hello There.

I own a LPCXPRESSO with a LPC1343 on it. Im trying to get 4mbps from the USB module, but i get stucked when trying to make an isochronous transfer.

First:
There's no example about it. There are examples of both: bulk and interrupt transfer modes(using CDC,MSC and HID classes) but no one about isochronous. :mad:

So, i first tried modifying the HID example in code-red to work with isochronous. Then i tried adding an isochronous endpoint to the original current HID, without removing the HID original endpoint.
First attempt(removing HID endpoint and changing the descriptors to an isochronous one) seems to fail during initialization according to what i can see with SnoopyPro and other sniffer software.
When Host asks for SELECT_CONFIGURATION, it seems that the device didnt return anything, so Host retrys with same result and ignores any further comunication.

Second attempt supposedly initializes ok. One HID IN endpoint(logical 1 address) and one  ISOCHRONOUS IN endpoint(logical 4 address).

The interrupt transfer, associated with HID class works ok, as the original example, but there are no isochronous transfers at all.
So, i know, im really ignoring something in the uC code, and maybe something in the PC side too.

I changed the line:
#define USB_SOF_EVENT       0
in the usbcfg.c HID example file to
#define USB_SOF_EVENT       1
to activate Start Of Frame Event, that should be associated with isochronous transfers. Then i change the USB_SOF_Event() function to send an isochronous packet every 1ms.

uint8_t    DataOut[512];

#if USB_SOF_EVENT
void USB_SOF_Event (void) {
    uint16_t i;
    static uint32_t counter;

    for(i=0;i<512;i++){
        DataOut = i;
    }

    if(USB_Configuration) USB_WriteEP(0x84, &DataOut[0], 512);
}
#endif

But nothing happens. I cant get it. Looking at the code in "usbcore.c" function descriptions seems that only allows logic endpoints in the range of [0 to 3], so, isochronous transfers cant be handled that way?

What im missing? Im writing incorrectly to the isochronous endpoint? How can i activate the isochronous pipe?

P.S. Sorry, my english isnt very fluid.
Thanks for reading...
0 Kudos
5 Replies

370 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by BrunoF on Wed Mar 20 00:38:28 MST 2013
Oh, im really sorry.

I didn't knew i was receiving posts. Im currently working with Isochronous again.

In that moment it wasn't working because i was missing the first rule of USB: [B]All transactions are initialized by the Host[/B].

So, i was sending an  Isoc IN packet, but the Host wasn't listening to it (no pipe handler opened). So, i wrote a simple software in Host side(PC) that creates the handler, and data began to arrive without problems.

Now i need the opposite: Isoc OUT packets. It works, but i don't know why its missing the first frame (512 byte packet). First time i send a multi-frame packet works ok, but then it wont receive the first frame again. I patched this by software, just sending the first 512 bytes with dummy data, and creating a signature in the second frame to identify the package begining, but i would like to fix this.

I do have the code for OUT transactions. I think i lost the code for IN transactions. But IN transactions are even easier.

@claire chen

Two years later, here i go:

Using FIQ (USB high priority) is pretty similar to using IRQ (USB low priority),

just make sure you have:

USB_SOF_EVENT and USB_FIQ_EVENTset  to 1 in usbcfg.h file.

and of course, you will need a proper usb descriptor, declaring EP 0x84 as Isoc.

Be sure your USB is configured before trying writing/reading to/from an endpoint, checking for USB_Configuration variable.

Remember that EP numbers for Isoc are fixed(0x04 (OUT) and 0x84 (IN)) and size is fixed too: 512 bytes.

So, max speed per EP for this device is 512 bytes in 1ms frame intervals. That's 4mbps(512kBps).
With LPC1768/69 you could achieve almost 8mbps(1023kBps).

Good luck!
0 Kudos

370 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by claire chen on Sat Dec 17 03:42:38 MST 2011
Hello~
I use LPC1343 Isochronous mode and it can enter "FRQ" mode~
As below~ But nothing happen, why?
"USB_WriteEP" is right for Isochronous mode???

void USB_FIQHandler( void )
{
  uint32_t disr;

  disr = LPC_USB->DevIntSt;          /* Device Interrupt Status */
  LPC_USB->DevIntClr = disr;
  if (disr & FRAME_INT)
  {
  USB_WriteEP(0x84, (uint8_t *)&InReport, sizeof(InReport));
  }
  return;
}
0 Kudos

370 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Mon Mar 21 09:28:15 MST 2011

Quote: BrunoF
Made it!

4mbps from PC to the ARM...:D

Thanks anyway.



What did you do to make it work?
0 Kudos

370 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by itdaniher on Mon Mar 21 08:56:05 MST 2011
Hi Bruno,

Do you have the code for your project available? I would like to use isochronous transfers with the LPC1343 for a project I'm working on.

Thanks!
--
Ian
0 Kudos

370 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by BrunoF on Mon Aug 30 22:10:15 MST 2010
Made it!

4mbps from PC to the ARM...:D

Thanks anyway.
0 Kudos