Reply
Highlighted
Posts: 17
Registered: ‎09-29-2017
Accepted Solution

C8051F381 Desperate Help

Hello,

 

First off, I'm using Silicon Labs IDE, and programming in C.

 

Now, i'm currently working on the software for a project that is using the C8051F381 microcontroller to monitor and control the different devices such as the TI INA260, TMP100, an EEPROM, and MAX7313's which are used to put the load on and off the board. There are two pins that lead to these devices, one has is an SCL line and the other is an SDA line. 

 

So for my questions:

 

1) I'm assuming since the wire goes to multiple devices I need the address of the device I want to communicate with in order to communicate with it through the C program?

2) I understand the pins and that each pin leads to a different path, but I don't understand and can't seem to find a straight answer on how do I tell the microcontroller to go to, for example, the INA260, read data from it and then bring the data back and let me read it? This seems to be my biggest piece of information that I am missing from all of this.

 

I'm sorry if this is a basic question but I really need an answer. 

 

Thank you

Posts: 8,172
Registered: ‎08-13-2003

Re: C8051F381 Desperate Help

it is I²C

 

 I2C Specification: http://www.nxp.com/documents/user_manual/UM10204.p​df

 

your device has hardware SMB/I²C interface and somewhere there is also software

erik
Posts: 17
Registered: ‎09-29-2017

Re: C8051F381 Desperate Help

A few more things are starting to click by just reading the first few paragraphs, thank you.

If this answers my questions I will accept as a solution.

Posts: 17
Registered: ‎09-29-2017

Re: C8051F381 Desperate Help

Can anyone provide some code examples for this in C?

Posts: 8,172
Registered: ‎08-13-2003

Re: C8051F381 Desperate Help