CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

bme 280 problem? HOW CAN I READ TEMP OR PRESSURE VALUE?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jaka



Joined: 04 May 2014
Posts: 36
Location: Finland

View user's profile Send private message

PostPosted: Wed Nov 04, 2020 10:24 am     Reply with quote

I just tested to compile the bme280.c driver with 877a. You need to add #separate directives to either _bme280_compensate_P_int32() or _bme280_compensate_H_int32() functions, or both.

Like this:
Code:
#separate
static unsigned int32 _bme280_compensate_P_int32(signed int32 adc_P)


It compiles without errors and consumes 48% of ROM on 877A. Tried with compiler 5.076.
akay



Joined: 29 Sep 2020
Posts: 17

View user's profile Send private message

PostPosted: Wed Nov 04, 2020 12:53 pm     Reply with quote

Thank you for your valuable comments my friend.
akay



Joined: 29 Sep 2020
Posts: 17

View user's profile Send private message

PostPosted: Wed Nov 04, 2020 1:02 pm     Reply with quote

jaka wrote:
I just tested to compile the bme280.c driver with 877a. You need to add #separate directives to either _bme280_compensate_P_int32() or _bme280_compensate_H_int32() functions, or both.

Like this:
Code:
#separate
static unsigned int32 _bme280_compensate_P_int32(signed int32 adc_P)


It compiles without errors and consumes 48% of ROM on 877A. Tried with compiler 5.076.



My friend first of all thank you.. Could you pls send me your compile code?
akay



Joined: 29 Sep 2020
Posts: 17

View user's profile Send private message

PostPosted: Wed Nov 04, 2020 1:45 pm     Reply with quote

It's work but my sensor is ''gy-bme280-3.3''. i2c address 0x77 when connect the SDO to Vcc to select i2c 0x77. I changed to i2c address of driver but it not work.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Nov 04, 2020 6:29 pm     Reply with quote

Those are 7-bit i2c addresses. CCS uses 8-bit addresses.
Multiply them by 2 to convert them to 8-bit:

0x76 x 2 = 0xEC

0x77 x 2 = 0xEE
akay



Joined: 29 Sep 2020
Posts: 17

View user's profile Send private message

PostPosted: Thu Nov 05, 2020 5:14 am     Reply with quote

PCM programmer wrote:
Those are 7-bit i2c addresses. CCS uses 8-bit addresses.
Multiply them by 2 to convert them to 8-bit:

0x76 x 2 = 0xEC

0x77 x 2 = 0xEE


I don't understand. What can i do? Could you pls explain inside to program.
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Thu Nov 05, 2020 5:19 am     Reply with quote

You said you had changed the BME280_I2C_ADDRESS. The point is this needs
to be 0xEC for a bme280 (7bit) address of 0x76, or 0xEE for a bme280
address of 77.
0x76 & 77, won't work. The address needs to be translated to 8bit format.
The 7bit address *2.
akay



Joined: 29 Sep 2020
Posts: 17

View user's profile Send private message

PostPosted: Thu Nov 05, 2020 10:43 am     Reply with quote

Ttelmah wrote:
You said you had changed the BME280_I2C_ADDRESS. The point is this needs
to be 0xEC for a bme280 (7bit) address of 0x76, or 0xEE for a bme280
address of 77.
0x76 & 77, won't work. The address needs to be translated to 8bit format.
The 7bit address *2.


so how can i translate to 8bit format.. i dont know how can i do?
newguy



Joined: 24 Jun 2004
Posts: 1908

View user's profile Send private message

PostPosted: Thu Nov 05, 2020 10:48 am     Reply with quote

akay wrote:
Ttelmah wrote:
You said you had changed the BME280_I2C_ADDRESS. The point is this needs
to be 0xEC for a bme280 (7bit) address of 0x76, or 0xEE for a bme280
address of 77.
0x76 & 77, won't work. The address needs to be translated to 8bit format.
The 7bit address *2.


so how can i translate to 8bit format.. i dont know how can i do?


He told you how: multiply the 7 bit address by 2.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group