I have a raspberry pi v2 serving as the master, and a pic16f767 as a slave. I can transmit data from the pi to the pic just fine, but I cannot clock data out, and here's why:
The Pi is pulling the chip select lines (I tried both of them) low a few microseconds after transmission, and it's making my PIC think that it missed some data.
I'm using a simple Python program to transfer bytes to the PIC.
Code: Select all
spi = spidev.SpiDev()
num = raw_input("Enter Hex: ")
numHex = int(num, 16)
ret = spi.xfer2([numHex])
I've attached a screen shot of the scope. #1 is the CS line for the PIC, 2 is the clock, 3 is SDO (of the pi), and 4 is SDI (into the pi). The yellow line is the write collision flag on my pic (PIC16F767). You can see on the left hand side, the chip select goes low for about 10uS after the chip select has been released. I tried connecting the SPI on the pi directly to the scope, and I get the same waveform. The pi is pulling the chip select line low after it's done transmitting.