Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Problem with I2C and SPI.

Status
Not open for further replies.

Bizzare

Newbie level 4
Joined
Mar 15, 2011
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,335
Hi guys, I'm putting together a project based on a data acquisition system using a microchip P16F877A, external EEPROM (24LC256) and an accelerometer (ADXL345).

In my code I set up pins C3 and C4 for I2C to transfer data to the external EEPROM and pins C6 + C7 for RS232 to a PC to upload the data for analysis.

My problem is.....after reading the ADXL345 datasheet it says the accelerometer is to be used in SPI or I2C mode. Is that possible considering I'm already using the pins for the EEPROM.

I'm wondering if there is a way around this, but I'm fairly new to coding and understanding PICs, so any advice on what could be done would be helpful, Thanks in advance.
 

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
4,943
Helped
1,082
Reputation
2,174
Reaction score
1,071
Trophy points
1,393
Location
California, USA
Activity points
27,029
I think you've got only one I2C/SPI port on that device. But, you can hang multiple devices on the bus, they just need to have different addresses. That's the short answer. The long answer is: you'll need to educate your self about I2C or SPI-but it's not that hard. (At least, not as hard as USB or Ethernet).

Actually, with SPI you would use separate CHIP SELECTS, there's no addressing like in I2C.
 
Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top