Forums

I2C problem on the C6713 - HELP!!

Started by varu...@bu.edu March 21, 2006
Hey Gustl,
i am having a problem initializing the I2C module on the C6713 DSK and i really
need your help

we are sending an address to a camera (SLAVE) to change format settings,
resolution, frame rate and so on, so we send the address and then the apprpriate
data value to that register for the change

I see that you have code which follows the same initialization proc, but can 
you please tell me what your 'if' and 'while' loops at the end

QUOTE:
>> while((I2C_RGET(I2CSTR0)&_I2C_I2CSTR_BB_MASK)==0);
>> // send all bytes
>> while (number>0) {
>> if ((I2C_RGET(I2CSTR0)&_I2C_I2CSTR_ICXRDY_MASK)!=0) {
>> 2C_RSET(I2CDXR0,I2C_I2CDXR_RMK(I2C_I2CDXR_OF(*source)));
>> source++;
>> number--;
>> }
>> }/**/
>> // wait until all is sent
>> while((I2C_RGET(I2CSTR0)&_I2C_I2CSTR_BB_MASK)!=0);
>> while((I2C_RGET(I2CSTR0)&_I2C_I2CSTR_BB_MASK)!=0);
>>}

so yeah i am trying to get control of the camera but i am not getting a proper
pulse from the I2C clock of the C6713... 
also is your data signal held high when no data is being sent on the SDA pin

please let me know if you understand any part of this problem

thanks alot
Varun
	
Hi Varun,

varund@varu... schrieb:
> Hey Gustl, i am having a problem initializing the I2C module on the
> C6713 DSK and i really need your help
> 
> we are sending an address to a camera (SLAVE) to change format
> settings, resolution, frame rate and so on, so we send the address
> and then the apprpriate data value to that register for the change
> 
> I see that you have code which follows the same initialization proc,
> but can  you please tell me what your 'if' and 'while' loops at the
> end
> 

I'm not sure if this is my code. I do I2C with EDMA!

The while loops test if I2C is still busy. But I think the first one 
should be '==0' to test wait until it started.

The 'if' part loads data data only when IC2 data register is ready to 
acccept new data.

It looks like some part of the code is missing or wrong.

> QUOTE:
>>> while((I2C_RGET(I2CSTR0)&_I2C_I2CSTR_BB_MASK)==0); // send all
>>> bytes while (number>0) { if
>>> ((I2C_RGET(I2CSTR0)&_I2C_I2CSTR_ICXRDY_MASK)!=0) { 
>>> 2C_RSET(I2CDXR0,I2C_I2CDXR_RMK(I2C_I2CDXR_OF(*source))); 
>>> source++; number--; } }/**/ // wait until all is sent 
>>> while((I2C_RGET(I2CSTR0)&_I2C_I2CSTR_BB_MASK)!=0); 
>>> while((I2C_RGET(I2CSTR0)&_I2C_I2CSTR_BB_MASK)!=0); }
> 
> so yeah i am trying to get control of the camera but i am not getting
> a proper pulse from the I2C clock of the C6713... also is your data
> signal held high when no data is being sent on the SDA pin

Yes it is. There must be pullup resistors on SCL and SDA!

> 
> please let me know if you understand any part of this problem

No, I'm afraid not.

regards Gustl