I'm having a really strange problem with the 90USB1287.
I'm messing around with the 90USBKey and Dean's LUFA package. I've built a CDC application that puts data in and out of the SPI rather than the UART. It all works very nicely, except... If I feed the PC end any multiple of 8 bytes at a time, it locks up. Any other number - 7, 9, 127 etc - works perfectly.
Specifically, the lockup happens on the RX endpoint, which in this application has a 16 byte FIFO. I've debugged it down to register level and it seems that register UEINTX, bit RWAL (read write allowed) never sets if it receives a multiple of 8 bytes - although I should qualify that. If I send (say) 21 bytes all at once, it correctly receives one buffer load of 16 (a multiple of 8 ), allows me to unload it, then receives the other 5, and there's no problem. But if the last buffer load it gets from the PC is 8 or 16 bytes, I can unload the 8 or 16 bytes and clear the endpoint, but RWAL doesn't set on the next packet and it's unrecoverable.
So I ask myself, how does it know the PC has finished sending data, so it doesn't lock up if there's more to come? Well being as it's SPI, for every byte received it generates one to send back. Being as these things are asynchronous and happen in microseconds, I can't be sure what order they happen in, but I presume that if there's a large packet coming in from the PC (more than 16 bytes) there isn't time to generate an IN packet before the next OUT packet arrives, so the lockup may be associated with the OUT packet. But that's on a different endpoint, and it doesn't lock up.
Has anyone else here ever come across this effect? I can't find anything written about it, so I have to conclude I'm overlooking something really simple that everyone else knows.