Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help with I2c and SPI

Status
Not open for further replies.

poodina

Junior Member level 1
Joined
Apr 5, 2009
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,456
i2c and spi connection

I need to interface SPI and I2c device to the same Microntroller, how do I go about doing this. There a 2 SPI digital pots and 3 I2c device like RTC,EEPROM,and PORT expander. I have done the I2c connection need to do the SPI connection.
I do not need simultaneous use of SPI and I2c. so how do I connect these devices.
I am using PIC16F887.
 

Hi Poodinadina ,
i'm trying to do the same with the same microcontroller
1) need to connect i2c
2) SPI

any tips so far ?
10nx
--udi
 

Yes I have used the SPI and I2C on same controller. using different pins. complete set of pin for one and a different set of pins for the other. and it works.
You can rewrite the library codes for the pins, cause the library works only with standard pins on the controller, and it does not work with other pins.
you will have to determine the CLK and generate it using a timer and have to set the data. go through the actual working of both and you'll understand.
 

poodina said:
Yes I have used the SPI and I2C on same controller. using different pins. complete set of pin for one and a different set of pins for the other.
Was going to suggest the same thing - use 5 separate pins (SPI MISO, SPI MOSI, SPI SCLK and I2C SDA, I2C SCL).

PICs tend to have one hardware peripheral that can be either SPI or I2C. Either of the buses can be implemented in software too (bit banged), however that has 2 limitations to keep in mind:
1. Software implementation has to be a master and can't be a slave.
2. Software implementation is slower than hardware peripheral.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top