Hello,
I have been trying to connect the ADS1298 with an ODROID C1 through SPI. I have the 4 SPI channels and 2 signals for the Reset and the Start pins.
I have issues with the actual sending of the commands SDATAC and the read ID, also with sending the START but I can go arround by connecting it to one of the GPIO pins of the ODROID and driving it HIGH or LOW.
My code is bellow I hope you can help me.
I have verified steps 1, 2, 4, 5 and 6 in [FAQ] ADS129x: How do I verify that my ADS129x device is still functional?; and steps 1 and 2 in [FAQ] ADS129x: I'm having trouble communicating with my ADS129x device via SPI. What debug steps I should try?. AdditinallyI know the SPI communication is working since I verified that when the MOSI and MISO channels were connected together the messages were passing correctly.
Thank you very much for your time in advance and if there is any extra info you need ask me please,
Best,
Sofia
import os import time import RPi.GPIO as GPIO import wiringpi wiringpi.wiringPiSetupGpio() # For /sys/class/gpio with GPIO pin numbering START = 0x08 SDATAC = 0x11 RREG = 0x20 ID = 0x00 channel = 0 speed = 3906250 mode = 1 Fd = wiringpi.wiringPiSPISetupMode (channel, speed, mode) print Fd ### Reset pin High ### wiringpi.pinMode(100, 1) # Set pin 6 to 1 ( OUTPUT ) wiringpi.digitalWrite(100, 1) # Write 1 ( HIGH ) to pin 6 pin = wiringpi.digitalRead(100) # Read pin 6. print pin time.sleep(0.5) # secs --> tPOR > 2^18tCLK; internal fCLK = 2.048 MHz; tPOR = 0.128sec ### Reset pulse ### wiringpi.pinMode(100, 1) # Set pin 6 to 1 ( OUTPUT ) wiringpi.digitalWrite(100, 0) # Write 1 ( HIGH ) to pin 6 time.sleep(0.1) # secs --> sleep >2xtCLK; internal fCLK = 2.048 MHz; tRST = 0.0000009765625sec wiringpi.digitalWrite(100, 1) # Write 1 ( HIGH ) to pin 6 time.sleep(0.1) # secs --> sleet tRST - 18 tCLKs; 18 tCLKs = 000000087890625sec #########Setting SPI communications####### #### Registers can then be writen #### print "SDATAC Command" buf = bytes([SDATAC]) SDATACreturn = wiringpi.wiringPiSPIDataRW(channel, buf) print SDATACreturn time.sleep(0.5) print "START Command" wiringpi.pinMode(116, 1) # Set pin 6 to 1 ( OUTPUT ) wiringpi.digitalWrite(116, 1) # Write 1 ( HIGH ) to pin 6 time.sleep(0.1) # secs --> sleep >2xtCLK; internal fCLK = 2.048 MHz; tRST = 0.0000009765625sec buf = bytes([RREG, ID]) ID_return = wiringpi.wiringPiSPIDataRW(channel, buf) print ID_return