the write and read into a single low-level call.Īrray = 0 //Memory address. To accomplish this, we use Add/Go/Get to combine That is, there needs to be an ack after writing the address, We need a single I2C transmission that writes the address and then reads Initial read of EEPROM bytes 0-3 in the user memory area. 0 is max speed of about 150 kHz.ĪddRequest(lngHandle, LJ_ioPUT_CONFIG, LJ_chI2C_SPEED_ADJUST,0,0,0) įollowing is pseudocode to read 4 bytes from the EEPROM: See description of low-level I2C function. See description of low-level I2C function.ĪddRequest(lngHandle, LJ_ioPUT_CONFIG, LJ_chI2C_OPTIONS,0,0,0) The AddressByte of the EEPROM on the LJTick-DAC is 0xA0 or decimal 160.ĪddRequest(lngHandle, LJ_ioPUT_CONFIG, LJ_chI2C_ADDRESS_BYTE,160,0,0) ĪddRequest(lngHandle, LJ_ioPUT_CONFIG, LJ_chI2C_SCL_PIN_NUM,0,0,0) ĪddRequest(lngHandle, LJ_ioPUT_CONFIG, LJ_chI2C_SDA_PIN_NUM,1,0,0) Following is example pseudocode to configure I☬ to talk to that chip: The LJTick-DAC is an accessory from LabJack with an I☬ 24C01C EEPROM chip. See the low-level function description in Section 5.2.21 for more information about these parameters: The following are special channels, used with the get/put config IOTypes, to configure various parameters related to the I☬ bus. LJ_chI2C_WRITE // Value= number of bytes (0-50). LJ_chI2C_READ // Value= number of bytes (0-52). The following are special channels used with the I☬ IOType above: There is one IOType used to write/read I☬ data: A good knowledge of the protocol is recommended, and a logic analyzer or oscilloscope might be needed for troubleshooting. Using this serial protocol is considered an advanced topic. Rather, the host application will write/read data to/from the U6 over USB, and the U6 communicates with some other device using the serial protocol. This serial link is not an alternative to the USB connection. Note that the I☬ bus generally requires pull-up resistors of perhaps 4.7 kΩ from SDA to Vs and SCL to Vs, and also note that the screw terminals labeled SDA and SCL (if present) are not used for I☬. Any 2 digital I/O lines are used for SDA and SCL. I☬ is a synchronous serial protocol typically used to communicate with chips that support I2C as slave devices. The U6 supports Inter-Integrated Circuit (I☬ or I2C) communication as the master only.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |