PSoC 4 BLE connected to BME280

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
PaHe_1325231
Level 3
Level 3
First like given

Hi

   

 

   

Could someone glance over my attached project. It is of I2C master taking data from BME280 environmental sensor and then transmitting the data out over BLE. I would like to view this data in Cysmart but I am unable to do so. Could someone have a look over my project please.

   

 

   

Regards

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In your i2c.h are two warnings which show up errors.

   

In BME_WriteReg() you have the line

   

    I2C_1_I2CMasterWriteBuf(BME_ADDR,(uint8 *)Write_Buf,2,I2C_1_I2C_MODE_COMPLETE_XFER);

   

Take the term (uint8 *)Write_Buf

   

Write_Buf is an array of 32bit integers and your statement will transfer the first two bytes of the array. That does not match at all.

   

Same applies for the warning-flagged lines.

   

 

   

Bob

View solution in original post

0 Likes
7 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In your i2c.h are two warnings which show up errors.

   

In BME_WriteReg() you have the line

   

    I2C_1_I2CMasterWriteBuf(BME_ADDR,(uint8 *)Write_Buf,2,I2C_1_I2C_MODE_COMPLETE_XFER);

   

Take the term (uint8 *)Write_Buf

   

Write_Buf is an array of 32bit integers and your statement will transfer the first two bytes of the array. That does not match at all.

   

Same applies for the warning-flagged lines.

   

 

   

Bob

0 Likes
PaHe_1325231
Level 3
Level 3
First like given

Hi Bob

   

 

   

Thanks for coming back to me, I think i know what you are getting at, basically I am mixing my data types? going from 32 bit unsigned to 8 bit? Unfortunately programming is not my strongest asset but i am learning

   

 

   

Regards

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Yes, uint8 would be better.

   

 

   

Bob

Cheers Bob

   

 

   

much appreciated. 

   

 

   

Regards

   

 

   

paddy

0 Likes
lock attach
Attachments are accessible only for community members.
PaHe_1325231
Level 3
Level 3
First like given

Hi again Bob,if you wouldn't mind, i think this is sorted?

   

Regards

0 Likes
Anonymous
Not applicable

Hey buddy

Is it working now? I just want to look out this project.

If it is done, please share the same at suranibharat4@gmail.com, it would be such a kind of you for me.

Regards,

BS

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Go through the rest of your program, the returned value must not be a uint32 but an uint8. Same for main(). You ought to transmit the combined high and low pressure value as

   

uint16 Value;

   

Value = ((uint16)HighByte << 😎 | LowByte;

   

I miss a BLE_Start() API

   

 

   

Bob