1. How do you manually bring chip select low? I am currently using a random GPIO pin that is not being used and bringing it low. I am not sure, however, if the driver will recognize that as the slave/chip select.
2. Is there a way to wait a certain amount of time between bytes during the transfer of a frame?
- I am currently using spidev but open to using any library. Is there another library more appropriate with good documentation?
- Raspberry Pi 3 Model B
This is what I currently have:
Code: Select all
import spidev import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(37,GPIO.OUT) spi = spidev.SpiDev() ret = spi.open(0,0) spi.max_speed_hz = 80000 spi.mode = 3 if __name__ == "__main__": data_out = [0x01, 0x42, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF] while True: GPIO.output(37, GPIO.LOW) time.sleep(1/1000) for i in data_out: data_in = spi.xfer2(data_out) time.sleep(1/20000000) print(data_in) GPIO.output(37, GPIO.LOW) time.sleep(1)