Searching \ for '[PIC] How to use both I2C and RS-232 with only one' 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: 'How to use both I2C and RS-232 with only one'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] How to use both I2C and RS-232 with only one'
2007\02\13@224021 by Brooke Clarke

flavicon
face
Hi:

Is there an easy way to mux Rx/SDI and Tx/SCk so that the single PIC
port can drive both a MAX232 and an I2C device?
I'm thinking some type of mux driven from an output pin.  The PIC is in
control of when RS-232 or I2C is needed so inputs on the deselected
device are not a problem.  This is for the 16F616 chip.

Have Fun,

Brooke Clarke

--
w/Java http://www.PRC68.com
w/o Java www.pacificsites.com/~brooke/PRC68COM.shtml
http://www.precisionclock.com

2007\02\13@225407 by Robert Rolf

picon face
Brooke Clarke wrote:

> Is there an easy way to mux Rx/SDI and Tx/SCk so that the single PIC
> port can drive both a MAX232 and an I2C device?
> I'm thinking some type of mux driven from an output pin.  The PIC is in
> control of when RS-232 or I2C is needed so inputs on the deselected
> device are not a problem.  This is for the 16F616 chip.

74HC4066 transmission gates give you a bidirectional 200ish switch. Use an external
logic FET to invert the 'enable' so only a single PIC pin is needed.
Use pullups on the disconnected side to keep the signal levels where you want them.

You could also use logic level P & N FETs to synthesize a TG if you need lower on
resistance.
Also look at analog muxs (Intersil, Analog) if low R and high cost are not an issue.

Robert

2007\02\13@225458 by peter green

flavicon
face
> Is there an easy way to mux Rx/SDI and Tx/SCk so that the single PIC
> port can drive both a MAX232 and an I2C device?
> I'm thinking some type of mux driven from an output pin.  The PIC is in
> control of when RS-232 or I2C is needed so inputs on the deselected
> device are not a problem.  This is for the 16F616 chip.
the question that immediately springs to mind is WHY?

given that you can easilly get pics with the devices on seperate pins you seem to be shooting yourself in the foot by picking one with them combined.

things are further complicated by the fact that I2C uses the lines bidirectionally.

if you must do it then i think your best bet is to use something like a 74HC4066 with the I2C pullups and a pullup for the serial output on the far side from the PIC.





2007\02\14@134140 by Brooke Clarke

flavicon
face
Hi Pete:

Adding the RS-232 in addition to the already existing I2C was an
addition to the design.  The 16F916 (sorry about the typo) has the
features needed for the other functionality.  If there's another part
that's in the 28 pin package with seperate I2C and SDA/SCK pins and
otherwise has the same features as the 16F916 can you tell me what it is?

I suggested to Microchip that they add a new search on pin names.  That
way you could search on the names of the functions you need on seperate
pins.  As far as I know all the names are common on all the PICs.  So in
this case I need:

Vdd
Vss
Vss (Microchip want to use 2 Vss pins in the 28 pin package)
Vpp
ICDDAT (RB7)
ICDDCK (RB6)
OSC1
INT (RB0)
TX (RC6)
RX (RC7)
SDA (RC7 conflict)
SCL (RC6 confilct)
TIG (RC4)
RA0
RA1
RA2
RA3
RA4
RA5
RA6
RB1
RB2
RB3
RB4
RB5
RC0
RC1
RC2
RC3
RC5
the above comes to 30 pins since there are a couple of conflicts.  Also
need nanowatt.

Have Fun,

Brooke Clarke

--
w/Java http://www.PRC68.com
w/o Java www.pacificsites.com/~brooke/PRC68COM.shtml
http://www.precisionclock.com

2007\02\14@155204 by Andre Abelian

flavicon
face
Brooke,

Use hardware I2C with software UART.
I tested it works fine. I use CCS compiler
I just specify the pins for UART it does the job.
If you need software uart let me know I have one
for Hi-tech compiler.

Andre Abelian


{Original Message removed}

2007\02\16@094715 by Alan B. Pearce

face picon face
>Adding the RS-232 in addition to the already existing
>I2C was an addition to the design.

Why not use an 8 pin PIC as an I2C to serial device, possibly doing both I2C
and serial in software? Or maybe stretch to an 18 pin with hardware UART and
do I2C in software. Then the original PIC just has to send a message to an
I2C peripheral, which then sticks the message on the serial line.

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