EmbeddedRelated.com
Forums
Memfault Beyond the Launch

16F877A and I2C pull up resistors

Started by Dennis Clark August 22, 2004
I have a weird issue. I've used the hardware I2C on the PIC
16F77 with no problems between multiple chips using 2.7K to 4.7K
pull up resistors very successfully. However when using the 16F877A
I'm finding that I2C isn't reliable at all unless I use 22K to 47K
pull ups. Weird huh? Now lets get weirder, If I put a 16F77 into
the I2C circuit EVEN IF IT ISN"T BEING USED the I2C channels start
working properly again! I'm using essentially the same code on all
of the chips too.

Has anyone seen this totally wrong behavior before, and if you have,
did you ever discover what was going on?

Baffled,
DLC



I remember off the top of my head that there is an erata doc on this that helped me when I hit the same problem with 18f452 comms.  The high value that you’re using seems a bit suspect as I use 1k and it work very well in noisy environments.  I also remember that the clk and data must be put into an input/output state of a certain combination but I am not sure not exactly what so check in your data manual.  I use the chip on 40meg and with 400k comms and it works well so if you have any more hassles then shoot!

 

From: Dennis Clark [mailto:d...@frii.com]
Sent: Monday, 23 August 2004 15:46
To: p...@yahoogroups.com
Subject: [piclist] 16F877A and I2C pull up resistors

 

  I have a weird issue.  I've used the hardware I2C on the PIC
16F77 with no problems between multiple chips using 2.7K to 4.7K
pull up resistors very successfully.  However when using the 16F877A
I'm finding that I2C isn't reliable at all unless I use 22K to 47K
pull ups.  Weird huh?  Now lets get weirder, If I put a 16F77 into
the I2C circuit EVEN IF IT ISN"T BEING USED the I2C channels start
working properly again!  I'm using essentially the same code on all
of the chips too.

  Has anyone seen this totally wrong behavior before, and if you have,
did you ever discover what was going on? 

Baffled,
DLC



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions





On Mon, 23 Aug 2004, Dennis Clark wrote:

>
> I have a weird issue. I've used the hardware I2C on the PIC
> 16F77 with no problems between multiple chips using 2.7K to 4.7K
> pull up resistors very successfully. However when using the 16F877A
> I'm finding that I2C isn't reliable at all unless I use 22K to 47K
> pull ups.

This make me thinking that parasitic IO capacitance of 877A is 10 times
greater than 877. Which can't be true. Weird huh? Now lets get weirder, If I put a 16F77 into
> the I2C circuit EVEN IF IT ISN"T BEING USED the I2C channels start
> working properly again! I'm using essentially the same code on all
> of the chips too.

So, you have in i2c circuit the unused CLK and SD pins of an 877.
Definitely is a wrong wired i2c bus. How long, how many cips, where is the
pullup resistor ? etc.
Does the i2c is exactly the same in 877 and 877A ?

best regards,
Vasile




How long are your i2c-wires? Keep them very short. How
good is your power-supply on the i2c-bus? As I read
it, it looks like the 877A has problems pulling the
lines low, except with high-value resistors. Strange,
since all types of PICs can sink 25mA on their pins,
and that should be more than enough to pull a line
down with a 2.2k resistor. How is your solderwork?

Kees
--- Dennis Clark <> wrote:

> I have a weird issue. I've used the hardware I2C
> on the PIC
> 16F77 with no problems between multiple chips using
> 2.7K to 4.7K
> pull up resistors very successfully. However when
> using the 16F877A
> I'm finding that I2C isn't reliable at all unless I
> use 22K to 47K
> pull ups. Weird huh? Now lets get weirder, If I
> put a 16F77 into
> the I2C circuit EVEN IF IT ISN"T BEING USED the I2C
> channels start
> working properly again! I'm using essentially the
> same code on all
> of the chips too.
>
> Has anyone seen this totally wrong behavior
> before, and if you have,
> did you ever discover what was going on?
>
> Baffled,
> DLC

__________________________________




Kees,

My solderwork is fine. My wires are about 25cm(10 inches) and
my power supply is fine. I've totally wrung this out about 20
times and just don't see what is going wrong. I'm using the
hardware I2C, not a bit bang, so that is out. I KNOW my resistor
values and the cables that I've made too. Other folks have seen
this same issue on their boards made by the same folks - So this
doesn't leave out poor board design, but I've checked out the
schematics and traces and they are all what they say they are
and what they should be too.

Darn, I was hoping for someone seeing an appnote that I've missed!

DLC

--- In , Kees Stenekes <knalkeez@y...> wrote:
> How long are your i2c-wires? Keep them very short. How
> good is your power-supply on the i2c-bus? As I read
> it, it looks like the 877A has problems pulling the
> lines low, except with high-value resistors. Strange,
> since all types of PICs can sink 25mA on their pins,
> and that should be more than enough to pull a line
> down with a 2.2k resistor. How is your solderwork?
>
> Kees
> --- Dennis Clark <dlc@f...> wrote:
>
> > I have a weird issue. I've used the hardware I2C
> > on the PIC
> > 16F77 with no problems between multiple chips using
> > 2.7K to 4.7K
> > pull up resistors very successfully. However when
> > using the 16F877A
> > I'm finding that I2C isn't reliable at all unless I
> > use 22K to 47K
> > pull ups. Weird huh? Now lets get weirder, If I
> > put a 16F77 into
> > the I2C circuit EVEN IF IT ISN"T BEING USED the I2C
> > channels start
> > working properly again! I'm using essentially the
> > same code on all
> > of the chips too.
> >
> > Has anyone seen this totally wrong behavior
> > before, and if you have,
> > did you ever discover what was going on?
> >
> > Baffled,
> > DLC
> >
> >
>
> __________________________________
>



Vasile,

> On Mon, 23 Aug 2004, Dennis Clark wrote:
>
> >
> > I have a weird issue. I've used the hardware I2C on the PIC
> > 16F77 with no problems between multiple chips using 2.7K to 4.7K
> > pull up resistors very successfully. However when using the 16F877A
> > I'm finding that I2C isn't reliable at all unless I use 22K to 47K
> > pull ups.
>
> This make me thinking that parasitic IO capacitance of 877A is 10
times
> greater than 877. Which can't be true.

I didn't think so either, but I've seen other undocumented
incompatabilities between the '877 and 877a...
>
> Weird huh? Now lets get weirder, If I put a 16F77 into
> > the I2C circuit EVEN IF IT ISN"T BEING USED the I2C channels start
> > working properly again! I'm using essentially the same code on all
> > of the chips too.
>
> So, you have in i2c circuit the unused CLK and SD pins of an 877.
> Definitely is a wrong wired i2c bus. How long, how many cips, where
is the
> pullup resistor ? etc.
> Does the i2c is exactly the same in 877 and 877A ?

I've got three chips in the circuit (including the '877) or just
two chips in the circuit (using only '877As). The code is exactly
the same on all the chips.

thanks,
DLC

> best regards,
> Vasile




Thanks, I've posted all that I have on the issue and I'm confused.
Really confused as to what is going on here...

regards,
DLC --- In , "martin de lange" <martin_de_lange@x>
wrote:
> I remember off the top of my head that there is an erata doc on this
that
> helped me when I hit the same problem with 18f452 comms. The high value
> that you're using seems a bit suspect as I use 1k and it work very
well in
> noisy environments. I also remember that the clk and data must be
put into
> an input/output state of a certain combination but I am not sure not
exactly
> what so check in your data manual. I use the chip on 40meg and with
400k
> comms and it works well so if you have any more hassles then shoot!
>
> _____
>
> From: Dennis Clark [mailto:dlc@f...]
> Sent: Monday, 23 August 2004 15:46
> To:
> Subject: [piclist] 16F877A and I2C pull up resistors
>
> I have a weird issue. I've used the hardware I2C on the PIC
> 16F77 with no problems between multiple chips using 2.7K to 4.7K
> pull up resistors very successfully. However when using the 16F877A
> I'm finding that I2C isn't reliable at all unless I use 22K to 47K
> pull ups. Weird huh? Now lets get weirder, If I put a 16F77 into
> the I2C circuit EVEN IF IT ISN"T BEING USED the I2C channels start
> working properly again! I'm using essentially the same code on all
> of the chips too.
>
> Has anyone seen this totally wrong behavior before, and if you have,
> did you ever discover what was going on?
>
> Baffled,
> DLC >
> to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions
<http://us.ard.yahoo.com/SIG9as69f5/M)8184.5285298.6392945.3001176/D=gr
>
oups/S06554205:HM/EXP93319150/A#19498/R=0/SIGthfntfp/*http:/www.n
> etflix.com/Default?mqso`185352&partidR85298> click here >
<http://us.adserver.yahoo.com/l?M)8184.5285298.6392945.3001176/D=groups/S=
> :HM/A#19498/randW0087445>
>
> _____
>
> > .





FIY. I currently have I2C set up between a 16F877A and a 16F873 using
2.2 Kohm pullups on the clock and data lines. The 16F877A is the
master. It works on both 100 KHz and 400 KHz.

I can only send one byte in a message, but I think that's a problem
with my CCS compiler. I have never heard of anyone getting I2C slave
mode to work with C (only assembly).

Maybe this info will help you a little.

BRW

--- In , "Dennis Clark" <dlc@f...> wrote:
> I have a weird issue. I've used the hardware I2C on the PIC
> 16F77 with no problems between multiple chips using 2.7K to 4.7K
> pull up resistors very successfully. However when using the 16F877A
> I'm finding that I2C isn't reliable at all unless I use 22K to 47K
> pull ups. Weird huh? Now lets get weirder, If I put a 16F77 into
> the I2C circuit EVEN IF IT ISN"T BEING USED the I2C channels start
> working properly again! I'm using essentially the same code on all
> of the chips too.
>
> Has anyone seen this totally wrong behavior before, and if you
have,
> did you ever discover what was going on?
>
> Baffled,
> DLC





I'm reading spec sheets, but the first thing I would do, would be to
hang a scope on that puppy. I assume you can't or you saw nothing
unusual.

Chad

--- Bennet Williams <> wrote:

> FIY. I currently have I2C set up between a 16F877A and a 16F873 using
>
> 2.2 Kohm pullups on the clock and data lines. The 16F877A is the
> master. It works on both 100 KHz and 400 KHz.
>
> I can only send one byte in a message, but I think that's a problem
> with my CCS compiler. I have never heard of anyone getting I2C slave
> mode to work with C (only assembly).
>
> Maybe this info will help you a little.
>
> BRW
>
> --- In , "Dennis Clark" <dlc@f...> wrote:
> > I have a weird issue. I've used the hardware I2C on the PIC
> > 16F77 with no problems between multiple chips using 2.7K to 4.7K
> > pull up resistors very successfully. However when using the
> 16F877A
> > I'm finding that I2C isn't reliable at all unless I use 22K to 47K
> > pull ups. Weird huh? Now lets get weirder, If I put a 16F77 into
> > the I2C circuit EVEN IF IT ISN"T BEING USED the I2C channels start
> > working properly again! I'm using essentially the same code on all
> > of the chips too.
> >
> > Has anyone seen this totally wrong behavior before, and if you
> have,
> > did you ever discover what was going on?
> >
> > Baffled,
> > DLC


=====
My software has no bugs, only undocumented features.

__________________________________



Obviously this is not right. I'm curious how you put the 16F77 in the
circuit. If I had to guess, you have a ground problem causing some
level shifting. Just a guess, with little info. Good luck.

Chad

--- Dennis Clark <> wrote:

> Thanks, I've posted all that I have on the issue and I'm confused.
> Really confused as to what is going on here...
>
> regards,
> DLC > --- In , "martin de lange" <martin_de_lange@x>
> wrote:
> > I remember off the top of my head that there is an erata doc on
> this
> that
> > helped me when I hit the same problem with 18f452 comms. The high
> value
> > that you're using seems a bit suspect as I use 1k and it work very
> well in
> > noisy environments. I also remember that the clk and data must be
> put into
> > an input/output state of a certain combination but I am not sure
> not
> exactly
> > what so check in your data manual. I use the chip on 40meg and
> with
> 400k
> > comms and it works well so if you have any more hassles then shoot!
> >
> > _____
> >
> > From: Dennis Clark [mailto:dlc@f...]
> > Sent: Monday, 23 August 2004 15:46
> > To:
> > Subject: [piclist] 16F877A and I2C pull up resistors
> >
> > I have a weird issue. I've used the hardware I2C on the PIC
> > 16F77 with no problems between multiple chips using 2.7K to 4.7K
> > pull up resistors very successfully. However when using the
> 16F877A
> > I'm finding that I2C isn't reliable at all unless I use 22K to 47K
> > pull ups. Weird huh? Now lets get weirder, If I put a 16F77 into
> > the I2C circuit EVEN IF IT ISN"T BEING USED the I2C channels start
> > working properly again! I'm using essentially the same code on all
> > of the chips too.
> >
> > Has anyone seen this totally wrong behavior before, and if you
> have,
> > did you ever discover what was going on?
> >
> > Baffled,
> > DLC


=====
My software has no bugs, only undocumented features.
__________________________________




Memfault Beyond the Launch