Searching \ for '[PIC:] HW SPI and SW I2C on the same I/O pins?' 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: 'HW SPI and SW I2C on the same I/O pins?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] HW SPI and SW I2C on the same I/O pins?'
2003\11\13@153839 by Thomas

picon face
Hi everyone,

I understand that the PIC can not support both HW SPI and I2C at the same time, but I am just wondering if it is possible to use HW SPI and software I2C (master mode) on the same I/O pins (RC3 and RC4)?

Thank you in advance!

Thomas


---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

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

2003\11\13@161747 by Thomas Sefranek

face picon face
You can bit bang SPI out any digital port,
and let the IIC run on the internal port C in the PIC.

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

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

> {Original Message removed}

2003\11\13@201348 by D. Jay Newman

flavicon
face
> Hi everyone,
>
> I understand that the PIC can not support both HW SPI and I2C at the same time, but I am just wondering if it is possible to use HW SPI and software I2C (master mode) on the same I/O pins (RC3 and RC4)?
>
> Thank you in advance!

If you want to use the same pins, then why not switch the hardware back and
forth?

If you're doing one in software, I'd put it on different pins.
--
D. Jay Newman           !
.....jayKILLspamspam@spam@sprucegrove.com     ! Xander: Giles, don't make cave-slayer unhappy.
http://enerd.ws/robots/ !

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

2003\11\13@215401 by Bob Axtell

face picon face
I feel exactly the opposite: I like bit-banging the I2C and use the PIC SPI
port, which is fully-featured, fast, and truly automatic. The I2C feature
on most PICs is ho-hum and needs a lot of handholding- so, might as well
just bit-bang it.

--Bob

At 02:16 PM 11/13/2003, you wrote:
{Quote hidden}

> > {Original Message removed}

2003\11\13@230326 by Thomas

picon face
Thank you all for your time.  I haven't try to switch between the HW SPI and HW I2C mode yet.  I hope it won't have any conflict.
Thomas

Bob Axtell <.....cr_axtellKILLspamspam.....YAHOO.COM> wrote:
I feel exactly the opposite: I like bit-banging the I2C and use the PIC SPI
port, which is fully-featured, fast, and truly automatic. The I2C feature
on most PICs is ho-hum and needs a lot of handholding- so, might as well
just bit-bang it.

--Bob

At 02:16 PM 11/13/2003, you wrote:
{Quote hidden}

> > {Original Message removed}

2003\11\13@231613 by Herbert Graf

flavicon
face
> I feel exactly the opposite: I like bit-banging the I2C and use
> the PIC SPI
> port, which is fully-featured, fast, and truly automatic. The I2C feature
> on most PICs is ho-hum and needs a lot of handholding- so, might as well
> just bit-bang it.

       The PIC's I2C hardware is "ho-hum" by design: the flexibility is required.
There are SO many different I2C devices out there using different methods to
work, things like repeated starts, clock stretching, multiple byte reads,
bus arbitration. While your "bit banging" may SEEM simpler it certainly
doesn't have all the features to act like a COMPLETE I2C master. TTYL

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

2003\11\14@030553 by o-8859-1?Q?Tony_K=FCbek?=

flavicon
face
Hi,

Bob Axtell wrote:
>I feel exactly the opposite: I like bit-banging the I2C and use the PIC SPI
>port, which is fully-featured, fast, and truly automatic. The I2C feature
>on most PICs is ho-hum and needs a lot of handholding- so, might as well
>just bit-bang it.

And thats were we can agree to disagree :) I feel that i2c is normally best handled by the PIC and that SPI
(dead simple, no ack/nak, etc) is easiest done in s/w.
Also I've found that most of my project needing i2c uses the 'old'
legacy timing on the i2c (100kb), due to the chips I need to put onto the bus, and is therefore quite slow, my i2c master mode code have it's own buffer and irq handler I just the put data into the buffer and continue my program. The transmission is fully in the background. Ofcource there are some safeguards in the handler to deal with timeouts, a new transmission beeing requested before the previous has emptied the buffer, etc. however once the i2c handler has all these features it's dead easy to use.
On the other hand spi is really simple to do in s/w and normally there are
no timing restrictions, you can bitbang as fast as you like without halting
your program.

Well different tastes and styles I assume, there no way to say that either way is
the right way. But what can be agreed upon (imho) is that many projects needs *both*
i2c and spi, and that the pics are limited in this regard as they normally do not have
the option to use the h/w for both these task simultaniously. I'm really not sure about
the reasons for this by Microchip.


/Tony

--
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\11\14@123515 by Thomas

picon face
I found that even the greatest PICmicro (18F8720), which has many I/O, has only one SPI/I2C port.  This really piss me off!  I need I2C to communicate with the graphic LCD module & some external EEPROMs, and a (fast) SPI to communicate with some 16-bit D/A and A/D.  I chose to do S/W I2C because the LCD and the E2 doesn't need to be updated too quickly, but the D/A and A/D are needed to be accessed FAST.
Thomas

Tony_K|bek <tony.kubekspamspam_OUTFLINTAB.COM> wrote:
Hi,

Bob Axtell wrote:
>I feel exactly the opposite: I like bit-banging the I2C and use the PIC SPI
>port, which is fully-featured, fast, and truly automatic. The I2C feature
>on most PICs is ho-hum and needs a lot of handholding- so, might as well
>just bit-bang it.

And thats were we can agree to disagree :)
I feel that i2c is normally best handled by the PIC and that SPI
(dead simple, no ack/nak, etc) is easiest done in s/w.
Also I've found that most of my project needing i2c uses the 'old'
legacy timing on the i2c (100kb), due to the chips I need to put onto the bus, and is therefore quite slow, my i2c master mode code have it's own buffer and irq handler
I just the put data into the buffer and continue my program. The transmission is
fully in the background. Ofcource there are some safeguards in the handler to deal
with timeouts, a new transmission beeing requested before the previous has emptied the buffer, etc. however once the i2c handler has all these features it's dead easy to use.
On the other hand spi is really simple to do in s/w and normally there are
no timing restrictions, you can bitbang as fast as you like without halting
your program.

Well different tastes and styles I assume, there no way to say that either way is
the right way. But what can be agreed upon (imho) is that many projects needs *both*
i2c and spi, and that the pics are limited in this regard as they normally do not have
the option to use the h/w for both these task simultaniously. I'm really not sure about
the reasons for this by Microchip.


/Tony

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

---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

--
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\11\14@150517 by Olin Lathrop

face picon face
Thomas wrote:
> I found that even the greatest PICmicro (18F8720), which has many I/O,
> has only one SPI/I2C port.  This really piss me off!  I need I2C to
> communicate with the graphic LCD module & some external EEPROMs, and a
> (fast) SPI to communicate with some 16-bit D/A

If all you need are IIC and SPI masters (whic it sounds like), you can
implement them easily in software.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.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 2003 , 2004 only
- Today
- New search...