PDA

View Full Version : Share MCU Pin between enc28j60 and mcp3202



moacyr
- 19th September 2012, 01:56
Hi,

How can I share pins used with mcp3202 and enc28j60 ?

The CS must be diferent pin ??
Can I use SI and SO in the same MCU port with enc28j60 with AND GATE (up to 5v the signal) on ENC output ? I do it using mcp3202
CLK pin may be the same for both chips ?

My mcu is pic18f4550

Thanks a lot

falingtrea
- 19th September 2012, 17:33
Typical SPI design allows the CLK, SOUT, and SIN signals to be shared between multiple devices. This is because the CS pin is used to determine which part is active on the bus. So the CS pin of each device needs to be a dedicated I/O pin.

longpole001
- 24th September 2012, 11:37
another option depending on your other SPI devices can be a daisy chain

6675

but often this is the standard way

6676

check with the registers and setup of the chip doco , but it looks like it conforms to standard SPI bus interface

longpole001
- 24th September 2012, 22:55
Please take note that timing of the spi bus needs to be considered for the slowest device , and when not using the chips built in spi pins and registers , then you can use the PBP shiftin , shiftout command set , but dual direction spi communication is not available.

moacyr
- 26th September 2012, 13:58
Hi,

Thanks for reply

Enc28j60 can receive 5v signal but the out pin send 3.3v ttl. What will I need to convert ?

longpole001
- 27th September 2012, 01:12
one way is to run the pic at 3.3v and other spi devices at 3.3v but if thats not desirable , then use a level converter on the 3.3v device on the spi interface , mainly the data out on the spi bus of the 3.3v device , do a search on here for level converters , should find more than few posts

longpole001
- 27th September 2012, 12:02
also dont enable week pullups on the spi bus when the pic is at 5v when the other device is at 3.3v ,as it can increase the current draw , its should be noted that the data out of the 3.3v device may still work ok on the spi bus depending on the speed of the spi bus and what level the logic 1 is accepted by the PIC , but level converters resolves this issue