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.

[SOLVED] SPI 3 wire communication using PIC

Status
Not open for further replies.

tajiknomi

Member level 4
Joined
Nov 2, 2015
Messages
79
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
754
I am trying to connect my PIC to RTC. The RTC I am using is DS1302 with only one pin for both (Input and Output). I am trying to simulate it using PROTEUS. The problem I am facing is how can I connect PIC two pins i.e. SDO and SDI to one pin (I/O) of RTC?

ScreenShot is here
Capture.PNG

If i make SDO or SDI pin somehow "IN-ACTIVE" for a time then maybe i can succesffuly comunicate b/w PIC and RTC. By the term "In-Active" i means that i make let say SDO pin disable (while recieving byte) i.e. making SDO Neither Input Nor Output for a certain time. How can i achieve this goal.

I have read the datasheet of 16fxxxx but couldn't find the configuration for 3 wire communication.

Any help would be appreciated.

Thank you
 

If i am not wrong you means to say this..

Capture.PNG
 

Wrong. I/O and MISO (SDO) is push-pull output. Can't be connected together to prevent contension.
 

Sorry, I didn't get it. Will you provide a diagram so that I can get what you actually means.
 

I First thought it this way Capture.PNG

But the problem is, when SDO transfers the byte, SDI will pick the same potential as I/O pin. isn't ?
 

Now it is correct. During first byte transfer SPI slave decide to obtain control on IO or not. If you are reading some value, you send read command, next byte IO switching from 3-state to output and MOSI (SDO) signal becames ignored due to high resistance compare to IO because of resistor.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top