I2C Where do I start
#1
Posted 19 January 2011 - 03:58 PM
#2
Posted 19 January 2011 - 09:03 PM
After that, take a look at a driver I wrote for the Bosch BMP085 temperature and pressure sensor.
#3
Posted 20 January 2011 - 05:09 AM
Im pretty new in this .NET micro framework, so Im suer im making all the Noob mistakes. I have found snippets online, but I have not been able to use them due to missing includes.
Hi Tax,
Welcome to the Netduino community.
If you can share the code snippets you're trying and the errors you're getting (missing includes/references), I'm sure somebody would be happy to help point you in the right direction...
Chris
#4
Posted 21 January 2011 - 04:28 PM
- Michel Trahan and aalmada like this
#5
Posted 11 April 2011 - 10:52 PM
I agree ! Beginners Tutorial PleaseIt would be nice if there was a beginners tutorial on using I2C with the Netduino. Not just the code but connecting multiple devices to the bus. I know your suppose to use pull up resistors but I can't find any information on when to use them what type or how often. But a short and sweet tutorial would be great to answer these type of question us beginners have. And it would have the added benefit of being easily found.
- aalmada likes this
#6
Posted 12 April 2011 - 06:34 AM
There need to be two pull-up resistors connected between I2C signal lines (TWCK, TWD) and positive voltage (+5V or +3.3V depending on the devices connected). The value can vary from ~1.5 kΩ up to ~47 kΩ, 2.2 kΩ or 10 kΩ will work fine. The exact value would have to be calculated based on the bus characteristics, i.e. capacitance, number of devices connected, speed etc.I know your suppose to use pull up resistors but I can't find any information on when to use them what type or how often.
#7
Posted 12 April 2011 - 12:21 PM
And if I see only SCL and SDA ... no TWCK nor TWD ... This is why we need a tutorial ... with some diagram using a netduino and some sensors (ex: Accelerometer ADXL345, Magnetometer HMC5843 and Gyroscope ITG3200). Real example with real sensors ...There need to be two pull-up resistors connected between I2C signal lines (TWCK, TWD) and positive voltage (+5V or +3.3V depending on the devices connected). The value can vary from ~1.5 kΩ up to ~47 kΩ, 2.2 kΩ or 10 kΩ will work fine. The exact value would have to be calculated based on the bus characteristics, i.e. capacitance, number of devices connected, speed etc.
I do understand that hardware is hard (pun intended) ... please help the newbies like me with some tutorials with real things connected, not just LEDs I am willing to help but I need input ... hard input !
Mike who wants to play with sensors without burning them !
#8
Posted 12 April 2011 - 12:31 PM
I2C Clock = SCL = TWCKAnd if I see only SCL and SDA ... no TWCK nor TWD ...
I2C Data = SDA = TWD
'TW' is used in Netduino schematic and Fritzing parts, because it is based on Atmel microcontroller and Atmel calls its I2C implementation "Two-Wire Interface", TWI for short. Sorry for the confusion.
- aalmada likes this
#9
Posted 12 April 2011 - 12:41 PM
LOL It made my point clear though ! LOLSorry for the confusion.
Did I understand correctly, you ALWAYS need pullup resistors ? or only when there is more than one sensor connected to it ? And using a I2CBus class to encapsulate all this would be nice to have (to clean up the code) ?
#10
Posted 12 April 2011 - 01:06 PM
Yes - technically, you'd need to ensure the I2C signal lines are HIGH, when the bus is free - you can use either a current source or pull-up resistor connected to the positive supply voltage. Pull-up resistors are "easier".Did I understand correctly, you ALWAYS need pullup resistors ?
The pull-up resistors should be present always. However, some sensors/devices may have those built-in (e.g. Sparkfun breakout boards).or only when there is more than one sensor connected to it ?
I am not sure I understand that - what do you mean by 'encapsulate all this'? As far as I know I2CBus class is used to overcome limitation in the current .NET Micro Framework I2C implementation that does not directly support multiple devices on the same bus (i.e. it is not possible to instantiate second I2CDevice, because it tries to reserve pins that have been already exclusively reserved by the first instance).And using a I2CBus class to encapsulate all this would be nice to have (to clean up the code) ?
#11
Posted 12 April 2011 - 01:17 PM
Boy do we need a tutorial LOLHowever, some sensors/devices may have those built-in (e.g. Sparkfun breakout boards).
Sorry, my lack of knowledge ... I didn't know why it was created ! Thanks !what do you mean by 'encapsulate all this'?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users