Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/16/06 19:06
Read: times


 
#107529 - Firmware Programming Guide for D12!
Responding to: ???'s previous message
Firmware Programming Guide for D12 By Philips said:

When the setup packet is received by the USB device D12, this device will generate an interrupt to the MCU.
The microcontroller will need to service this interrupt by reading D12 interrupt register to determine whether the
packet is send to Control Endpoint or the Generic Endpoint. If the packet is for the Control Endpoint, MCU will need to further determine whether the data is a setup packet through reading the D12 Read Last Transaction Status Register. For the Get_Descriptor device request, the first packet will have to be the setup packet.
From the flowchart above, MCU will need to extract the content of the setup packet through Select Control Out Endpoint to determine whether this endpoint is full or empty. If the control endpoint is full, MCU will then read the content from the buffer and save the content to its memory. After that, it will validate the host device's request from the memory. If it is a valid request, MCU must send the Acknowledge Setup command to the Control Out endpoint to re-enable the next setup phase.
Next, MCU will need to verify whether the control transfer is a Control Read/Write. This can be achieved through reading the 8th bit of the bmRequestType from the setup packet. In our case, the control transfer is a Control Read type, that is, the device will need to send data packet back to the host in the coming data phase.
MCU will need to set a flag to indicate that the USB device is now in the transmit mode, that is, ready to send its data upon the host's request.
After the Setup stage is finished, the host will execute the data phase.D12 will expect to receive the Control_In
packet
. The process is shown in the next flowchart, "Control_In Handler". Again, MCU will first need to clear the Control_In interrupt Bit on the D12 by reading its Read Last Transaction Register. Then, MCU will proceed
to send the data packet after verifying that D12 is in the appropriate mode, that is, the Transmit mode.
As D12 control endpoint has only 16 bytes FIFO, MCU will have to control the amount of data during the transmitting phase if the requested length is more than 16 bytes. As indicated on the flowchart, MCU will have to check its current and remaining size of the data to be sent to the host. If the remaining bytes are greater than 16 bytes, MCU will send the first 16 bytes and then subtract the reference length (requested length) by 16.
When the next Control_In token comes, MCU will determine whether the remaining bytes is zero. If there is no more data to send, MCU will need to send an empty packet to inform the host that there will be no more data to be sent over.
If the setup packet is Set_Descriptor() request, then the control transfer in the setup packet will indicate that it is
a Control Write type. After executing the procedure for the Set_Descriptor request, MCU will wait for the data phase. The host will send a Control_Out token and MCU will have to extract the data from the D12 buffer. The flow will now be on the right side of the Control_Out Handler flow sequence. MCU will have to first verify whether D12 is in the USB_Receive mode. Then, MCU will have to verify whether the buffer is full by checking the Select Control_Out Endpoint and read the data out from the buffer.


Joseph,
After sending acknowledge i am expecting Control_In
packet but it don't arrive?
It is my main question.

Mehdi




List of 88 messages in thread
TopicAuthorDate
USB Enumeration Process!!!            01/01/70 00:00      
   USB Design By Example            01/01/70 00:00      
      USB Design By Example            01/01/70 00:00      
         Hi.            01/01/70 00:00      
            Jan Axelson            01/01/70 00:00      
            Salaam            01/01/70 00:00      
               Salaam, Saalam and Thank you.            01/01/70 00:00      
                  fires            01/01/70 00:00      
                     It's out. All is well.            01/01/70 00:00      
                        weather            01/01/70 00:00      
                           Normal Weather            01/01/70 00:00      
                           good for you            01/01/70 00:00      
            D12!            01/01/70 00:00      
               Firmware Programming Guide for D12!            01/01/70 00:00      
                  I'll get back            01/01/70 00:00      
                     Thanks            01/01/70 00:00      
   I don't think you ever send descriptor .            01/01/70 00:00      
      Thanks            01/01/70 00:00      
         Descriptor IDs            01/01/70 00:00      
      But i think i must do!            01/01/70 00:00      
         Edit!            01/01/70 00:00      
            Main Loop            01/01/70 00:00      
               Try USB.org            01/01/70 00:00      
                  I don't know why d12 don't interrupted            01/01/70 00:00      
               I don't know why d12 don't interrupted            01/01/70 00:00      
                  I don't know why d12 don't interrupted            01/01/70 00:00      
                     I don't know why d12 don't interrupted            01/01/70 00:00      
                  Acknowledge setup?            01/01/70 00:00      
                     Thanks Tsuneo ,            01/01/70 00:00      
                        Sorry, I confused            01/01/70 00:00      
                           Sorry, I confused            01/01/70 00:00      
                              Just A Question!            01/01/70 00:00      
                                 It's OK, just for enumeration            01/01/70 00:00      
                                    Any error code on Control In EP?            01/01/70 00:00      
                                       Zero Length Packet !!!            01/01/70 00:00      
                                          ZLP??            01/01/70 00:00      
                                             ZLP??            01/01/70 00:00      
                                                ZLP itself is not the key            01/01/70 00:00      
                                                   the code to write the descriptor            01/01/70 00:00      
                                                      VALIDATE_BUFFER            01/01/70 00:00      
                                                         VALIDATE_BUFFER            01/01/70 00:00      
                                                            VALIDATE_BUFFER            01/01/70 00:00      
                                                               Not exactly            01/01/70 00:00      
                                                                  'Read buffer' and 'Write buffer'            01/01/70 00:00      
                                                                     'Read buffer' and 'Write buffer'            01/01/70 00:00      
                                                                        VALIDATE_BUFFER ?            01/01/70 00:00      
                                                                           VALIDATE_BUFFER ?            01/01/70 00:00      
                                                                              Your code            01/01/70 00:00      
                                                                                 Bulk Mail            01/01/70 00:00      
                                                                                    SEND_REQUESTED_DESCRIPTOR            01/01/70 00:00      
                                                                                       Incredible Progress            01/01/70 00:00      
                                                                                          ZLP on Control-IN            01/01/70 00:00      
                                                                                             Control IN and Control OUT transfer            01/01/70 00:00      
                                                                                                Thanks for your responses,            01/01/70 00:00      
                                                                                                   SET_ADDRESS            01/01/70 00:00      
                                                                                                      Some Questions...            01/01/70 00:00      
                                                                                                         SET_DESCRIPTOR            01/01/70 00:00      
                                                                                                            Control transfer            01/01/70 00:00      
                                                                                                               Control transfer            01/01/70 00:00      
                                                                                                                  the whole picture            01/01/70 00:00      
                                                                                                                     The Whole Picture,Thanks            01/01/70 00:00      
                                                                                                                        IN EP interrupt after sending packet            01/01/70 00:00      
                                                                                                                           Two USB communication procedure            01/01/70 00:00      
                                                                                                            comment...            01/01/70 00:00      
                                                                                             zlp!            01/01/70 00:00      
                                                                                             zlp!            01/01/70 00:00      
                                                         misunderstanding!            01/01/70 00:00      
   send an e-mail to your friendly local Ph            01/01/70 00:00      
   waiting for a techie, so I rummaged a bi            01/01/70 00:00      
   A Question?            01/01/70 00:00      
      declared in bMaxPacketSize            01/01/70 00:00      
   Source Code!            01/01/70 00:00      
      Source is Edited now!            01/01/70 00:00      
      Source is Edited!            01/01/70 00:00      
   D12 Example in "USB Design By Example"            01/01/70 00:00      
   Configuration Descriptor!            01/01/70 00:00      
      The 2nd Get_Descriptor            01/01/70 00:00      
         Thanks Tsuneo            01/01/70 00:00      
            Isn't it the config. desc. request?            01/01/70 00:00      
               Best For You Tsuneo !            01/01/70 00:00      
               Thanks            01/01/70 00:00      
      Strings            01/01/70 00:00      
         Thanks Thomas            01/01/70 00:00      
            Correction            01/01/70 00:00      
               USBView and UVCView            01/01/70 00:00      
               Thanks Thomas            01/01/70 00:00      
   Set DMA Mode!            01/01/70 00:00      
      It's optional            01/01/70 00:00      

Back to Subject List