SCD-30 I2C adressing

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
CoolioJones
 
Posts: 7
Joined: Sun Nov 28, 2021 7:22 pm

SCD-30 I2C adressing

Post by CoolioJones »

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

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: SCD-30 I2C adressing

Post by Franklin97355 »

Do you have pull-ups on your circuit?

User avatar
CoolioJones
 
Posts: 7
Joined: Sun Nov 28, 2021 7:22 pm

Re: SCD-30 I2C adressing

Post by CoolioJones »

I don't, according to the data sheet the device has internal pull ups

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: SCD-30 I2C adressing

Post by Franklin97355 »

Correct, our board does. how are you trying to communicate, what program are you using?

User avatar
CoolioJones
 
Posts: 7
Joined: Sun Nov 28, 2021 7:22 pm

Re: SCD-30 I2C adressing

Post by CoolioJones »

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.

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: SCD-30 I2C adressing

Post by Franklin97355 »

Have you seen the Sensiron download page? https://www.sensirion.com/en/download-c ... sor-scd30/

User avatar
CoolioJones
 
Posts: 7
Joined: Sun Nov 28, 2021 7:22 pm

Re: SCD-30 I2C adressing

Post by CoolioJones »

I have, and I have been basing my addressing off of those data sheets. Still have no results

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: SCD-30 I2C adressing

Post by adafruit2 »

the sensor requires i2c clock stretching support, check your board support package to enable it.

User avatar
CoolioJones
 
Posts: 7
Joined: Sun Nov 28, 2021 7:22 pm

Re: SCD-30 I2C adressing

Post by CoolioJones »

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.

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: SCD-30 I2C adressing

Post by adafruit2 »

not sure whats up with the PSOC - we test every SCD30 against an arduino when fabricated. you are using an adafruit breakout right?

User avatar
CoolioJones
 
Posts: 7
Joined: Sun Nov 28, 2021 7:22 pm

Re: SCD-30 I2C adressing

Post by CoolioJones »

Yes, the sensor came mounted on a break out

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: SCD-30 I2C adressing

Post by adafruit2 »

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

User avatar
CoolioJones
 
Posts: 7
Joined: Sun Nov 28, 2021 7:22 pm

Re: SCD-30 I2C adressing

Post by CoolioJones »

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
Attachments
main.c
(1.26 KiB) Downloaded 1 time

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: SCD-30 I2C adressing

Post by adafruit2 »

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!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”