Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 123697

Forum Post: RE: OMAP L138 OV5640 CAMERA

$
0
0
Hello,

I am also working on raw capture with OMAP-L138 LCDK and LI-M024 DUAL (Aptina sensor). I am having some issues with  i2c communication several days now.More precisely ,I am trying to modify the source code from the project vpif_lcd_loopback.
The execution stucks int the I2CCodecSendBlocking() function  after I get the interrupt " transmitter ready" ( I2C_INTCODE_TX_READY).

                                       Main Function
.
.
.
I2C_MT9M024_Init(SOC_I2C_0_REGS,INT_CHANNEL_I2C,I2C_SLAVE_UI_EXPANDER);
MT9M024_Init(SOC_I2C_0_REGS);
.
.
                                 I2C_MT9M024_Init Function

void I2C_MT9M024_Init(unsigned int baseAddr, unsigned int intCh,
        unsigned int slaveAddr)
{
    unsigned int sysIntNum = 0;

    /* Put i2c in reset/disabled state */
    I2CMasterDisable(baseAddr);

    /* Configure i2c bus speed to 100Khz */
    I2CMasterInitExpClk(baseAddr, 24000000, 8000000, 100000);

    /* Set i2c slave address */
    I2CMasterSlaveAddrSet(baseAddr, slaveAddr);

    I2CMasterEnable(baseAddr);

    /*
     ** Setup the interrupt in AINTC for the i2c module.
     ** If another instance is to be added, this shall include
     ** checking for the other instance base address also.
     */
    if(SOC_I2C_0_REGS == baseAddr)
    {
#ifdef _TMS320C6X
        sysIntNum = SYS_INT_I2C0_INT;
#else
        sysIntNum = SYS_INT_I2CINT0;
#endif
    }

    I2CCodecIntSetup(sysIntNum, intCh);
    UARTPuts("i2c for mt9 done\n ", -1);
}

                                 MT9M024_Init Function

void MT9M024_Init(unsigned int baseAddr)
{
 CameraRegWrite(baseAddr,0x301A, 0x0059);
      Delay(1000000);
 CameraRegWrite(baseAddr,0x301A, 0x0058);
}
 

                                  CameraRegWrite Function


void CameraRegWrite (unsigned int baseAddr,  unsigned int regAddr,  unsigned int regData)
{

#ifdef CODEC_INTERFACE_I2C
    /* Send the register address and data
     * MSB is transmitted first */
//16-bit register address
    slaveData[0] = ((regAddr & 0xFF00 ) >> 8); //msb
    slaveData[1] = (regAddr & 0x00FF);           //lsb

//16-bot data
    slaveData[2] = ((regData & 0xFF00 ) >> 8);  //msb
    slaveData[3] = (regData & 0x00FF);         //lsb


    I2CCodecSendBlocking(baseAddr, 4);
#endif
}

It seems as if the receiver cannot recieve anything....I would appreciate any suggestions for what I am doing wrong.


Viewing all articles
Browse latest Browse all 123697

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>