Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR1000X I2C Communication? Not even showing up in CRBasic Editor


Waq Aug 22, 2018 02:46 PM

Hey everyone,

Very new to this datalogger programming. learning as I go, one brick wall I've come across is that there is absolutely no mention of I2C (or even SPI-12) functions in the CRBasic Editor (version 3.7 is installed). The product manual lists support for I2C protocol. And there is a question on this website that pops up with an answer as of last year using commands such as I2COpen, I2CRead, I2CWrite etc. in their program, but why can I find no documentation on this.

Also no generic option available in the Short Cut sensors menu as well. 

If anybody has successfully read from a humidity/temperature sensor in I2C or interfaced with I2C in general on these dataloggers could I get some tips on where to get started? Thank you. 


JDavis Aug 23, 2018 08:48 AM

Run the CR1000X OS2 update on your computer, and the instructions will show up in CRBasic Editor.


Waq Aug 23, 2018 10:48 AM

Thanks, installing the latest OS for CR1000x pulled up the I2C commands in the CRBasic Help. Will keep this thread posted soon as to how the connection is going and/or any problems encountered. 


Waq Aug 28, 2018 11:59 AM

I am having a problem with the I2C Communication on a SHT31-D RH/Temp sensor with the CR1000X Datalogger 

It is currently reading a -1 value in my return variable when I call in the I2CRead option in my program.

Public TemporaryRead as Long

BeginProg
  PortPairConfig(C5,2) 'set C5 for SCL and C6 for SDA and at 3.3V'
  I2COpen (C5, 500000) '500 mHZ start at port C5
  I2CWrite (C5, &H44, &H2130, 3, &H2)
  Scan (1, Sec, 0, 0)
    PanelTemp (PTemp, 60)
    Battery (Batt_Volt)
    I2CWrite (C5, &H44, &HE000, 2, &H2)
    I2CRead (C5, &H44, TemporaryRead, 4, &H5)
  NextScan
EndProg

this is the link to the sensor datasheet
https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/0_Datasheets/Humidity/Sensirion_Humidity_Sensors_SHT3x_Datasheet_digital.pdf

Pages 9 and 11 are where I am getting my command instructions to pass to the sensor as well as the address. I am using address 0x44 and attempting periodic acquisition mode at 1 mps

Any advice as to where my program is going wrong would be appreciated, thanks. Maybe I'm inputting the instructions wrong? or missing a step? or maybe specifying the wrong number of bytes in the Read and Write methods 


Waq Sep 7, 2018 09:53 AM

SOLVED:

Program and sensor was working, had to reduce the bitrate down to 50000 Hz (my program originally had it at 500000). There is an upper limit to this sensor apparently. 


alirashidniaghi68 May 28, 2019 12:57 PM

I am trying to connect MLX sensor with 0x5A address but the program fail to compile and gives an error related to undeclared variable and illegal parameter of 0x5A. Anyone has any idea how to address this in I2CWrite and Read?


DataLoggerNut May 28, 2019 04:37 PM

Use &h05A syntax for entering in the hexadecimal slave address 0x05A.

i.e.: I2CWrite(C3,&H5A,&h06,1,&H2 )'<-- Send register address to reading from.

Log in or register to post/reply in the forum.