I am driving a DS3231 I2C clock from a PIC's pins. If the logic state of the pins is always high or low, do I really need pullups on the bus? The only reason I ask is that space is at a premium.
--
You received this message because you are subscribed to the Google Groups "neonixie-l" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/neonixie-l/-/hF9vShAcTecJ.
To post to this group, send an email to neoni...@googlegroups.com.
To unsubscribe from this group, send email to neonixie-l+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/neonixie-l?hl=en-GB.
Ever taken apart a cell phone recently? Those 0201 resistors are nearly
invisible to the naked eye, they're so small. Two of them won't eat up
much real estate.
--
David Forbes, Tucson AZ
I know. I was being silly.
> The 18F2520 PIC ports I am using for the I2C bus say they are TTL, so
> presumably they are not open collector, thus my question whether I need
> any additional pullups.
>
The generic ports are TTL, but when they get configured for I2C, they
become open-collector. I2C requires the pull-up resistors to implement
its tricky protocol over two wires.
You'll have to find the room for them. If it helps, 1/8 watt resistors
are a bit smaller than 1/4 watt resistors.
> The generic ports are TTL, but when they get configured for I2C, they become open-collector. I2C requires the pull-up resistors to implement its tricky protocol over two wires.
>
> You'll have to find the room for them. If it helps, 1/8 watt resistors are a bit smaller than 1/4 watt resistors.
I am not using pins that can be configured as an I2C bus per se, but using two ordinary TTL level pins. Is the issue that there is some intermediate state between high and low that will send the whole mess haywire if I don't have a default condition set via resistors?
If only Farnell in the UK sold a resistor with wires that are 1/8w, but I cannot find any.
If Farnell deliver my Raspberry Pi tomorrow as promised I will be a happy bunny. I seem to have been allocated one of the first 700 - Farnell got 700 and RS got 700 last week. That means the Pi Foundation have held back 600 of the initial 2,000 that came to the UK. Presumably these are being sent out to developers who are doing all the educational software development in readiness for the start of the new school year in September.
John S
When you're transmitting information, you can have collisions if you're driving the line high when the receiver tries to
drive it low. This sort of thing is hard on the driver transistors, and leads to weird voltages that aren't valid logic levels.
However, it MAY be possible to avoid such collisions by only transmitting when you're certain the other device won't
try to transmit too. Your device will see the low bits as low, and the high bits as "ouch, you cooked my driver transistor".
The harder to avoid problem comes on receive, when you set your I/O pins to "input". Then your pins aren't pulling
the lines high or low, and the I2C device can only pull them low or let them float. So they float. To random levels. So you'll receive the low bits as low and the high bits as "random". Not terribly useful.
The idea is for the pull-up resistors to make the lines high by default, and then the MCU and target device can pull them
low as needed. If there's a collision with both devices pulling the lines low, no problem, they just go low, and the I2C
protocol allows for this to be detected and dealt with.
- John
The DS2321 is not a real part, according to Google. The DS1307 is.
It's true that you don't need a pullup on SCL, since it's only ever
driven by the CPU. But the SDA line changes direction between writing
the pot address and reading the data. It will drift to an invalid state
without a pullup, which may cause problems unless you do some clever
software hacks such as ensuring that the SDA input is ignored unless
it's actively being driven by the RTC chip.
Feel free to experiment with I2C with no pullup resistor, but you might
want to use an oscilloscope to show you what happens to the SDA line
when it changes direction.
Both Digikey and Mouser in the USA sell 1/8 watt thru-hole resistors.
Too bad for you.
I think they do - e.g. Farnell number 1700243 or 9343040 are 125mW 3k3
axial leaded - or are you looking for something else?
G
The DS2321 is not a real part, according to Google. The DS1307 is.
It's true that you don't need a pullup on SCL, since it's only ever driven by the CPU. But the SDA line changes direction between writing the pot address and reading the data. It will drift to an invalid state without a pullup, which may cause problems unless you do some clever software hacks such as ensuring that the SDA input is ignored unless it's actively being driven by the RTC chip.
Feel free to experiment with I2C with no pullup resistor, but you might want to use an oscilloscope to show you what happens to the SDA line when it changes direction.