|
|
|
3.6 Why are the 1 MW resistors required in the USB-EPP demo kit?In a self-powered system, when the USB cable is disconnected from the host, the D+ and D- lines will effectively be floating. In a noisy environment (e.g., inside the scanner where there are many high-current components), some switching will occur on the D+/D- lines because of the induced noise. When this happens, the SIE will sometimes be fooled into believing that a Resume signal was generated from the host. The consequence of that is PDIUSBD12 exits out of suspend state due to a false Resume. A 1 MW pull-down resistor is put onto the D- line. Another 1 MW pull-up resistor rests on the D+ line. Note that there is an error on the USB-EPP kit, the pull-up and downs should follow what is mentioned here. 3.7 The suspend pin is shown as an input as well as an output. Explain the behavior.The suspend pin is a bidirectional pin.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| N Clock Division Factor) | CLKOUT |
| 0x00 | 48 MHz (Maximum clocking frequency of PDIUSBD12) |
| 0x01 | 24 MHz |
| 0x02 | 16 MHz |
| 0x03 | 12 MHz |
| 0x04 | 9.6 MHz |
| ... | ... |
| 0x0A | 4.36 MHz |
| 0x0B | 4 MHz (Power up value, Default CLKOUT frequency, Minimum clocking frequency) |
Refer to the section on Suspend.
The CLKOUT frequency is derived from the oscillator (XTAL1, XTAL2 pins). The start-up time for CLKOUT depends on the start-up time of the crystal oscillator. This has been measured to be typically below 2 ms. Since some microcontrollers (for example, the 8051 family) use synchronous reset, the reset circuitry has to be designed to be active for 2 ms to be reset properly.
Reduced C2 (22 pF) to allow quicker starting of the clock. However, the jitter increases as C2 is reduced. Two capacitors of 22 pF and 68 pF are to be used as shown.
The clocking voltage can only take a peak-to-peak voltage of 3.3 V as the internal oscillator is built on a 3.3V core. Hence, to use a 5V external oscillator, it needs to be tied to the Xtal1 pin through a 1 kW resistor.
For data back-to-back access, that is, for both read and write, please maintain the minimum cycle time of 500 ns.

If it is from Write command to Read/Write data, then the access time should be at least 600 ns. This also applies for Read/Write data to Write command. For example, Clear Buffer or Validate Buffer.



When PDIUSBD12 is set to the DMA mode, on receipt of a full packet of data from Endpoint 2, the DMReq is asserted to allow the DMA controller to retrieve the data from the PDIUSBD12's Internal Buffer. The Read_N of the PDIUSBD12 is to be asserted by the DMA Controller. The PDIUSBD12 does not have an internal buffer to keep track how many bytes have been transferred via DMA.
When PDIUSBD12 is set to the DMA mode, there are two conditions in which data from the buffer will be transferred to the host on an IN token:
| When the internal buffer of Endpoint 2 is full (64 bytes), or, | ||
| When the EOT_N signal is asserted on the last packet that is transferred via DMA. |
The DMReq is asserted once the internal buffer is empty and when the DMA enable register is set. Data is swept to the internal buffer when DMACK_N and DMREQ are both active at a WR_N.
The EOT_N signal is generated by an external DMA Controller when the data count goes to zero. If the EOT_N signal is not present, it is recommended that you have an external counter to generate EOT_N at the last packet.
The behavior of DMREQ and DMACK_N are different for single and burst mode. The specifications of PDIUSBD12 on page 18 gives a graphic depiction between the Single and Burst mode.
In a Single DMA transfer mode, DMREQ is asserted for every RD_N or WR_N strobe. Therefore, the number of bytes being transferred can be counted based on the falling edge of the DMREQ.
In a burst DMA mode, the DMREQ is asserted through the burst length which is defined based on the DMA Burst information given in the Set DMA Command (0xFB).
| DMA Configuration Register | Remarks | |
| Bit 1 | Bit 0 | |
| 0 | 0 | Single DMA Transfer mode |
| 0 | 1 | Burst DMA mode. 4 bytes of data is transferred on every assertion of DMREQ unless prematurely ended by EOT_N. |
| 1 | 0 | Burst DMA mode. 8 bytes of data is transferred on every assertion of DMREQ unless prematurely ended by EOT_N. |
| 1 | 1 | Burst DMA mode. 16 bytes of data is transferred on every assertion of DMREQ unless prematurely ended by EOT_N. |

| Name | Minimum | Maximum | Unit |
| tSHAH | 130 | ns | |
| tRHSH | 120 | ns | |
| tAHRH | 330 | ns | |
| tEL | 10 | ns |
PDIUSBD12 can take either 5V or 3.3V inputs. To operate the IC at 5V, supply a 5V voltage to Vcc pin only and left Vout3.3 pin open (decoupled with capacitor). To operate the IC at 3.3V, supply a 3.3V voltage to both Vcc and Vout3.3 pins.
There are typically two output types on the PDIUSBD12: the open drain and normal driving output. The driving strength for each of them is specified on the data sheet. The voltage swing of an open-drain output is dependent on the pull-up resistor on which it is tied to. For the other output pins, they are listed as follows:
When the Vcc pin of PDIUSBD12 is powered from 5V.
| Pin Name | Type | Description | Voltage Swing |
| Data<0..7> | IO2 | Input/Output with driving strength of 2 mA | 5V |
| Suspend | OD4 | Open-Drain, can sink 4 mA | Depends on pull-up |
| Clkout | O2 | Output with 2mA drive | 5V |
| Int_N | OD4 | Open-Drain, can sink 4 mA | Depends on pull-up |
| GL_N | OD8 | Open-Drain, can sink 8 mA | NA |
| DMREQ | O4 | Output with 4mA drive | 5V |
* When the Vcc pin of PDIUSBD12 is powered from 3.3V.
| Pin Name | Type | Description | Voltage Swing |
| Data<0..7> | IO2 | Input/Output with driving strength of 2 mA | 3.3V |
| Suspend | OD4 | Open-Drain, can sink 4 mA | Depends on pull-up |
| Clkout | O2 | Output with 2mA drive | 3.3V |
| Int_N | OD4 | Open-Drain, can sink 4 mA | Depends on pull-up |
| GL_N | OD8 | Open-Drain, can sink 8 mA | NA |
| DMREQ | O4 | Output with 4mA drive | 3.3V |
Note: *When the Vcc of PDIUSBD12 is powered from 3.3V, the internal regulator shuts off. All voltage regulation should be done externally. Therefore, a 3.3V source should be applied to both Vcc and Vout3.3 pins.
The Vout3.3 pin is provided to supply the pull-up voltage of the 1.5K resistor. However, user can also opt to use the internal SoftConnect™ resistor. Loading the Vout3.3 pin apart from this resistor is not recommended.
The user should not be writing or reading by asserting CS_N during DMA when DACK_N is active.
The PDIUSBD12's interrupt pin remains low as long as the Interrupt register is non-zero. Therefore, the microcontroller should be configured to be level-trigger on the interrupt.
In a self-powered system, when the USB connection has been
removed, there may not be any indication to the microcontroller that
the USB cable is disconnected. To detect a disconnection, the EOT_N
pin has dual functionality; that is, to function as an EOT (end of
transfer) during DMA mode and to detect VBUS sensing (The
vbus is the 5V power supply pin from the USB connector).
For VBUS sensing, the EOT_N is connected to the
vbus via a 1 kW resistor and a 1
MW bleeding resistor is required to leak
the charges to ensure that EOT_N goes to zero when vbus
is removed.
So, when the device is in self-power mode and when
the Host is OFF, even if the USB cable is connected, the device will
check the non-availability of VBUS (through the EOT_N
pin) and switch off the internal SOFTCONNECT resistor. This ensures
that the device PDIUSBD12 is disconnected and does not power the D+
line unnecessarily.
When the ALE of D12 is connected to the ALE pin of the microcontroller and the address/data bus is multiplexed, this pin is used by the internal logic to strobe in the information to differentiate between a command and data on the parallel bus. Thus, communicating to D12 will mean that an even address means writing/reading data to D12 and an odd address means writing a command to D12 (The CS_N has to be pulled low during data communications as per normal).
A0 will not be used and should be tied high in this instance.
The PDIUSBD12 is to be treated like any other microprocessor based device. CS_N is connected so that PDIUSBD12 can share the system bus with other devices. In some instance, the CS_N may be grounded all the time. E.g., when D12 is the only device residing on the system bus. If the system bus is shared, additional circuitry may be required to separate PDIUSBD12 from other resources via Rd_N/Wr_N if CS_N is to be grounded.
Example: To glue the MC68331 with PDIUSBD12, the Trhch/Twhch timing for the CS output need to be delayed to match the timing of D12. In this instance, CS_N of D12 can be grounded, and the Rd_N/Wr_N may all be all you need. To separate other devices that shares the same bus, a glue logic can be implemented on Rd_N/Wr_N that is going to D12.
The SetMode Register at 0xF3 has a bit which ties directly to the pull-up resistor on the D+ USB line. When the bit is 1, this means that the pulled-up resistor is enabled. Thus, a host/hub will detect that something has been plugged onto its USB port even though it has been physically connected before the command was issued.
The beauty of using SoftConnect is that it allows the microcontroller to finish its initialization routine first before it notifies the host of its presence. This is especially valuable in a bus-powered device where the 5V power supply must first be stable before enumeration.
To force the Host to do a re-enumeration, the microcontroller could initial a Soft Disconnect by setting the SetMode SoftConnect bit to 0. In doing so, the Host is forced to reload the Host device driver. This allows a device initiated upgrade without user to disconnect and connect the USB cable.
The SetAddress/Enable is required to enable the SIE to respond to the USB request that is directed towards the address preset via SetAdress/Enable. Without enabling, PDIUSBD12 will not respond with the "ACK" or "NAK" token, even though the request is directed to it's preset address.
On power-up, the DMA register may be used to checked for Read/Write error, it is the only register that is availble for Reading and Writing. The user needs to note that on power-up, the auto-reload bit cannot be set at and the DMA enable bit when set does not pull-up the DMA_Req pin.
The DMA register would be cleared upon a bus-reset. Hence, initialized settings to the DMA register will be lost. It is recommended that the DMA register be set to the intended value only after the device has been configured.
Double buffering on Endpoint 2 allows data to be source/sink on the USB bus while the internal buffer is being read/written by the microcontroller or the DMA controller. This increases the overall throughput as the host does not need to wait for the internal buffer to be cleared or filled before feeding or extracting the next packet.
When data is to be extracted from the USB Device to the host, the switching from one buffer that was filled up by the microcontroller to the sending buffer at the USB end is done transparent to the microcontroller. The microcontroller does not have to keep track of which buffer to use, as it always uses the same register to access the IN buffer.
When data is to be received from the Host to the USB Device, the switching from one buffer that was read by the microcontroller to the receiving buffer at the USB end is done transparent to the microcontroller. The microcontroller do not have to keep track of which buffer to use, as it always uses the same register to access the OUT buffer.
The total bytes of Internal Buffer dedicated for USB transfer is 320 bytes.
| Total Bytes | Endpoint 0 | Endpoint 1 | Endpoint 2 | |||
| 320 | = | 16 (IN) + 16 (OUT) | + | 16 (IN) + 16 (OUT) | + | [64 (IN) +64 (OUT)] x 2 (Double Buffered) |
EMI issues are too broad a subject to cover. In general, ferrite beads are to be added on the vbus and the Ground at the input side of the USB connector. One such part is BLM32A07.
It is recommended to have capacitive coupling from the USB Shield to the electrical ground.
This depends on how bright the user wants the LED to be and also the brightness/current rating of the LEDs. Any value from 100 W to 1 kW is normally OK. The evaluation kit recommends a value of 470 W.
The Vendor ID identifies the manufacturer of the USB product. It is used to load the INF file which contains the text string of the Manufacturer and information of which device-driver to load on Windows 98.
The Vendor ID can be obtained by registering with the USB-IF. More information can be obtained on the website at http://www.usb.org/. The Vendor ID (VID) for Philips Semiconductors is 0471. The Product ID (PID) is unique to each USB product.
The VID and PID can be set by simply changing the Device Descriptors on the firmware. This is good for product differentiation as customers maintain their own product identity on Windows 98.
The 6 MHz crystal lowers the risk of having EMI problems later in the production process.
The calculation of the real-time transfer rate is made on every block of 16 Kbytes. The actual derivation formula used is:
Transfer speed (Bytes/s) = 16*1024/Time Spent (seconds).
Where the Time Spent is the completion time of transfer minus the initiated time. The Windows 98 operating system provides a 1 millisec resolution on the Time Spent. In additional, there is random overhead incurred due to system calls from user-mode to kernel mode. All in all, a 2 ms ambiguity would put the variance of the transfer rate to be about 20%.
Whatever the reported transfer rate, it is often the situation that the Host is the bottleneck. It can be verified using a CATC Analyzer that the PDIUSBD12 is fully utilizing the allocation provide by the Host.
The Isochronous pipe guarantees bandwidth regardless of Data Integrity. A Bulk pipe guarantees data integrity, but, delivery is ruled based on "first require first allocate". Hence, on a heavy USB traffic, the Bulk pipe may be starved.
All the signals on the physical layer of USB are designed to be single-end terminated. At any one time, there can only be a transmitter and a receiver. The transmitter, or the driver, is required to have output impedance of between 28 W and 44 W. At the receiving end, the receiver must present an input impedance of > 300KW (exclusive of termination).
When the PDIUSBD12 is in the driving state, the output impedance is between 29W and 44W. The effective impedance inclusive of the parallel pull-up at D+ of 1.5KW and the parallel pull-down at D+/D- of 1 MW does not vary that much with the driving impedance.
During the receiving state, the total impedance is >300 KW even with the 1 MW leakage resistor present.
Place 18 W of resistors in series on the D+. Do the same for the D- line.
