Download Infineon C540U-E User`s Manual
Transcript
On-Chip Peripheral Components C540U / C541U 6.4.4 USB Memory Buffer Address Generation The generation of an USB memory address for USB access (read or write) depends on the EPNum (endpoint number) information, which has been transmitted to the USB module during the software initialization procedure. This EPNum information is used for the selection of an endpoint specific base address register. As the maximum data packet length of each endpoint can individually be programmed, there are some fixed start addresses for the endpoints. The user program defines the base address for the first data byte of the corresponding endpoint by writing the endpoint specific base address register EPBAn. The length depends on the amount of data to be read or written. The user must take care to assign a buffer space at least as large as the maximum packet size of the endpoint. The address of the currently accessed byte in the USB memory area of the selected endpoint is defined by an address offset, which must be added to the endpoint base address in order to get the correct address for the USB memory buffer. The structure is shown in figure 6-39. EPBA 0 PAGE 0 EPBA 1 PAGE 1 EPBA 2 PAGE 2 EPBA 3 PAGE 3 EPBA 4 PAGE 4 0 0 0 A06 A05 A04 A03 0 0 0 A16 A15 A14 A13 0 0 0 A26 A25 A24 A23 0 0 0 A36 A35 A34 A33 0 0 0 A46 A45 A44 A43 MUX Page 1 An6 - An3 EPBAn 0 + ADROFF 0 = USB Memory Addr. 0 EPNum of the Actual Endpoint PAGEn An6 An5 An4 An3 0 0 0 Page 0 0 AO5 AO4 AO3 AO2 AO1 AO0 USB Memory AD6 AD5 AD4 AD3 AD2 AD1 AD0 Note: Only one Bit of the Bit pairs An5/AO5, An4/AO4, An3/AO3 can be set at a time. MCD03411 Figure 6-39 USB Memory Address Generation With the software initialization of the USB modul as described in section 6.4.5, each endpoint is initialized with the EPNum value which is used at the USB memory address generation to select the actual endpoint base address register. Further, in single buffer mode the bit PAGEn is used to select one of the USB memory pages In dual buffer mode bit PAGEn has no effect. Semiconductor Group 6-48 1997-10-01