Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 20:06 13 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : SC Altimeter

Author Message
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 2006
Posted: 08:38am 07 May 2020
Copy link to clipboard 
Print this post

In the latest Silicon Chip there is an article on an Altimeter using a 28 pin Micromite Backpack. The BMP-180 pressure sensor is connected to I2C pin 17 (clock) and pin 18 (data). Reading through the code there is
PIN(17) = 0             ' set pin 17 to low and
 SETPIN 17, DOUT         ' declare it a digital output (SCL)

why would pin 17 have to be set as DOUT ?  I have used these pressure sensors and have never done that. I looked all through the code and can see no other reference to pin 17.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10574
Posted: 09:03am 07 May 2020
Copy link to clipboard 
Print this post

  Quote  why would pin 17 have to be set as DOUT ?  I


Because they are i...ts
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 2006
Posted: 09:12am 07 May 2020
Copy link to clipboard 
Print this post

@ Matherp,  obviously I could not post the entire code which may make a difference.
I just had a thought, part of the code gets the calibration values from the BMP-180
does it have something to do with that,
Edited 2020-05-07 19:14 by palcal
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10574
Posted: 09:19am 07 May 2020
Copy link to clipboard 
Print this post

No. All they are doing is effectively creating a duff clock pulse. The MM2 has a mechanism in the I2C OPEN that already ensures that the I2C bus isn't stalled which can happen if, for example, you reset the MM2 during an I2C transfer. There is no reason to do what they do and IMHO is is absolutely the wrong thing to do. Just comment out the lines.
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 2006
Posted: 08:43pm 07 May 2020
Copy link to clipboard 
Print this post

Thanks for the explanation.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025