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 support@ccsinfo.com

BMP085 Pressure Sensor
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
ajt



Joined: 07 Sep 2003
Posts: 110

View user's profile Send private message

PostPosted: Mon Sep 16, 2013 9:28 am     Reply with quote

waynewy wrote:
Just a quick question, where did you get the i2c library in order to use i2c_start(), i2c_write(), etc?

They are all built-in CCS functions.
_________________
Al Testani
waynewy



Joined: 16 Sep 2013
Posts: 4
Location: United States

View user's profile Send private message

PostPosted: Mon Sep 16, 2013 9:44 am     Reply with quote

Forgive me that I am new to this forum. Where can I find those functions? I am actually trying to use PIC24E microcontrollers to interface with this sensor.

Thank you Al!
ajt



Joined: 07 Sep 2003
Posts: 110

View user's profile Send private message

PostPosted: Mon Sep 16, 2013 9:56 am     Reply with quote

Quote:
Forgive me that I am new to this forum. Where can I find those functions? I am actually trying to use PIC24E microcontrollers to interface with this sensor.


http://www.ccsinfo.com/content.php?page=syntax-functions, online help in the IDE, and/or the downloadable reference manual http://www.ccsinfo.com/downloads/ccs_c_manual.pdf

What version of the compiler are you using?
_________________
Al Testani
waynewy



Joined: 16 Sep 2013
Posts: 4
Location: United States

View user's profile Send private message

PostPosted: Mon Sep 16, 2013 9:58 am     Reply with quote

I am using MPLAB X with XC16 compiler.

I just downloaded MPLAB X plug-in. However, it seemed that I need more than that.
ajt



Joined: 07 Sep 2003
Posts: 110

View user's profile Send private message

PostPosted: Mon Sep 16, 2013 10:01 am     Reply with quote

waynewy wrote:
I am using MPLAB X with XC16 compiler.

I just downloaded MPLAB X plug-in. However, it seemed that I need more than that.


Yes, of course you do. You need the CCS compiler to use the built-in CCS functions!
_________________
Al Testani
waynewy



Joined: 16 Sep 2013
Posts: 4
Location: United States

View user's profile Send private message

PostPosted: Mon Sep 16, 2013 10:02 am     Reply with quote

Understood! Thank you so much for your instructions. I will figure it out hopefully.
kaka khan



Joined: 28 Sep 2013
Posts: 2

View user's profile Send private message Send e-mail

PostPosted: Sat Sep 28, 2013 5:21 am     Reply with quote

can anyone help me to program bmp085 with pic16f877
Hexadec



Joined: 09 Jan 2013
Posts: 7

View user's profile Send private message

PostPosted: Tue Oct 15, 2013 1:29 pm     Reply with quote

Thanks for the code ajt, saved me a lot of time!

Working perfectly on 18F45K20 with LCD readout.
pathmasugu



Joined: 21 Feb 2014
Posts: 25

View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number

PostPosted: Wed Mar 19, 2014 4:22 am     Reply with quote

This code works good ..........thank you ajt.
_________________
ROCK RAJ
monix7



Joined: 22 Aug 2015
Posts: 1

View user's profile Send private message

PostPosted: Sat Aug 22, 2015 5:25 am     Reply with quote

Dear friends,

I'm carrying out a project with a PIC18F2585 and various weather sensors, one of them the BMP180.


I copied the Testani's code, and the temperature reading seems to be OK, but it's strange the pressure reading, like -200 mBar, when it should be over +1000 mBar.
My home is few meters above sea level.
Should I change the : " #define P_CORRECTION 1.5 " or some of the calibration factors ??

I would be so grateful with any help.
anhanh



Joined: 22 Sep 2015
Posts: 1

View user's profile Send private message

PostPosted: Tue Sep 22, 2015 9:39 pm     Reply with quote

please explain code for me // 160 * pow2(-15) * ac3;
PCM programmer



Joined: 06 Sep 2003
Posts: 20137

View user's profile Send private message

PostPosted: Tue Sep 22, 2015 10:28 pm     Reply with quote

Quote:
please explain code for me // 160 * pow2(-15) * ac3;

Look at page 2 in this document:
http://wmrx00.sourceforge.net/Arduino/BMP085-Calcs.pdf
It has the formula for c3. It's the same formula as you posted.
inservi



Joined: 13 May 2007
Posts: 127

View user's profile Send private message

PostPosted: Mon Sep 26, 2016 8:20 am     Reply with quote

Hello,

Thank-you, your code work very well with a 16F1825 :-)
Here is the Altitude function i added from arduino library

Code:

float BMP085pressureToAltitude(float seaLevel, float atmospheric) {
  // Equation taken from BMP180 datasheet (page 16):
  //  http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf

  // Note that using the equation from wikipedia can give bad results
  // at high altitude.  See this thread for more information:
  //  http://forums.adafruit.com/viewtopic.php?f=22&t=58064
 
  return 44330.0 * (1.0 - pow(atmospheric / seaLevel, 0.1903));
 
}

_________________
in m├ędio virtus
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library 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