- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. I want to use the serial port to read the concentration data of the sensor. During debugging, I found that it does not seem to work when setting the measurement period. No matter how I set it, its data measurement period is always 60s.I write data to these two registers:
Measurement period configuration registers (MEAS_RATE_H and
MEAS_RATE_L)
Registers MEAS_RATE_H and MEAS_RATE_L define the measurement period used in continuous mode. The
concatenation of MEAS_RATE_H (MSB) and MEAS_RATE_L (LSB) define the period. The concatenated value is
coded as a two’s complement signed short integer (1 bit = 1 s).
Values above 0FFFH are treated as being equal to FFFH (4095 s). Values below 0005H are treated as being equal to
0005H (5 s).
Writing a non-valid value to this field generates a communication error (bit SENS_STS.ICCER set).
Note: When writing to MEAS_RATE_H and MEAS_RATE_L, the new value is not immediately considered by
the device. It is internally latched at the next transition from idle to continuous mode.
ser.write([0x57, 0x2C, 0x30, 0x33, 0x2C, 0x30, 0x36, 0x0A])
ser.write([0x57, 0x2C, 0x30, 0x32, 0x2C, 0x30, 0x39, 0x0A])
What is the problem with my operation? please help me !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
Could you please share the python script/code that you have created?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
May I know which host MCU are you using here?
Also, what does the below 2 command does/mean?
ser.write([0x57, 0x2C, 0x30, 0x33, 0x2C, 0x30, 0x36, 0x0A])
ser.write([0x57, 0x2C, 0x30, 0x32, 0x2C, 0x30, 0x39, 0x0A])
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I haven't used a host MCU yet, but I just connect the sensor to the computer through USB, and use the serial library in python to read and write. These two lines of code are to write the high and low bits of the measurement period register, so as to set His cycle, I uploaded the description of the register in the attachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
Could you please share the python script/code that you have created?
Thanks