CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

SPI and RS232 at the same time 18F2455

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








SPI and RS232 at the same time 18F2455
PostPosted: Mon Sep 07, 2009 5:19 am     Reply with quote

Hi

Is it possible to use the hardware SPI and RS232 at the same time? Some pin will conflict in hw layout?
Guest








PostPosted: Mon Sep 07, 2009 9:34 am     Reply with quote

in 28 and 40 pin families with a full 'C' port pins 6 and 7 are RS-232
and 3,4,5 are SPI

there is NO impediment to using both functions it the same design

Get thee to the data sheets my friend and have a read Very Happy
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 07, 2009 9:41 am     Reply with quote

Quote:
RC6/TX/CK
RC7/RX/DT/SDO

The 18F2455 data sheet shows that RX and SDO are shared pins on this
PIC.
Ttelmah
Guest







PostPosted: Mon Sep 07, 2009 9:54 am     Reply with quote

Anonymous wrote:
in 28 and 40 pin families with a full 'C' port pins 6 and 7 are RS-232
and 3,4,5 are SPI

there is NO impediment to using both functions it the same design

Get thee to the data sheets my friend and have a read Very Happy


No.
On the USB enabled PICs, like this one, unfortunately there is a clash....

It is rather strange actually, in most cases where things like this clash, the manufacturers have fuses that allow you to move the component to other pins, still leaving something clashing, but at least giving you a choice. I suspect the key here is that the RS232 is only seen as likely to be used on a USB PIC, that is emulating a simple UART (and hence not using SPI), and in most cases things that use SPI, are also available in I2C versions (the I2C pins don't clash).

So, choices are find an I2C version of the peripheral involved, or use software SPI.

Best Wishes
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Sep 07, 2009 3:32 pm     Reply with quote

DUH - apologies - my bad

i did not imagine M'chip would screw the pooch so hard - just to shoe horn USB into the family structure

one way to beat the rap:

USE hardware TX on port C
then
use interrupt handled BIT-bang softwareRS-232 RX on any uncommitted digital B-PORT pin ( since most PIN_Bx pins DO support INTS ) - defining a stream then for TX and RX individually and bonding them in your program

that will free up unhindered hardware SPI

OR

if you don't need full RS-232 capability - i could see how to do it
or if you knew that you would not be using SPI at the same time as RS-232 RX - external 'HC08 gates , an inverter and a free PIC digi pin could make sharing doable - externally - but i've just seen what i will be avoiding that family group


does my ignorance of this bit of info show that i only use RS-232 with the Edgeport family ?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group