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.

What are the connections needed for SPI connections between two PIC16F4620?

Status
Not open for further replies.

akhileshchidare

Member level 3
Joined
Oct 4, 2005
Messages
59
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,758
what are the connections to be made for SPI connections between two PIC microcontrollers(18F4620). one is master and other is slave. what are the connections are to be made apart from SPI pins? Slave select or Chip Select?
what are bits to be checked for transmitting and receiving the data?

thanx in advance
 

Re: PIC SPI

Basically you just need the SPI signals and one GPIO connected to the SS pin of the device that is the slave.
Basically, the BF (buffer full) is the one normally checked to see if data is available when receiving, or to see if the buffer is empty and so a new byte can be loaded and transmitted. For the slave, the interrupt is recommended.
 

Re: PIC SPI

i am using only one slave. so do i need to connect the SS pin?
i am not able to transmit any data...
can u give an example code?
 

Re: PIC SPI

akhileshchidare said:
i am using only one slave. so do i need to connect the SS pin?
i am not able to transmit any data...
can u give an example code?

IMHO, the SS need to be connected too. I use bit banging technique rather than the SPI engine. The code can be ported to any uC that do not have SPI engine.

Cheers

Ravi
 

Re: PIC SPI

ravimarcus said:
akhileshchidare said:
i am using only one slave. so do i need to connect the SS pin?
i am not able to transmit any data...
can u give an example code?

IMHO, the SS need to be connected too. I use bit banging technique rather than the SPI engine. The code can be ported to any uC that do not have SPI engine.

Cheers

Ravi

if i have 3 to 4 slaves(PIC), how the connection will look like?can you give me a schematic for references how i can connect it?
 

Re: PIC SPI

You do not need to use the SS pin on the slave if you disable it: SSPCON:<SSPM3:SSPM0> (0101).
SS pin can then be used as I/O. Remember to configure TRIS bits for port pins.

If the two devices are running from separate supplies do not forget the GND interconnection.

Very helpful reading with code examples:

https://ww1.microchip.com/downloads/en/DeviceDoc/31015a.pdf

https://ww1.microchip.com/downloads/en/DeviceDoc/spi.pdf

https://ww1.microchip.com/downloads/en/DeviceDoc/33023a.pdf


Polymath
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top