2008年12月22日星期一

Tip: Reset and Chirp process when use USB3500 as USB HOST's PHY

In USB3500 datasheet 7.14 “USB Reset and Chirp”, the reset and chirp process is detailed described using one figure and the description text. But if you do the reset and chirp process following the instruction of the figure, you may not get the correct result.
As show in the following figure (Figure 7.9), first you set xcvrselect = 2'b01, termselect = 1'b1 and opmode = 2'b00 before reset to detect device attachment (T0~T2); then you set xcvrselect = 2'b00, termselect = 1'b0 and opmode = 2'b00 to drive SE0 on bus (T2~T3); then you wait ChirpK on bus to translate to the next state, but you can not watch ChirpK on bus through the reset process using the current setting (xcvrselect/termselect/opmode), this is the problem. Why?
As we know, we can not see the DP/DM by using USB3500. We can only get the bus status through linestate. In USB3500 datasheet 7.1 “Linestate”, it gives the usage and meaning of linestate under different conditions. We can see in Table 7.2, when XCVRSEL[1:0] = 00, TERMSELECT = 0 and OPMODE = 00/01, the only valid linestate value is 00 (SE0) or 01 (J-state). So if we set xcvrselect = 2'b00, termselect = 1'b0 and opmode = 2'b00 in T2~T3, even the device drives ChirpK on bus, we can only get J state on bus.
Solution:
From Table 7.2, we know that in order to see the ChirpK on bus, we must set opmode to 2'b10. So there are two solutions to resolve this problem.
1. Set xcvrselect = 2'b00, termselect = 1'b0 and opmode = 2'b10 in T2~T3. As opmode = 2'b10 only have meanings when host drives ChirpJ/ChirpK (Disable bit stuffing and NRZI encoding), this setting can work well when host drives SE0 on bus. With this setting, design can get the correct ChirpK from linestate at T3.
This method is simple but it may seem a little different with the datasheet.
2. At T2~T3, the bus state is SE0 and then the actual bus state is ChirpK, but due to opmode setting (opmode = 2'b00), the linestate value is 2'b01 (J-state). So we can detect the bus state transition between T2 and T3. If we detect the bus state (linestate) changes from 2'b00 to 2'b01, then we set opmode = 2'b10 to observe the ChirpK from linestate.
Both methods work well and can get the correct reset and chirp process.

没有评论: