Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

I2CBus


  • Please log in to reply
22 replies to this topic

#21 Dave M.

Dave M.

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 09 February 2013 - 03:11 PM


    [*]the LockObject has no sense, because you are locking just the I2CBus instance creation, but the further usage is not thread-safe at all;
    [*]consider two threads using the I2CBus: they don't work properly.
    [/list]The thread-safety on drivers like I2C or SPI is a much more complex task, and cannot be solved with a simple lock.

 

Can you clarify why his usage of the lock isn't thread-safe?  Other than possible performance considerations with an exclusive lock, why wouldn't his approach work, since the read and write operations are contained within the lock?

 

But in general I agree - the code isn't well written at all and probably unnecessary as you noted. Posted Image

 

I don't think Mario was saying that the code wasn't well written at all, he had some suggestions.  However, if you are going to say this, it would be more helpful to explain to the OP what you thought was lacking!



#22 alesbedac

alesbedac

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 17 October 2013 - 07:15 PM

Hi Shawn, I2C communication requires pull-up resistors. The Netduino will pull the voltage "low" to GND to send data, but the pull-up resistors keep the line high the rest of the time. This is how I2C works... The MUX1/MUX2 lines are automatically switched in the background (to digial/I2C mode or to analog mode). Chris

 

Hi Chris,

 

can you please define the size of reistors...i have I2c with PCF8574A. Exist anywhere the wiring diagram ? Thanks for Help and answer...i was looking in other forums but i didnt get a understanding sollution.



#23 Tobias Vandenbempt

Tobias Vandenbempt

    Advanced Member

  • Members
  • PipPipPip
  • 32 posts
  • LocationGenth, Belgium

Posted 07 April 2014 - 02:48 PM

Could you guys possible take a look at my problem with I2C? 

 

http://forums.netdui...fun-bmp085-i2c/

 

Thanks in advance!

Tobias






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.