SCD-30 I2C adressing
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- CoolioJones
- Posts: 7
- Joined: Sun Nov 28, 2021 7:22 pm
SCD-30 I2C adressing
Hi, I am working on a project that requires me to use a Cypress Psoc 4 pioneer kit, and I am using the SCD-30 as my sensor. I have been pouring over the data sheet and have found the section containing the addresses for the SCD 30, however when I write to them with my master device, I fail to get an acknowledge from the device. Does anyone know how to communicate with the SCD 30 without using Python? Thanks
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: SCD-30 I2C adressing
Do you have pull-ups on your circuit?
- CoolioJones
- Posts: 7
- Joined: Sun Nov 28, 2021 7:22 pm
Re: SCD-30 I2C adressing
I don't, according to the data sheet the device has internal pull ups
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: SCD-30 I2C adressing
Correct, our board does. how are you trying to communicate, what program are you using?
- CoolioJones
- Posts: 7
- Joined: Sun Nov 28, 2021 7:22 pm
Re: SCD-30 I2C adressing
I am trying to communicate via the scl and sda pins on the sensor to the Psoc's scl and sda pins. The program I am using is psoc creator, which uses C as its coding language.
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: SCD-30 I2C adressing
Have you seen the Sensiron download page? https://www.sensirion.com/en/download-c ... sor-scd30/
- CoolioJones
- Posts: 7
- Joined: Sun Nov 28, 2021 7:22 pm
Re: SCD-30 I2C adressing
I have, and I have been basing my addressing off of those data sheets. Still have no results
- adafruit2
- Posts: 22148
- Joined: Fri Mar 11, 2005 7:36 pm
Re: SCD-30 I2C adressing
the sensor requires i2c clock stretching support, check your board support package to enable it.
- CoolioJones
- Posts: 7
- Joined: Sun Nov 28, 2021 7:22 pm
Re: SCD-30 I2C adressing
The Psoc 4 does support clock stretching, however I lowered the baud rate to 50 kHz since I had been previously running it at 100. This didn't help, and through debugging I have found that the Psoc is not clearing the Write complete interrupt, indicating that the device isn't acknowledging.
- adafruit2
- Posts: 22148
- Joined: Fri Mar 11, 2005 7:36 pm
Re: SCD-30 I2C adressing
not sure whats up with the PSOC - we test every SCD30 against an arduino when fabricated. you are using an adafruit breakout right?
- CoolioJones
- Posts: 7
- Joined: Sun Nov 28, 2021 7:22 pm
Re: SCD-30 I2C adressing
Yes, the sensor came mounted on a break out
- adafruit2
- Posts: 22148
- Joined: Fri Mar 11, 2005 7:36 pm
Re: SCD-30 I2C adressing
then yeah, its tested. you may want to verify your wiring works with an arduino and then you can compare the i2c traces with like a saelae or something
- CoolioJones
- Posts: 7
- Joined: Sun Nov 28, 2021 7:22 pm
Re: SCD-30 I2C adressing
Unfortunately I don't have an Arduino, nor can I use one for this assignment. Maybe I'm missing something about the sensors operation, are the register address's accurate? I noticed the addresses are 16bit while I2C protocol is 8 bit, requiring me to split the address into two bytes, is that accurate?
Here is the file for my project code
Here is the file for my project code
- Attachments
-
- main.c
- (1.26 KiB) Downloaded 1 time
- adafruit2
- Posts: 22148
- Joined: Fri Mar 11, 2005 7:36 pm
Re: SCD-30 I2C adressing
yah not sure how PSOC does it (never used that chip or board support!) however, you should be able to port this library
https://github.com/adafruit/Adafruit_SC ... _SCD30.cpp
(or look on github for other i2c code to port)
having a debug probe like a saleae to verify you are writing what you think you're writing will help a lot!
https://github.com/adafruit/Adafruit_SC ... _SCD30.cpp
(or look on github for other i2c code to port)
having a debug probe like a saleae to verify you are writing what you think you're writing will help a lot!
Please be positive and constructive with your questions and comments.