PDA

View Full Version : TI TMS320DM642, I2C module and APIs


phuture_project
03-23-2005, 07:59 AM
Hi,

I'm using the TMS320DM642 and need to configure the registers of a
video decoder thanks to the I2C module.

I read all the documentations TI provides and there still remain
questions. I hope someone will help me.

1) When we use the I2C_start() function does it test the NACK bit ?
Apparently no!
2) Why do they never test the NACK bit ?
3) When we set a value in the I2CDXR register is this value
automatically sent ? The I2CXRDY bit indicates that the data has been
copied from the DXR register to the XSR one but not if the whole data
have been sent, am i wrong ?
4) What is the interest of the ARDY bit ?

Thanks a lot.

phuture_project
03-24-2005, 03:56 PM
Up !

[email protected] (phuture_project) wrote in message news:<[email protected]>...
> Hi,
>
> I'm using the TMS320DM642 and need to configure the registers of a
> video decoder thanks to the I2C module.
>
> I read all the documentations TI provides and there still remain
> questions. I hope someone will help me.
>
> 1) When we use the I2C_start() function does it test the NACK bit ?
> Apparently no!
> 2) Why do they never test the NACK bit ?
> 3) When we set a value in the I2CDXR register is this value
> automatically sent ? The I2CXRDY bit indicates that the data has been
> copied from the DXR register to the XSR one but not if the whole data
> have been sent, am i wrong ?
> 4) What is the interest of the ARDY bit ?
>
> Thanks a lot.

phuture_project
03-29-2005, 07:02 AM
UP!

[email protected] (phuture_project) wrote in message news:<[email protected]>...
> Up !
>
> [email protected] (phuture_project) wrote in message news:<[email protected]>...
> > Hi,
> >
> > I'm using the TMS320DM642 and need to configure the registers of a
> > video decoder thanks to the I2C module.
> >
> > I read all the documentations TI provides and there still remain
> > questions. I hope someone will help me.
> >
> > 1) When we use the I2C_start() function does it test the NACK bit ?
> > Apparently no!
> > 2) Why do they never test the NACK bit ?
> > 3) When we set a value in the I2CDXR register is this value
> > automatically sent ? The I2CXRDY bit indicates that the data has been
> > copied from the DXR register to the XSR one but not if the whole data
> > have been sent, am i wrong ?
> > 4) What is the interest of the ARDY bit ?
> >
> > Thanks a lot.

phuture_project
03-31-2005, 09:33 AM
Hello ???!!!


[email protected] (phuture_project) wrote in message news:<[email protected]>...
> UP!
>
> [email protected] (phuture_project) wrote in message news:<[email protected]>...
> > Up !
> >
> > [email protected] (phuture_project) wrote in message news:<[email protected]>...
> > > Hi,
> > >
> > > I'm using the TMS320DM642 and need to configure the registers of a
> > > video decoder thanks to the I2C module.
> > >
> > > I read all the documentations TI provides and there still remain
> > > questions. I hope someone will help me.
> > >
> > > 1) When we use the I2C_start() function does it test the NACK bit ?
> > > Apparently no!
> > > 2) Why do they never test the NACK bit ?
> > > 3) When we set a value in the I2CDXR register is this value
> > > automatically sent ? The I2CXRDY bit indicates that the data has been
> > > copied from the DXR register to the XSR one but not if the whole data
> > > have been sent, am i wrong ?
> > > 4) What is the interest of the ARDY bit ?
> > >
> > > Thanks a lot.

Andor
03-31-2005, 09:46 AM
Some might have noticed that nobody here seems to know anything about
this issue. Others obviously didn't. Try the TI hotline.

Regards
Andor

Mark Robinson
03-31-2005, 01:40 PM
phuture_project wrote:
> I'm using the TMS320DM642 and need to configure the registers of a
> video decoder thanks to the I2C module.

Don't know if it helps, but since no-one else has replied, this is
the code that TI use to talk to the SAA7115 on the DM642 EVM -

#define I2CDELAY(iterations) { \
volatile Int j; \
for(j = 0; j < iterations; j ++); \
}
#define DELAY_TIME 1000

static const I2C_Config EVM642VIDEOIIC_Config = {
0, /* master mode, i2coar; */
0, /* no interrupt, i2cimr; */
(20-5), /* scl low time, i2cclkl; */
(20-5), /* scl high time,i2cclkh; */
1, /* configure later, i2ccnt;*/
0, /* configure later, i2csar;*/
0x4620, /* master tx mode, */
/* i2c runs free, */
/* 8-bit data + NACK */
/* no repeat mode */
(75-1), /* 4MHz clock, i2cpsc */
};

void _IIC_write(I2C_Handle hI2C,
Uint8 devAddress,
Uint32 subAddress,
Uint8 *data,
Uint16 numBytes
)
{
Int i;
I2C_Config prevIICConfig;

/* make sure handle is valid */
if(hI2C == INV) {
return;
}
/* Wait until bus is free */
while (I2C_bb(hI2C));
/* save old settings */
I2C_getConfig(hI2C, &prevIICConfig);
/* set I2C mode register */
I2C_RSETH(hI2C, I2CMDR, EVM642VIDEOIIC_Config.i2cmdr);
/* set I2C imr register */
I2C_RSETH(hI2C, I2CIMR, EVM642VIDEOIIC_Config.i2cimr);
/* configure the I2C slave address register */
I2C_RSETH(hI2C, I2CSAR, devAddress);
/* set I2C count register */
I2C_RSETH(hI2C, I2CCNT, numBytes + 1);
/* write the sub address */
I2C_RSETH(hI2C, I2CDXR, subAddress);
/* Generate start condition */
I2C_start(hI2C);
I2CDELAY(DELAY_TIME);
/* write the data */
for(i = 0; i < numBytes; i ++) {
while(!I2C_xrdy(hI2C));
I2C_writeByte(hI2C, *data ++);
I2CDELAY(DELAY_TIME);
}
/* Generate stop condition */
I2C_sendStop(hI2C);
I2CDELAY(DELAY_TIME);
/* Wait until bus is free */
while (I2C_bb(hI2C));
I2CDELAY(DELAY_TIME);
/* now restore the previous I2C settings */
/* set I2C mode register */
I2C_RSETH(hI2C, I2CMDR, prevIICConfig.i2cmdr);
/* set I2C imr register */
I2C_RSETH(hI2C, I2CIMR, prevIICConfig.i2cimr);
/* configure the I2C slave address register */
I2C_RSETH(hI2C, I2CSAR, prevIICConfig.i2csar);
/* set I2C count register */
I2C_RSETH(hI2C, I2CCNT, prevIICConfig.i2ccnt);
I2CDELAY(DELAY_TIME);
}

Cheers

mark-r

--
"Let's meet the panel. You couldn't ask for four finer comedians -
so that answers your next question..."
-- Humphrey Lyttleton

phuture_project
04-04-2005, 08:19 AM
Thanks for your answer Mark.

I've already seen this code but thanks anyway.

I even contacted TI support but they only repeated what it is said on
their datasheets!

So I'll try to see how it really works now that i have access to the
"workstation"!



Mark Robinson <[email protected]> wrote in message news:<[email protected]>...
> phuture_project wrote:
> > I'm using the TMS320DM642 and need to configure the registers of a
> > video decoder thanks to the I2C module.
>
> Don't know if it helps, but since no-one else has replied, this is
> the code that TI use to talk to the SAA7115 on the DM642 EVM -
>
> #define I2CDELAY(iterations) { \
> volatile Int j; \
> for(j = 0; j < iterations; j ++); \
> }
> #define DELAY_TIME 1000
>
> static const I2C_Config EVM642VIDEOIIC_Config = {
> 0, /* master mode, i2coar; */
> 0, /* no interrupt, i2cimr; */
> (20-5), /* scl low time, i2cclkl; */
> (20-5), /* scl high time,i2cclkh; */
> 1, /* configure later, i2ccnt;*/
> 0, /* configure later, i2csar;*/
> 0x4620, /* master tx mode, */
> /* i2c runs free, */
> /* 8-bit data + NACK */
> /* no repeat mode */
> (75-1), /* 4MHz clock, i2cpsc */
> };
>
> void _IIC_write(I2C_Handle hI2C,
> Uint8 devAddress,
> Uint32 subAddress,
> Uint8 *data,
> Uint16 numBytes
> )
> {
> Int i;
> I2C_Config prevIICConfig;
>
> /* make sure handle is valid */
> if(hI2C == INV) {
> return;
> }
> /* Wait until bus is free */
> while (I2C_bb(hI2C));
> /* save old settings */
> I2C_getConfig(hI2C, &prevIICConfig);
> /* set I2C mode register */
> I2C_RSETH(hI2C, I2CMDR, EVM642VIDEOIIC_Config.i2cmdr);
> /* set I2C imr register */
> I2C_RSETH(hI2C, I2CIMR, EVM642VIDEOIIC_Config.i2cimr);
> /* configure the I2C slave address register */
> I2C_RSETH(hI2C, I2CSAR, devAddress);
> /* set I2C count register */
> I2C_RSETH(hI2C, I2CCNT, numBytes + 1);
> /* write the sub address */
> I2C_RSETH(hI2C, I2CDXR, subAddress);
> /* Generate start condition */
> I2C_start(hI2C);
> I2CDELAY(DELAY_TIME);
> /* write the data */
> for(i = 0; i < numBytes; i ++) {
> while(!I2C_xrdy(hI2C));
> I2C_writeByte(hI2C, *data ++);
> I2CDELAY(DELAY_TIME);
> }
> /* Generate stop condition */
> I2C_sendStop(hI2C);
> I2CDELAY(DELAY_TIME);
> /* Wait until bus is free */
> while (I2C_bb(hI2C));
> I2CDELAY(DELAY_TIME);
> /* now restore the previous I2C settings */
> /* set I2C mode register */
> I2C_RSETH(hI2C, I2CMDR, prevIICConfig.i2cmdr);
> /* set I2C imr register */
> I2C_RSETH(hI2C, I2CIMR, prevIICConfig.i2cimr);
> /* configure the I2C slave address register */
> I2C_RSETH(hI2C, I2CSAR, prevIICConfig.i2csar);
> /* set I2C count register */
> I2C_RSETH(hI2C, I2CCNT, prevIICConfig.i2ccnt);
> I2CDELAY(DELAY_TIME);
> }
>
> Cheers
>
> mark-r

Mark Robinson
04-04-2005, 10:21 AM
phuture_project wrote:
>
> I've already seen this code but thanks anyway.

Ahh well, never mind. Let me know if you find out anything useful
(email address works), because I'm going to have to do some I2C work
soon, too.

Cheers

mark-r

--
"Let's meet the panel. You couldn't ask for four finer comedians -
so that answers your next question..."
-- Humphrey Lyttleton

phuture_project
04-05-2005, 08:10 AM
Mark Robinson <[email protected]> wrote in message news:<[email protected]>...
> phuture_project wrote:
> >
> > I've already seen this code but thanks anyway.
>
> Ahh well, never mind. Let me know if you find out anything useful
> (email address works), because I'm going to have to do some I2C work
> soon, too.
>
> Cheers
>
> mark-r

Ok! No problem!

04-05-2005, 08:11 PM
I hope you have seen the spru175a, there they have the complete
flowcharts for polling mode and interrupt driven mode.
DM642 has some problem in i2C silicon
Do remember these when coding

Please see this doc.
http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sprz196i&fileType=pdf


I2C: Bus Busy Bit Does Not Reflect the State of the I2C Bus When the
I2C is in Reset
I2C: Addressed-As-Slave (AAS) Bit is not Cleared Correctly

Hope this information helps you .
Good luck guys

04-05-2005, 08:11 PM
I hope you have seen the spru175a, there they have the complete
flowcharts for polling mode and interrupt driven mode.
DM642 has some problem in i2C silicon
Do remember these when coding

Please see this doc.
http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sprz196i&fileType=pdf


I2C: Bus Busy Bit Does Not Reflect the State of the I2C Bus When the
I2C is in Reset
I2C: Addressed-As-Slave (AAS) Bit is not Cleared Correctly

Hope this information helps you .
Good luck guys
Soumit

04-05-2005, 09:01 PM
I hope you have seen the spru175a, there they have the complete
flowcharts for polling mode and interrupt driven mode.
DM642 has some problem in i2C silicon
Do remember these when coding

Please see this doc.
http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sprz196i&fileType=pdf


I2C: Bus Busy Bit Does Not Reflect the State of the I2C Bus When the
I2C is in Reset
I2C: Addressed-As-Slave (AAS) Bit is not Cleared Correctly

Hope this information helps you .
Good luck guys
Soumit

jerome
07-26-2005, 12:52 PM
>Good Day
>
>will you Kindly refer me to where can i get this DSP from, can i jus
buy
>a single chip?
>
>

Hi,

I don't know where you live so I can't tell you where you can buy TI'
DSP. Maybe there is some info on Ti's website, have you looked at it ?
In France, I think TI's DSP are available from Farnell or Radiospares.

Regards

This message was sent using the Comp.DSP web interface o
www.DSPRelated.com