??? 01/31/06 21:18 Modified: 01/31/06 21:56 Read: times |
#108839 - IN EP interrupt after sending packet Responding to: ???'s previous message |
If D12 sends the packet how it does inform MCU to calling "Control IN Handler" in Interrupt?
Does after sending packet interrupt occurs? IN Endpoint triggers interrupt after sending the packet to host. Please remember, you couldn't get any IN EP interrupt until you fill the IN EP buffer in the mainloop. If the IN EP buffer is not prepared when IN transaction comes, the USB engine on D12 returns NAK to host automatically. And no interrupt occurs (ordinarily, though it can be changed by setting). Host continues to issue IN transaction repeatedly while D12 returns NAK. NAK means "device is not ready, try again". If the IN EP buffer is already filled and validated by the firmware when IN transaction comes, the USB engine sends the data as a packet to host, and trigger an interrupt to request to refill the buffer. that is, IN EP interrupt means 'buffer is empty'. In contrast to this IN EP feature, the action of OUT EP is straightforward. OUT EP triggers an interrupt when it receives packet. OUT EP interrupt means 'buffer is filled'. Summarize it. IN EP: load data first, and wait interrupt. OUT EP: wait interrupt, and unload data. These feature are common to any type of EP, control, interrupt, bulk and isochronous. And common to any device as long as I know, Cypress, Atmel, SiLabs, TI, Philips. When you understand this 'strange' action of IN EP, your basic USB course will finish :-) Maybe, this is the most important point. Tsuneo |