I am trying to connect the ADS 8688 EVM to my Pi through SPI. I have used two methods to power on the ADS8688EVM.
1. Through PDK
2. Without the PDK
After connecting the miso-sdi, mosi-sdo, cs-cs and sclk-sclk on the two respective boards, I ran numerous random codes.
for example:
import spidev
import time
# Create an SPI object
spi = spidev.SpiDev()
spi.open(0, 0) # Open SPI bus 0, device 0 (CE0)
# Define SPI settings
spi.max_speed_hz = 1000000 # Set the SPI clock speed (adjust as needed)
spi.mode = 0 # Set SPI mode (0 or 3)
try:
while True:
# Create a pattern of bytes to send
send_data = [0x55, 0xAA, 0x33, 0xCC]
# Transmit the data over SPI
received_data = spi.xfer2(send_data)
# Print sent and received data
print("Sent Data: ", send_data)
print("Received Data:", received_data)
# Add a delay between transactions
time.sleep(1)
except KeyboardInterrupt:
spi.close() # Close the SPI connection on Ctrl+C
In both the cases I am getting my output on the pi as follows:
sent data [0,0,0,0]
received data [0,0,0,0]
kindly help.
regards
shakil anwer