Searching \ for '[PIC]: 24LC32 problems' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: '24LC32 problems'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 24LC32 problems'
2000\10\09@052030 by John Walshe

flavicon
face
Hi guys,
   it would appear that the piclist is exhibiting the same problem as my
24LC32 - no responses! (ok I got one but I was hoping for more)

If you have ever connected this device to a pic (in my case a 17C44) you may
be able to help. I'm using two pins RB2,RB3, the 24LC32 hardware address is
0 (a1,a2,a3 tied low) and WP is also tied low . Although my waveform appears
correct I do not see the 24LC32 acknowledging.

Maybe I'm incorrectly interpreting what I see:

I send a Stop bit, Start bit, Commandbyte = 0xA0; extra clock for the
acknowledge bit.
Now before I send the extra clock I set the pic SDA pin as input wait a
short delay (~ 2uS) and then give the clock pulse. However the SDA line does
not float high at all (as I expect) before the clock pulse - it is low all
the time.

What I expected to see was the SDA float high and then get pulled low by the
24LC32 when the extra pulse arrives. Am I wrong.

I think I have all bases covered but it still doesn't work so there is
something I'm missing so any comments at all would be welcome.

Alternatively if someone has code that they know works (Hitech C preferably)
perhaps I could try that.

Looking forward to some replies

John
***************************************************************
spam_OUTJohn.WalsheTakeThisOuTspaminpactmicro.com
WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\09@063036 by Michael Rigby-Jones

flavicon
face
{Quote hidden}

Yes.  AFAIK, if the device isn't acknowedging, the slave will release the
data on the rising edge of your acknowledge clock pulse.  Have you continued
after the ack to see if you can read.write etc?

> I think I have all bases covered but it still doesn't work so there is
> something I'm missing so any comments at all would be welcome.
>
> Alternatively if someone has code that they know works (Hitech C
> preferably)
> perhaps I could try that.
>
Are you using the I2C code included in the samples directory with HiTech?
If so, it usualy works, but there is a potential bug in the code in that it
modifies a ports TRIS bits to set the pin high/low but it does not explicity
set the pins PORT bit, which can be changed if a read-modify-write operation
is performed on the PORT when a bit is set for input.

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\09@074758 by John Walshe

flavicon
face
Yes.  AFAIK, if the device isn't acknowedging, the slave will release the
data on the rising edge of your acknowledge clock pulse.  Have you continued
after the ack to see if you can read.write etc?

>>Yes I have continued with both a Write byte and also a Read byte  but the
output from the LC32 is always low irrespective of what I had written into
that location previously.



Are you using the I2C code included in the samples directory with HiTech?
If so, it usualy works, but there is a potential bug in the code in that it
modifies a ports TRIS bits to set the pin high/low but it does not explicity
set the pins PORT bit, which can be changed if a read-modify-write operation
is performed on the PORT when a bit is set for input.

>> Actually I'm not because as I understood from the data sheets the 24LC32
doesn't conform fully to the I2C spec - if however you think it would work
I'll swap over. What I am using at the momentis some code that I found for
the 24LC01 written by Cameron Pearce.

John

***************************************************************
EraseMEJohn.Walshespam_OUTspamTakeThisOuTinpactmicro.com

WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\09@083016 by Michael Rigby-Jones

flavicon
face
www.ozemail.com.au/~dljones/pic.htm has some general purpose I2C
routines written in HiTech C.

Mike

> {Original Message removed}

2000\10\09@090727 by Olin Lathrop

flavicon
face
>     it would appear that the piclist is exhibiting the same problem as my
> 24LC32 - no responses! (ok I got one but I was hoping for more)

I can't say why others didn't answer, but I didn't remember off the top of
my head what a 24LC32 is.  Since you didn't even include even a three word
description, I deleted the message and went on.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinspamspam_OUTcognivis.com, http://www.cognivis.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\09@133622 by John Walshe

flavicon
face
Hi Michael,
Thanks for the help - I used the Hitech sample functions and now I'm
getting the acknowledge sequence and data back when I do a read ( a major
improvement). The only problem is that the read data and written data are
different! The commands a hand entered via a windows i/f to the pic so the
24LC32 has plenty of time to complete the write.
The command sequence appears correct and I get the acks as expected - any
further ideas.
John
***************************************************************
@spam@John.WalsheKILLspamspaminpactmicro.com

WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's


2000\10\10@030044 by ISO-8859-1?Q?Ruben_J=F6nsson?=

flavicon
face
Date sent:              Mon, 9 Oct 2000 10:16:22 +0100

Send reply to:          pic microcontroller discussion list <<KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU>

From:                   "John Walshe @Inpact" <<RemoveMEJohn.WalsheTakeThisOuTspamINPACTMICRO.COM>

Subject:                [PIC]: 24LC32 problems

To:                     spamBeGonePICLISTspamBeGonespamMITVMA.MIT.EDU<italic>


</italic><color><param>7F00,0000,0000</param>> Hi guys,

{Quote hidden}

</color>Is it really necessary to send a stop bit right before a start bit?
Isn't the startbit itself a guarantee that the device will move into
a known state?


<color><param>7F00,0000,0000</param>> acknowledge bit. Now before I send the extra clock I set the pic SDA

{Quote hidden}

</color>It should be pulled high by a pull-up resistor, not floating high.


<color><param>7F00,0000,0000</param>> I think I have all bases covered but it still doesn't work so there is

{Quote hidden}

==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +46 40142078
FAX INT +46 40947388
RemoveMErubenspamTakeThisOuTpp.sbbs.se
==============================

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics




2000\10\10@052436 by John Walshe

flavicon
face
Ruben,
   You probably missed the first message in which I stated that the SDA line had a pullup resistor.
The reason for the additional stop bit is that it was recommended by Microchip as "good practice", in case any glitches on the lines put the device into an unknown state - the stop bit will always be recognised therefore putting the device into a known state.
John
***************************************************************
John.WalsheEraseMEspam.....inpactmicro.com

INPACT MICROELECTRONICS (Irl) Ltd
21A Pouladuff Road,
Cork,
Ireland,
Tel: +353 21 4318296
Fax: +353 21 4318980
WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics




2000\10\10@064019 by ISO-8859-1?Q?Ruben_J=F6nsson?=

flavicon
face
Date sent:              Tue, 10 Oct 2000 10:16:46 +0100
Send reply to:          pic microcontroller discussion list <EraseMEPICLISTspamMITVMA.MIT.EDU>
From:                   "John Walshe @Inpact" <RemoveMEJohn.WalsheEraseMEspamEraseMEINPACTMICRO.COM>
Subject:                Re: [PIC]: 24LC32 problems
To:                     RemoveMEPICLISTspam_OUTspamKILLspamMITVMA.MIT.EDU

> Ruben,
>     You probably missed the first message in which I stated that the
>     SDA line had a pullup resistor.

Ok. Is it low enough? Any change if You slow down the communication?
Maybe 2ms instead of 2us delay, just to see if it works. When I have
problems like this I always slow down everything as much as possible
just to see that there isn't any capacitive load holding the pin low.

You could drive it staticly from an emulator or even debounced
switches to see that You get what You expect on the SDA line.

> The reason for the additional stop bit is that it was recommended by
> Microchip as "good practice", in case any glitches on the lines put
> the device into an unknown state - the stop bit will always be
> recognised therefore putting the device into a known state. John

Meaning the device can always recognize the stop bit but not the
start bit. Perhaps because the device can hold the SDA low making it
impossible for the master to initiate a start condition (SDA can't be
set high before SCL is set low), but the SCL can always be set high
by the master. Ok, I got it.

When I first put together my I2C routines (for a 24LC16B) I had
problems with read-modify-write due to an interrupt routine updated
the port just after the I2C had set the SDA low but before I had
trised it as an output.


{Quote hidden}

==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +46 40142078
FAX INT +46 40947388
EraseMErubenspamspamspamBeGonepp.sbbs.se
==============================

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics




2000\10\10@124126 by John Walshe

flavicon
face
Hi guys,
   I got it going at last. The last of my problems was how the stop bit was
being generated by the sample code. When I exploded the view on the logic
analyser around the stop bit I saw that the SCL was going high  just before
SDA was brought low in preparation for the stop bit. This effectively was a
Start condition which confused the 24LC32 and thus the writes did not
happen.
Different code is used in the read 'cos the 17C44 generates the ack in this
case.

Thanks for all your help, each comment served to discount something or
confirm I was on the right track.
Best regards,
John
***************************************************************
RemoveMEJohn.WalsheKILLspamspaminpactmicro.com

WWW.INPACTMICRO.COM
***************************************************************

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics




More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...