BS2p and MAX127 ADC
GeisteskrankerAlkoholiker
Posts: 3
Hello. I like to connect my BS2p to a MAX127 12Bit ADC. My problem is how to write I2C command.
I need to initialize the device like:
START | SlaveAddr-Byte |A| Control-Byte |A| STOP
...to read the device:
START | SlaveAddr-Byte |A| Data-Byte (D11-D4) |A| Data-Byte (D3-D0 + 0000) |A| STOP
Is there anybody who can explain me how to write this program? Please!!!
I need to initialize the device like:
START | SlaveAddr-Byte |A| Control-Byte |A| STOP
...to read the device:
START | SlaveAddr-Byte |A| Data-Byte (D11-D4) |A| Data-Byte (D3-D0 + 0000) |A| STOP
Is there anybody who can explain me how to write this program? Please!!!
Comments
I tried the 24C16 EEPROM program. That works fine, but this ADC don´t wanne communicate with my BS2p (Hardware is double-checkt).
I2COUT <pin>,<slave address>,[noparse][[/noparse]<control byte>]
I2CIN <pin>,<slave address>,[noparse][[/noparse] dataByte1, dataByte2 ]
dataByte1 and dataByte2 are byte variables that store the received values.
I think <pin> is 0 or 8 since the SCL and SDA lines have to be connected to pins 0/1 or pins 8/9.
<slave address> is the device select value. The Stamp takes care of the input/output bit.
<control byte> is a control value or register number (depending on the device)
I may have some of this wrong, but you should be able to correct it with the manual chapter.
The Stamp does a write transfer first to send the control information. It then readdresses the
device for a read transfer for the information expected.