Other Parts Discussed in Thread: ADS112U04, MAX232, ADS122U04
Hi,
I am currently trying to change the configuration registers on a ADS112U04EVM, however I am getting no response from the device when trying to read the registers or manually get a conversion result.
I have read a few posts on this device and I thought I am doing everything correctly in terms of software. I have posted most of it below anyway. I have confirmed it works by checking the write output to my computer through putty.
There is also a a lot of jumpers and switches on the device. I have tried to stop the Tiva processor on the device by shorting it on JP1, this didn't change anything. I am also wondering if I need to pull the GPIO1 pin on J3 high since the data sheet for the non-EVM version shows that it must be pulled up to take commands as said in a previous post on TI, however it does not say this for the EVM version.
Here is the code:
----
#set serial data
ser = serial.Serial ('/dev/ttymxc0', 115200, bytesize=serial.EIGHTBITS, stopbits=serial.STOPBITS_ONE, timeout=1)
#reset
ser.write(struct.pack('!BB', 0x55, 0x06))
ser.flushOutput()
time.sleep(0.1)
#set registers for continuous conversion
ser.write(struct.pack('!BB',0x55,0x22)) #read config register 1 - should be 0x00
ser.flushOuput() #send everything left in the buffer
conf1_read = ser.read().rstrip() #read
print("Config reg 1") #test statement
print(struct.unpack('!B',conf1_read)) #show values
time.sleep(0.1)
ser.write(struct.pack('!BBB',0x55,0x42,0x48 )) #sync word - write to register 1 - change data to 0x48
ser.flushOutput()
time.sleep(0.01)
ser.write(struct.pack('!BB',0x55, 0x22)) #sync word - read config register 1 again to ensure write has worked
ser.flushOutput()
conf1_read = ser.read().rstrip()
print("Config reg 1")
print(struct.unpack('!B',conf1_read))
ser.flushOutput()
time.sleep(0.01)
#output the data recieved from the ADC
while True:
#START/SYNC byte
ser.write(struct.pack('!BB',0x55,0x08)) #start conversions command
ser.flushOutput()
time.sleep(0.01)
ser.write(struct.pack('!BB',0x55,0x10)) #Read DATA (RDATA byte) command
ser.flushOutput()
received_data = ser.read().rstrip() #read serial port
data_left = ser.inWaiting() #check for remaining byte
print(struct.unpack('!B', received_data) #print to terminal received data
----
Thanks for any help!