This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
software:linux:jtag [2013/04/23 20:26] – [Intermezzo: JTAG clk signal integrity observations] admin | software:linux:jtag [2015/10/11 20:03] (current) – [TIAO USB Multi Protocol adapter JTAG] admin | ||
---|---|---|---|
Line 312: | Line 312: | ||
Unfortunately the output of this shows no success as it does at the OpenMoko board: | Unfortunately the output of this shows no success as it does at the OpenMoko board: | ||
Found Generic flash chip " | Found Generic flash chip " | ||
- | Instead SPI2 at the TIAO tumpa board which is mapped to port B works better. Connections are: | + | Instead |
- | (SPI2->EEPROM) | + | ^ SPI2 ^ EEPROM |
- | | + | | MISO |
- | | + | | VCC | VCC+/ |
- | * SCK ->CLK | + | | SCK |
- | * MOSI->DI | + | | MOSI |
- | * CS | + | | CS |
- | | + | | GND | GND | |
| {{ http:// | | {{ http:// | ||
Line 332: | Line 332: | ||
</ | </ | ||
Since the only difference between port A and port B is that port A has a 74LVC16T245 buffer IC driving the signals MOSI, CLK and CS via a 56 Ohm resistor, I started bypassing this buffer IC and tested if port A could behave like port B. I noticed then that for proper communication the only signal that had to be bypassed was the CLK signal. By connecting CLK directly to pin 16 (TCLK) of the FT2232HL, the communication worked fine. But as soon as the CLK signal would go via the buffer IC, the CLK output (LVC16T245, pin 2) signal would be degraded to such an extend that communication with the memory chip could not be established properly. After this I understood there is nothing wrong with the TIAO JTAG board.nor with the drivers. The root cause for this is a mismatch between the output impedance of the JTAG board and the relatively long (>20cm) cables. This effect plays a substantial role at high frequency signals, which this interface is running at. I measured a CLK signal of 30Mhz. A simple solution is to shorten the cables. Instead of 20cm I strongly advise to use not more than 10cm.\\ | Since the only difference between port A and port B is that port A has a 74LVC16T245 buffer IC driving the signals MOSI, CLK and CS via a 56 Ohm resistor, I started bypassing this buffer IC and tested if port A could behave like port B. I noticed then that for proper communication the only signal that had to be bypassed was the CLK signal. By connecting CLK directly to pin 16 (TCLK) of the FT2232HL, the communication worked fine. But as soon as the CLK signal would go via the buffer IC, the CLK output (LVC16T245, pin 2) signal would be degraded to such an extend that communication with the memory chip could not be established properly. After this I understood there is nothing wrong with the TIAO JTAG board.nor with the drivers. The root cause for this is a mismatch between the output impedance of the JTAG board and the relatively long (>20cm) cables. This effect plays a substantial role at high frequency signals, which this interface is running at. I measured a CLK signal of 30Mhz. A simple solution is to shorten the cables. Instead of 20cm I strongly advise to use not more than 10cm.\\ | ||
- | As an alternative, | + | As an alternative, |
+ | Lowering the bus frequency, resulted in successful communication. This is clearly a hint that there are issues with signal integrity. With the following command there is success: | ||
+ | ./flashrom -p ft2232_spi: | ||
+ | The frequency of the CLK signal lowered, but not as expected. | ||
+ | According to [[http:// | ||
+ | |||
+ | frequency = 60MHz /((1 + divisor)*2) | ||
+ | |||
+ | The divisor is a 16-bit hex value between 0x0000 and 0xFFFF and represent the amount of 2 divisors which are chained. With a 60Mhz base clock, data rates range between 30MHz and ~460Hz and applies to the FT2232H, according to page 9 of AN 135. This formule will give the 16-bit divisor: | ||
+ | dwClockDivisor=(30000000/ | ||
+ | And code in Application note 114, page 7 and 8 to set the registers: | ||
+ | <code c> | ||
+ | ... | ||
+ | OutputBuffer[dwNumBytesToSend++] = ' | ||
+ | OutputBuffer[dwNumBytesToSend++] = BYTE(dwClockDivisor & ' | ||
+ | OutputBuffer[dwNumBytesToSend++] = BYTE(dwClockDivisor >> 8); //Set 0xValueH of clock divisor | ||
+ | ftStatus = FT_Write(ftHandle, | ||
+ | dwNumBytesToSend = 0; //Clear output buffer | ||
+ | ... | ||
+ | </ | ||
+ | This is rather confusing implemented in flashrom [[http:// | ||
+ | To make measurements easier one can use the following one-liner, which repeats the command and activity on the bus. With this it is easier to analyze the cabling, termination and buffer circuit: | ||
+ | cd $HOME/ | ||
===== Intermezzo: Modifying find_all_pp ==== | ===== Intermezzo: Modifying find_all_pp ==== | ||
The find_all_pp tool will without arguments [[http:// | The find_all_pp tool will without arguments [[http:// | ||
Line 356: | Line 378: | ||
In documentation about the output characteristics(([[http:// | In documentation about the output characteristics(([[http:// | ||
* [[http:// | * [[http:// | ||
- | The flat cable was taken from an old computer diskette drive. It was not 100% clear whether the specifications from belden.com applied actually to this cable. Initially I thought the characteristic impedance was 90 Ohm. Measurements | + | The flat cable was taken from an old computer diskette drive. It was not 100% clear whether the specifications from belden.com applied actually to this cable. Initially I thought the characteristic impedance was 90 Ohm. With channel 1 showing the buffer input signal and channel 2 showing the cable end, measurements |
^ {{ http:// | ^ {{ http:// | ||
| RS=97 Ohm\\ Termination: | | RS=97 Ohm\\ Termination: | ||
Line 375: | Line 397: | ||
| RS=105 Ohm\\ No termination\\ Signal source cable: 1m | | | RS=105 Ohm\\ No termination\\ Signal source cable: 1m | | ||
When compared to the second image which had a 97 Ohm output impedance, the square waveform has less disturbances and enables faster rise times. Two changes may have contributed to this: | When compared to the second image which had a 97 Ohm output impedance, the square waveform has less disturbances and enables faster rise times. Two changes may have contributed to this: | ||
- | * A corrected total buffer output impedance of 105 Ohm, matching | + | * A corrected total buffer output impedance of 105 Ohm, matched |
- | * An additional capacitor at the bottom of the circuit board, | + | * An additional capacitor at the bottom of the circuit board, |
+ | After the modifications I measured the clk signal from the FTDI2232H, going via the buffer: | ||
+ | ^ {{ http:// | ||
+ | | Real clk signal\\ RS=105 Ohm\\ No termination\\ JTAG cable length: 20cm | | ||
+ | The LVC16T245 buffer is causing a delay of about 6ns for the CLK signal. | ||
===== Links and information ===== | ===== Links and information ===== | ||
* [[http:// | * [[http:// |