CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Are there people know about TVP7000....

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
soulweed



Joined: 20 Oct 2006
Posts: 23

View user's profile Send private message

Are there people know about TVP7000....
PostPosted: Tue Apr 24, 2007 9:59 am     Reply with quote

Now i'm using my senior project and I don't know about how to config,I know only it must be config with I2C,I tried to do that but it don't work
,when i config i read in datasheet and go on it but it can't connect with PIC18F452 please tell me why it doesn't work
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 24, 2007 12:23 pm     Reply with quote

Look on page 15 of the TVP7000 data sheet. It has two diagrams of
the i2c operations to write and read from the chip. It also tells you
the slave address of the chip.

To write a byte:
Code:
S  10111000  ACK  subaddress  ACK  send_data  ACK  P


To read a byte:
Code:

S 10111000 ACK subaddress ACK S 10111001 ACK receive_data NAK P


Then translate those diagrams to CCS code:
Code:

#define TVP7000_I2C_WRITE_ADDR 0xB8
#define TVP7000_I2C_READ_ADDR  0xB9

void TVP7000_i2c_write(int8 reg, int8 data)
{
i2c_start();
i2c_write(TVP7000_I2C_WRITE_ADDR);
i2c_write(reg);
i2c_write(data);
i2c_stop();
}

//-------------------------------------
int8 TVP7000_i2c_read(int8 reg)
{
int8 retval;

i2c_start();
i2c_write(TVP7000_I2C_WRITE_ADDR);
i2c_write(reg);
i2c_start();
i2c_write(TVP7000_I2C_READ_ADDR);
retval = i2c_read(0);
i2c_stop();

return(retval);
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group