I2C + AnalogInput = Messed up
#1
Posted 24 May 2012 - 03:46 PM
#2
Posted 25 May 2012 - 01:29 PM
#3
Posted 25 May 2012 - 04:11 PM
Send a link of card incorpored the DS1307.
And Send code source.
#4
Posted 25 May 2012 - 04:48 PM
Maybe the card I2C outputs are 5V? NetDuino I2C is 3.3V.
Send a link of card incorpored the DS1307.
And Send code source.
Thanks for the suggestions.
Board I'm using is this one from Sparkfun.
Using code from here that I found on the forums, which didn't mention any issues with 5V I2C
I didn't realize the I2C was 3.3 on the netduino, as the DS1307 from Sparkfun definitely runs against 5V.
I assume that's the problem. My electronics skills are rather limited, so I have no idea how to resolve that.
It's an N+, so maybe I'll just use NST instead of an onboard RTC.
#5
Posted 25 May 2012 - 06:54 PM
Thanks for the suggestions.
Board I'm using is this one from Sparkfun.
Using code from here that I found on the forums, which didn't mention any issues with 5V I2C
I didn't realize the I2C was 3.3 on the netduino, as the DS1307 from Sparkfun definitely runs against 5V.
I assume that's the problem. My electronics skills are rather limited, so I have no idea how to resolve that.
It's an N+, so maybe I'll just use NST instead of an onboard RTC.
Haven't tried one, but ADA has a cheap logic-level chip that works with I2C: ADA level shifter
#6
Posted 26 May 2012 - 12:46 AM
yes, this is problem 5V to 3.3V.
For test:
Disconnect pull up resistor to 5v
Connect pull up resistor to 3.3v
Soon to be this will solve the problem. but we must see if the DS will still work.
if not, try a converter: Example: DFRobot I2C logic level converter
Schémat
Regard.
#7
Posted 26 May 2012 - 01:33 AM
#8
Posted 28 May 2012 - 12:23 PM
Pins A4/A5, when used in I2C mode, are both 5V and 3.3V tolerant. The analog pins going to A4/A5 are also electronically disconnected when using A4/A5 in digital/I2C mode.
Is there any chance that the current flowing to your analog sensor is too weak to drive the analog measurement circuitry? I know that sounds like a funny question.
Chris
The measurement is just a thermistor, and when A4/A5 are disconnected, I see the expected voltage (1.5-1.6V ish for my ambient temp)
But as soon as I connect A4/A5 back up, A0 reading drops right down. I'm taking those readings with a voltmeter, so not even through the ADC yet (although the ADC reads the same as the voltmeter).
I did notice that when I connect A4/A5, A0 reads basically nothing (15mV) A1, A2 and A3 all read 3.3v (nothing connected to them) and A4/A5 are about 3.9v.
If I disconnect the pullup resistors, what effect should that have?
#9
Posted 31 January 2014 - 06:28 AM
Hi Guys,
I'm working with DS1307... it's attached on A4/A5. time reading is great. but something happen to my analog pin 0 -3. All those Analog pins read 3.3V.
when I deploy a program to read Analog pins (without RTC) it goes fine. Once I attached the RTC all pins goes to 3.3 v..
what should I do?
#10
Posted 31 January 2014 - 07:14 AM
Add details,
protected static SecretLabs.NETMF.Hardware.AnalogInput A0 = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
when I delete this declaration, All analog pins (Analog 0-3, A4/A5 use to I2C) goes normal, reads 0.45mv. but when I use this code, with RTC pluged all the rest Analog in reads become 3.3V. Please anyone suggest a solution....
#11
Posted 31 January 2014 - 09:05 AM
Done...
this my Note.
1. Power RTC to 5v, but pull up SDA/SCL to 3.3v (here I'm using 4.7k and time readings work fine). as suggested by mastronic.
2. At Any rest analog (A0-A3), it will have 1.5v before declared to use ( as analoginput ) and 0mv after declaration...
But I dont have any explaination, why is it happen? as Crish mentioned above that, once A4/A5 is declared as I2c device, there's no more connection or relation to other analog pins. then why the pull up to 5v affecting them?
anyway... my RTC and analog input works fine now. but very appreciate for any detail explaination (I've used to write it on to my thesis)
Cheers
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users