Hi:
In working with the DS2482 I2C to 1-Wire bridge I need to be able to read specific bits from a Status register in the device. Eventually this is to be used for polling in order to know when I can then issue 1-Wire commands.
The DS2482 defaults the Set Register Pointer to the Status register after each DS2482 level command is issued.
I am writing to the device to issue a reset and then attempting to read the status register.
// Reset DS2482
int Reset_DS2482(int I2C_address, int command)
{
char cmd[1];
cmd[0] = 0xF0;
DS2482.write(I2C_address, cmd, 1);
char status[1];
DS2482.read(I2C_address, status, 1);
return status[0];
}
The value I am getting back is "10007FF0".
from
pc.printf("Status is : %X\n\r", status[0]);
I seem to have to use the cmd[1] and status[1] to treat values as character strings in the read and write commands for I2C. Why can't I send integers?
I'd like to understand how to test the bits in the status register.
Thanks
Tim
Hi:
In working with the DS2482 I2C to 1-Wire bridge I need to be able to read specific bits from a Status register in the device. Eventually this is to be used for polling in order to know when I can then issue 1-Wire commands.
The DS2482 defaults the Set Register Pointer to the Status register after each DS2482 level command is issued.
I am writing to the device to issue a reset and then attempting to read the status register.
from
I'd like to understand how to test the bits in the status register.
Thanks
Tim