Other Parts Discussed in Thread: TMP102
I carefully read support/interface/f/138/t/654458.
We are using the 913/914 to move video from a remote device to the main box. The cord is about 6 feet. I need to run the BIST at powerup, and monitor the error registers while running. I followed the sequence in the referred forum post. My I2C master is on the DES. I have a TMP102 temperature I2C device on the SER as an example I2C device to check the link.
I am using an FTDI4222 board for the I2C. USB to the host, where my program is running. The read of the remote TMP102 is good, with proper clock stretching.
What I discovered, in no particular order
1. I set the DES reg x12 = x97. My I2C channel went dead. I could not read my little I2C device on the SER. Changing x12 = x17 fixed that
2. I set SER reg x2D to x0F; set DES reg x42 = x02; start/stop BIST (DES reg x24 = x03; wait 1000 uSec; x24 = x00). The DES reg x25 == 0!!!
3. same thing, but DES reg x42 = x01. DES reg x25 == x0F
4. My problem with this sequence is the BIST does not actually force any errors. All it shows is DES reg x25 is not changed during the BIST. Zero errors are actually injected.
5. Is there a way to actually inject any kind of errors into the video stream? If I am reading the datasheet right. the SER can/does generate a test video if nothing else is going on (not getting a PCLK from the video source, IIRC)
6. I do have a note one can mess with the EQ register values. I am going to try that.
Yours .. bandit
========================= sequence ======================================
#define SER_7ADDR 0x58
#define SER_8ADDR 0xB0
#define DES_7ADDR 0x60
#define DES_8ADDR 0xC0
#define TMP102_7ADDR 0x48
#define TMP102_8ADDR 0x90
I2C_TBL setup_back_channel_tbl[] =
{
//==============================================================
// setup the I2C backchannel
// { TBL_ACT_STR, 0, "enable back channel" },
//
// reg x01 = x06: enable back channel; reset logic
// reg x01 = x05: enable back channel; reset logic + regs
//==============================================================
// len slave data
{ TBL_ACT_WRITE, 2, DES_7ADDR, 0x01, 0x05 }, // enable bk ch
{ TBL_ACT_DELAY, 100 }, // delay 100 millisec
{ TBL_ACT_WRITE, 2, DES_7ADDR, 0x03, 0xE9 }, // I2C passthru
{ TBL_ACT_WRITE, 2, DES_7ADDR, 0x21, 0x17 }, // I2C passthru
//==============================================================
// the TMP102 remap
// { TBL_ACT_STR, 0, "remap TMP102" },
//==============================================================
{ TBL_ACT_WRITE, 2, DES_7ADDR, 0x08, TMP102_8ADDR }, // Slave ID[1]
{ TBL_ACT_WRITE, 2, DES_7ADDR, 0x10, TMP102_8ADDR }, // Slave Alias[1]
//==============================================================
// read the DES DEV ID
// { TBL_ACT_STR, 0, "read 914 DES DEV_ID s/b SER_8ADDR" },
//==============================================================
{ TBL_ACT_WRITE, 1, DES_7ADDR, 0x06 }, // write reg x06
{ TBL_ACT_READ, 1, DES_7ADDR, /* rd buf */ }, // read the register
//==============================================================
// read the DES initial err count
//==============================================================
{ TBL_ACT_WRITE, 1, DES_7ADDR, 0x25 }, // BIST err count reg
{ TBL_ACT_READ, 1, DES_7ADDR, /* rd buf */ }, // read the count
//==============================================================
// According to the 914 datasheet:
// set 913 reg x2D [6:0] = the desired BIST err count
// set 914 reg x24 = 0x03 to put the 914 in BIST mode
// set 914 reg x24 = 0x08 to put the 914 in regular mode
// read 914 reg x25 for the BIST err count
//==============================================================
// According to BIST force error 913_914.txt
// this is the SER init
//==============================================================
//
// x03 = xE5 resets the CRC error count
// x03 = 80 = RX CRC Checker Enable
// 40 = TX Parity Generator Enable
// 20 = CRC Error Reset
// 04 = I2C passthrough
// 01 = TRFB = parallel interface strobed on rising edge
// --
// E5 = first to reset the CRC error count
// C5 = ready to run (x20 bit NOT auto reset)
//==============================================================
#if 1
{ TBL_ACT_WRITE, 2, SER_7ADDR, 0x03, 0xE5 },
{ TBL_ACT_WRITE, 2, SER_7ADDR, 0x03, 0xC5 },
{ TBL_ACT_DELAY, 10 }, // delay 10 millisec - needed?
#endif
//==============================================================
// read the temp sensor to makke sure everything setup
//==============================================================
#define DO_BIST 1
#if DO_BIST
//==============================================================
// write the err count
// this works:
// { TBL_ACT_WRITE, 2, SER_7ADDR, 0x2D, 0x0F }, // set exp err count
// set BIST mode ON
// Delay (not sure really needed)
// set BIST mode OFF
// 914 reg x25 == x0F
//
// The 913 datasheet says hitting the (self-clearing) bit x80
// will incr the count. Wht it really does is set [6:0]
// to 0 (because 0x80 [6:0] == 0)
// The real result id the '914 x25 == 0
// { TBL_ACT_WRITE, 2, SER_7ADDR, 0x2D, 0x80 }, // inject err
// { TBL_ACT_WRITE, 2, SER_7ADDR, 0x2D, 0x80 }, // inject err
//
// BIST force error 913_914.txt insits on a sleep(1)
// not sure why && sleep(1) is in sec or milliSec
//==============================================================
{ TBL_ACT_WRITE, 2, SER_7ADDR, 0x2D, 0x0F }, // set expected err count
{ TBL_ACT_DELAY, 10 }, // delay 10 millisec
//==============================================================
// supposed to inject CRC errors
//==============================================================
{ TBL_ACT_WRITE, 2, DES_7ADDR, 0x42, 0x01 }, // force CRC
//==============================================================
// start BIST - we are going thru the DES
// { TBL_ACT_STR, 0, "start BIST" },
// wait 100 mSec
// stop BIST
//==============================================================
{ TBL_ACT_WRITE, 2, DES_7ADDR, 0x24, 0x03 }, // start BIST
{ TBL_ACT_DELAY, 1000 }, // delay 1000 millisec
{ TBL_ACT_WRITE, 2, DES_7ADDR, 0x24, 0x00 }, // stop BIST
{ TBL_ACT_DELAY, 100 }, // delay 100 millisec
//==============================================================
// look at the error counts
// { TBL_ACT_STR, 0, "BIST err count before read 0" },
//==============================================================
// { TBL_ACT_MARK },
{ TBL_ACT_WRITE, 1, DES_7ADDR, 0x25 }, // BIST err count reg
{ TBL_ACT_READ, 1, DES_7ADDR, /* rd buf */ }, // read the count
// { TBL_ACT_GOTO },
#endif // DO_BIST
//======================================================
// read the sensor to make sure I2C path works
//======================================================
#if 1 // read temp sensor
//======================================================
// loop, reading the temp sensor
// BIST mode OFF
// read the TMP102 slave at the end of the I2C cghain
// (loop until ctl-C)
//======================================================
{ TBL_ACT_MARK },
{ TBL_ACT_READ, 2, 0x48, /* rd buf */ }, // read TMP102
{ TBL_ACT_DELAY, 100 }, // delay 100 millisec
{ TBL_ACT_GOTO }, // loop to TBL_ACT_MARK
#endif // read temp sensor
//======================================================
// table end
//======================================================
{ TBL_ACT_END, 0, {} }
};
================================= results =============================
== init DES
writing 2: 01 05
I2C master write data to the slave(0X60)...
writing 2: 03 E9
I2C master write data to the slave(0X60)...
writing 2: 21 17
I2C master write data to the slave(0X60)...
writing 2: 08 90
I2C master write data to the slave(0X60)...
writing 2: 10 90
I2C master write data to the slave(0X60)...
writing 1: 06
I2C master write data to the slave(0X60)...
I2C master read 1 bytes data from the slave(0X60)...
exp(1) just read 1 bytes: B0
=== read the error count
writing 1: 25
I2C master write data to the slave(0X60)...
I2C master read 1 bytes data from the slave(0X60)...
exp(1) just read 1 bytes: 00
=== SER init
writing 2: 03 E5
I2C master write data to the slave(0X58)...
writing 2: 03 C5
I2C master write data to the slave(0X58)...
=== BIST: setting error count to <> 0
writing 2: 2D 0F
I2C master write data to the slave(0X58)...
=== supposed to inject an error
writing 2: 42 01
I2C master write data to the slave(0X60)...
=== Start/Stop BIST (1000 uSec delay)
writing 2: 24 03
I2C master write data to the slave(0X60)...
writing 2: 24 00
I2C master write data to the slave(0X60)...
=== Read error count
writing 1: 25
I2C master write data to the slave(0X60)...
I2C master read 1 bytes data from the slave(0X60)...
exp(1) just read 1 bytes: 0F
=== read TMP102 to make sure I2C works
I2C master read 2 bytes data from the slave(0X48)...
exp(2) just read 2 bytes: 18 70
I2C master read 2 bytes data from the slave(0X48)...
exp(2) just read 2 bytes: 18 80