Searching \ for '[PIC] SSPIF ?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/ios.htm?key=spi
Search entire site for: 'SSPIF ?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] SSPIF ?'
2003\03\14@195646 by Stef

flavicon
face
PIC 16F87x,

Unlike the USART decription,
the description of the MSSP (at least the SPI-mode) is very vague to me.

Does filling of SSPBUF (for sending a byte in SPI-master mode) clear the
SSPIF ?
Or has the to be done by code?

To me it seems even more logical that:
 reading or writing the SSPBUF will clear the SSPIF.
Is this true ??

thanks
Stef

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

2003\03\14@202344 by Neil Bradley

flavicon
face
> Does filling of SSPBUF (for sending a byte in SPI-master mode) clear the
> SSPIF ?
> Or has the to be done by code?

With the 18F series at least, this isn't the case even though the
documentation indicates it will get cleared. I implemented this bit of
code and it works great (at least on the 18F series in my application).

       movff           SPIByte1, SSPBUF        ; Write out some data

SPIwaitLoop
       btfss           PIR1, SSPIF             ; Wait for SPI to finish
       goto            SPIwaitLoop
       bcf             PIR1,SSPIF

       movff           SPIByte2, SSPBUF        ; Write out some data

SPIwaitLoop2
       btfss           PIR1, SSPIF             ; Wait for SPI to finish
       goto            SPIwaitLoop2
       bcf             PIR1,SSPIF

-->Neil

-------------------------------------------------------------------------------
Neil Bradley            In the land of the blind, the one eyed man is not
Synthcom Systems, Inc.  king - he's a prisoner.
ICQ #29402898

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

2003\03\14@203214 by Stef

flavicon
face
Neil Bradley wrote:

>>Does filling of SSPBUF (for sending a byte in SPI-master mode) clear the
>>SSPIF ?
>>Or has the to be done by code?
>>
>>
>
>With the 18F series at least, this isn't the case even though the
>documentation indicates it will get cleared. I implemented this bit of
>code and it works great (at least on the 18F series in my application).
>
>
Thanks Neil,

but I wasn't looking for the "safe" code,
I'm writing a simulator, I'ld like to know the "exact" answer,
so I can even signal when the "not safe" code is used  ;-)

Stef Mientki

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

2003\03\14@203839 by Neil Bradley

flavicon
face
> >With the 18F series at least, this isn't the case even though the
> >documentation indicates it will get cleared. I implemented this bit of
> >code and it works great (at least on the 18F series in my application).
> but I wasn't looking for the "safe" code,
> I'm writing a simulator, I'ld like to know the "exact" answer,
> so I can even signal when the "not safe" code is used  ;-)

With the 18F series, the docs are flatly wrong. It isn't automatically
cleared (it MUST be done in software) I can't speak about other PICs,
though - they may behave differently.

-->Neil

-------------------------------------------------------------------------------
Neil Bradley            In the land of the blind, the one eyed man is not
Synthcom Systems, Inc.  king - he's a prisoner.
ICQ #29402898

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

2003\03\14@203849 by Thomas C. Sefranek

face picon face
What part of "(must be cleared in software)" don't you understand?

 *
 |  __O    Thomas C. Sefranek   spam_OUTWA1RHPTakeThisOuTspamARRL.NET
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

> {Original Message removed}

2003\03\15@033408 by Stef

flavicon
face
Thomas C. Sefranek wrote:

>What part of "(must be cleared in software)" don't you understand?
>
No part ;-)
But I love to know where I can find it in the documentation !!
Stef Mientki

{Quote hidden}

>>{Original Message removed}

2003\03\15@035851 by Thomas C. Sefranek

face picon face
I found it in the bit definition of the SSPIF (SPI IRQ flag bit).
That's why I quoted it to you.  I don't have the sheet in front of me
or I'd tell you the page.

 *
 |  __O    Thomas C. Sefranek   WA1RHPspamKILLspamARRL.NET
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

> {Original Message removed}

2003\03\15@063322 by Stef

flavicon
face
Thomas C. Sefranek wrote:

>I found it in the bit definition of the SSPIF (SPI IRQ flag bit).
>That's why I quoted it to you.  I don't have the sheet in front of me
>or I'd tell you the page.
>
thanks,
I looked in the I2C description, and there indeed the speak (sometimes
!)  of
i.e page 74 / DS30292
 "read the SSPBUF and vlear flag bit SPPIF"

So I'll assume it's the same for SPI !

Stef

{Quote hidden}

>>{Original Message removed}

2003\03\15@131234 by Neil Bradley

flavicon
face
> >I found it in the bit definition of the SSPIF (SPI IRQ flag bit).
> >That's why I quoted it to you.  I don't have the sheet in front of me
> >or I'd tell you the page.
> >
> thanks,
> I looked in the I2C description, and there indeed the speak (sometimes
> !)  of
> i.e page 74 / DS30292
>   "read the SSPBUF and vlear flag bit SPPIF"
>
> So I'll assume it's the same for SPI !

Go ahead and assume it - it's a mistake. I can tell you from experience as
of yesterday on the 18F series that it doesn't work this way - data sheet
be damned.

-->Neil

-------------------------------------------------------------------------------
Neil Bradley            In the land of the blind, the one eyed man is not
Synthcom Systems, Inc.  king - he's a prisoner.
ICQ #29402898

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

2003\03\15@133842 by Tom Messenger

flavicon
face
>Go ahead and assume it - it's a mistake. I can tell you from experience as
>of yesterday on the 18F series that it doesn't work this way - data sheet
>be damned.
>
>-->Neil

Neil,
If you are referring to this line: (DS30292C-page 74)
       3. Read the SSPBUF register (clears bit BF) and
       clear flag bit SSPIF.

It is a bit ambiguous. This easily could be read that "reading the sspbuf
reg clears the flags..." but on the very next page is:

       An SSP interrupt is generated for each data transfer
       byte. The SSPIF flag bit must be cleared in software

HTH
Tom M

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

2003\03\15@144537 by Scott Dattalo

face
flavicon
face
On Sat, 15 Mar 2003, Neil Bradley wrote:

> > >I found it in the bit definition of the SSPIF (SPI IRQ flag bit).
> > >That's why I quoted it to you.  I don't have the sheet in front of me
> > >or I'd tell you the page.
> > >
> > thanks,
> > I looked in the I2C description, and there indeed the speak (sometimes
> > !)  of
> > i.e page 74 / DS30292
> >   "read the SSPBUF and vlear flag bit SPPIF"
> >
> > So I'll assume it's the same for SPI !
>
> Go ahead and assume it - it's a mistake. I can tell you from experience as
> of yesterday on the 18F series that it doesn't work this way - data sheet
> be damned.


This is what I have in my SPI interrupt handler:

   MOVFF   SSPBUF,PLUSW2           ;Get the newly received byte
                                   ;(Clears the "buffer full" flag too)
   BCF     PIR1,SSPIF              ;Clear the interrupt flag

I don't look at the BF bit, but for some reason in the past I felt
compelled to add the comment.

Scott

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

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