Hi all,
I'm working on C/C++ code to get the HDMI framer working on Beaglebone Black. As starter, I try to obtain the version information from the TDA19988 chip. By the datasheet, the I2C address of the HDMI part is 0x70 (the CEC part uses address 0x34). Generating a start condition on address 0x70 on I2C0 generates a NACK error... (The I2C is working, I can read the BoardID eeprom without any problem).
void TDA19988::hdmiRead(uint8_t reg, uint16_t length, uint8_t* pData)
{
uint32_t idx = 0;
m_pI2C->MasterSlaveAddrSet(TDA19988_HDMIAddress);
m_pI2C->MasterIntDisableEx(0xFFFFFFFF);
m_pI2C->MasterEnable();
while(!m_pI2C->SystemStatusGet());
/* First send the register offset - TX operation */
m_pI2C->SetDataCount(1);
// StatusClear();
m_pI2C->MasterIntClearEx(0x7FF);
m_pI2C->MasterControl(I2C_CFG_MST_TX);
m_pI2C->MasterStart();
/* Wait for the START to actually occur on the bus */
while (0 == m_pI2C->MasterBusBusy());
m_pI2C->MasterDataPut(reg);
/* Wait for the Tx register to be empty */
while (0 == m_pI2C->MasterIntRawStatusEx(I2C_INT_TRANSMIT_READY));
m_pI2C->MasterIntClearEx(I2C_INT_TRANSMIT_READY);
while(0 == (m_pI2C->MasterIntRawStatus() & I2C_INT_ADRR_READY_ACESS));
// StatusClear();
m_pI2C->MasterIntClearEx(0x7FF);
m_pI2C->SetDataCount( length);
/* Now that we have sent the register offset, start a RX operation*/
m_pI2C->MasterControl(I2C_CFG_MST_RX);
/* Repeated start condition */
m_pI2C->MasterStart();
while (length--)
{
while (0 == m_pI2C->MasterIntRawStatusEx(I2C_INT_RECV_READY));
pData[idx++] = (uint8_t)m_pI2C->MasterDataGet();
m_pI2C->MasterIntClearEx(I2C_INT_RECV_READY);
}
m_pI2C->MasterStop();
while(0 == (m_pI2C->MasterIntRawStatus() & I2C_INT_STOP_CONDITION));
m_pI2C->MasterIntClearEx(I2C_INT_STOP_CONDITION);
}
The above code is in a loop @ line 27... The I2C status indicates a NACK.
I have checked the settings for clkout1 (GPIO0_19) to make sure it's outputting clock signals to the TDA19988 :
/* clkout1 */
// GPIO0_19 is clkout1 = 24MHz for HDMI Framer (divided by 2 (ic U6 on schematics))
HWREG(SOC_CONTROL_REGS + CONTROL_CONF_XDMA_EVENT_INTR(0)) =
(3 << CONTROL_CONF_XDMA_EVENT_INTR0_CONF_XDMA_EVENT_INTR0_MMODE_SHIFT) |
(1 << CONTROL_CONF_XDMA_EVENT_INTR0_CONF_XDMA_EVENT_INTR0_PUDEN_SHIFT) |
(0 << CONTROL_CONF_XDMA_EVENT_INTR0_CONF_XDMA_EVENT_INTR0_PUTYPESEL_SHIFT)|
(1 << CONTROL_CONF_XDMA_EVENT_INTR0_CONF_XDMA_EVENT_INTR0_RXACTIVE_SHIFT) |
(0 << CONTROL_CONF_XDMA_EVENT_INTR0_CONF_XDMA_EVENT_INTR0_SLEWCTRL_SHIFT);
Any idea ?
Paul