Searching \ for '[PIC]: 877 I2C slave - does it work using the MSSP' 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/i2cs.htm?key=i2c
Search entire site for: '877 I2C slave - does it work using the MSSP'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: 877 I2C slave - does it work using the MSSP'
2002\03\15@173118 by Micro Eng

picon face
I've been doing some searching and found there is some out there that
indicate the I2C stuff built into the devices really doesn't work well?

My app is to collect A/D data, store to a reg (got all of that working) and
then a master will query for the data.  If I follow the stuff in the data
sheet, are there any gotcha's?

Or is there some code that sets it up as a slave only device.  I'm pokin
around but haven't found anything exactly what I want yet.

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\03\15@184935 by Bob Blick

face picon face
Yes, it works fine on the 876, so it should work on the 877 too.

Documentation is in 00734a.pdf

But the code sample has a bug. You must ack manually, and the code sample
doesn't do this. Other than that it will work.

Actually you don't manually ACK, you set CKP and it ACKs for you.

Cheerful regards,

Bob

On Fri, 15 Mar 2002, Micro Eng wrote:

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\03\15@210815 by Olin Lathrop

face picon face
> I've been doing some searching and found there is some out there that
> indicate the I2C stuff built into the devices really doesn't work well?
>
> My app is to collect A/D data, store to a reg (got all of that working)
and
> then a master will query for the data.  If I follow the stuff in the data
> sheet, are there any gotcha's?

Yes.  The MSSP in master mode has a bug where it samples the ACK bit from a
slave on the falling instead of rising edge of SCL.  I work around this by
keeping the bit rate to 400KHz or less, and putting a cap on the SDA line.
With 2Kohm pullups to +5 I use 100pF cap on SDA.  That slows down the rise
in SDA as the slave stops driving the ACK bit so that the master will still
sample it correctly on the falling edge of SCL.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\03\16@100116 by Olin Lathrop

face picon face
> Actually you don't manually ACK, you set CKP and it ACKs for you.

You've really confused things.  On a write (master to slave), the MSSP in
slave mode will automatically send the ACK bit.  CKP is only used on a read
by a slave, and it has nothing to do with ACK.  On a read in master mode the
ACK must be explicitly sent, but that is done with the ACKEN bit (if I
remember right, I'm home now and don't have a manual in front of me).


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, .....olinKILLspamspam@spam@embedinc.com, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2002\03\16@121414 by Bob Blick

face picon face
On 16 Mar 2002 at 9:00, Olin Lathrop wrote:

> > Actually you don't manually ACK, you set CKP and it ACKs for you.
>
> You've really confused things.  On a write (master to slave), the MSSP in
> slave mode will automatically send the ACK bit.  CKP is only used on a read
> by a slave, and it has nothing to do with ACK.  On a read in master mode the
> ACK must be explicitly sent, but that is done with the ACKEN bit (if I
> remember right, I'm home now and don't have a manual in front of me).

Sorry to confuse you!

If the user program in the slave doesn't set CKP it will not release
the clock. I didn't have the data sheet in front of me at the time, but
the key point I was trying to make is that there is a document about
the 877 I2C hardware in slave mode, and the code sample is useful
but neglects to set CKP.

Olin, please get DS00734A and look at the slave code sample. It is
broken. It does not set CKP, so it only works for the first transfer.
Then the bus is frozen.

Just reading the 877(30292) data sheet it's very difficult to get the
I2C slave working, mostly I was trying to let the reader know there
was an up-to-date document, with Microchip's usual errors in it. I
just added my own error. Perhaps that way I'll become as rich and
popular as Microchip!

Thanks for pointing out my little error.

Cheerful regards,

Bob

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2002\03\16@131255 by Olin Lathrop

face picon face
> Sorry to confuse you!

I wasn't the one that got confused.  I have a number of PIC projects using
IIC quite nicely.

> If the user program in the slave doesn't set CKP it will not release
> the clock. I didn't have the data sheet in front of me at the time, but
> the key point I was trying to make is that there is a document about
> the 877 I2C hardware in slave mode, and the code sample is useful
> but neglects to set CKP.
>
> Olin, please get DS00734A and look at the slave code sample. It is
> broken. It does not set CKP, so it only works for the first transfer.
> Then the bus is frozen.

I'm not on line right now, and I don't know which manual DS00734A is.
Anyway, Microchip code samples are usually a waste of time.  But you are
right, a slave during a write sequence needs to set CKP after it has loaded
SSPBUF with the next byte to send to the master.  If it doesn't the clock
will be held low and the bus will be hung.

> Just reading the 877(30292) data sheet it's very difficult to get the
> I2C slave working,

Actually that's exactly what I recommend for learning how to program the
MSSP.  It, and a little common sense is what I've used to do a number of
successful IIC projects.  The Microchip code samples can be useless, or
worse, but their data sheets are quite good.  What part of the MSSP
documentation don't you understand?


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, EraseMEolinspam_OUTspamTakeThisOuTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2002\03\16@132755 by Bob Blick

face picon face
> Actually that's exactly what I recommend for learning how to program the
> MSSP.  It, and a little common sense is what I've used to do a number of
> successful IIC projects.  The Microchip code samples can be useless, or
> worse, but their data sheets are quite good.

Well, each to his own. I find it useful to look at code samples AND
read the data sheet. That's why I suggested looking at DS00734A.

> What part of the MSSP
> documentation don't you understand?

No, I'm not the one who needed help. You and I were both helping,
but I'm not interested in wearing the "expert hat". You can continue
wearing it, with my blessing.

Cheerful regards,

Bob

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2002\03\18@055346 by Alan B. Pearce

face picon face
>That's why I suggested looking at DS00734A.

This is a source of confusion in itself. Although the document number is
DS00734x where x is the document revision, the title is AN734, and the
electronic form of the document on the microchip website is 00734x.pdf,
without either DS or AN as a prefix. This is why people have problems
searching the Microchip site for documents.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\24@151126 by Claudio Tagliola

flavicon
face
Now I'm confused too, I am working with that appnote and the sample code
works correctly, even after the first transfer. Does this behaviour only
pop up on specific I2C master devices?

Regards,
Claudio

-----Original Message-----

Olin, please get DS00734A and look at the slave code sample. It is
broken. It does not set CKP, so it only works for the first transfer.
Then the bus is frozen.

--
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


2002\03\24@172354 by Bob Blick

face picon face
On Sun, 24 Mar 2002, Claudio Tagliola wrote:
> Now I'm confused too, I am working with that appnote and the sample code
> works correctly, even after the first transfer. Does this behaviour only
> pop up on specific I2C master devices?

Hi Claudio,

The sample works except when you read from the slave. In the example they
forgot to set CKP after the slave is done transmitting.

Cheers,

Bob

--
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 2002 , 2003 only
- Today
- New search...