This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HOW TO CHECK ID OF ADS1293

Other Parts Discussed in Thread: ADS1293

hello, can anyone help me, I'm currently trying to find out if my ads1293 has connected to a raspberry pi 4 by using the REVID register from the datasheet provided.

However, the code I'm using states that Device ID = 0X0, which should be 0X01 .

Can someone help me tell the error? I'm currently using python.
Thank you.

this is the code:

import RPi.GPIO as GPIO
import spidev
import time

# GPIO pin
#MOSI = 19
#MISO = 21
#SCLK = 23
#GND = 25
#CE0 = 24
#DRDY = 22

"""Global Variabel"""
Vref = 2.4
#NUM_ECG = 3


"""inisialisasi pin""" # Gunakan board GPIO
PIN_MOSI = 10
PIN_MISO = 9
PIN_SCLK = 11
PIN_CS = 0
PIN_DRDY = 25

""" SPI Device init """
spi= spidev.SpiDev()
spi.open(0,0)
spi.max_speed_hz = 20000000
spi.mode = 0b01

"""inisialisasi GPIO"""
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

#GPIO.setup(PIN_MOSI,GPIO.OUT)
#GPIO.setup(PIN_MISO,GPIO.IN)
#GPIO.setup(PIN_SCLK,GPIO.OUT)


GPIO.setup(PIN_CS,GPIO.OUT)
GPIO.setup(PIN_DRDY,GPIO.IN)

#READ SPI
GPIO.output(PIN_CS, GPIO.LOW)
time.sleep(1)
spi.writebytes([0xC0]) # 0xc0 = 1100 0000
ID_sig = spi.readbytes(1)
print ("Device ID:",hex(ID_sig[0]))

#Stop
GPIO.output(PIN_CS, GPIO.HIGH)
spi.close()
GPIO.cleanup()
print("Done")

  • Hello Vinsensia, 

    Allow me to take a look. Someone from our team will get back to you within 24 hours. 

    Kind regards,
    Nick Z

  • Hi,

      We don't really support Raspberry Pi.

    However, several things I may suggest to make sure you establish the SPI connection correctly using Oscilloscope probe -

    First, check your VSSIO, VDDIO, VSS and VDD Voltages are correct.

    What are your XTAL, CLK and SCLK frequency or period?

    Make sure to set the STRTCLK properly -

      Refer to page 9 Figure 2. Read Timing Diagram and Page37 Figure 29 Serial Interface Protocol in the data sheet

       Can you probe DRDBY, SCLK, CSB, SDI and SDO pins when you try to read the REVID register(address 0x40)?

       CSB - You should see CSB goes low first.

       SDI - If you are trying to read, you should then see SDI pin be high at SCLK's rising edge. Then, you should see 100 000(0x40) in SDI during 7 SCLK's rising edges.

       SDO - Then , you should see 0000 0001(0x01) comes out at SDO during 8 SCLK's falling edges.

    Thanks

  • Hi,

    This ticket/thread has been pending for more than 1 week.

    For house cleaning, I am closing this ticket/thread.
    If you may have other question, feel free to open another ticket/thread.

    Thanks