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.

ADS112U04EVM: No response from UART python script

Part Number: ADS112U04EVM
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!

  • Hi Ch T,

    Welcome to the E2E forum!  There are a couple of things that are often overlooked when using an external processor with the ADS112U04EVM.  When you add the jumper at JP1, the onboard micro is held in a reset state (assuming that USB is being used for power).  The level shifters on the EVM are used as a buffer and are disabled when JP1 is connected.  This means that the RESET pin (connection on J3) is in an undetermined state and will require this pin to be pulled high to DVDD.

    Another common mistake is if powering the 3.3V for the EVM from an external source, the 5V analog supply will not be present.  Both the AVDD and DVDD supplies to the ADS112U04 must be valid or the device is held in a reset state.  So make sure that all supplies to the ADC are available and the jumper to AVDD is in a valid position.

    Another potential issue is sending data at the same time as receiving.  The ADS112U04 is not full-duplex capable and will halt communication and require a reset of the device if RX and TX occur at the same time.

    Best regards,

    Bob B

  • Hi Bob,

    Thanks for the help.

    I have put all the jumpers back to the default position as seen in the user guide. I have made sure that JP11 is tying the middle and 3.3v pin together. 
    I have then put a jumper for the reset pin on J3 to a DVDD pin on the board. Using TP18 (AVDD to ADC) and TP19 (DVDD to ADC) across to a GND, I can measure 3.3V on each test point. Is this the correct settings with the USB cable plugged in or should I move the JP11 back to the 5V position?

    In terms of duplexing, although i'm using a rs232 at the moment, I am using code from a previous question put up on TI that was said to work (This is for debugging purposes). I also tried a rs485 but it ended up giving me incorrect ascii characters when I used spy// on the ports. However I still receive no Bytes from the ADC no matter how long I change the time.sleep command before a ser.read().

    I have realised that when the processor on the board is reset (s4 button),  when jp1 is not shorted, I can read the values sent to the ADC to write the configuration register values. I can also read the values sent to read the ADC when the gui requests it, but even in this situation I don't get the Bytes returned, only the ones sent. It did confirm that the hex values I am sending is correct. 

  • Hi Ch T,

    See my responses below.

    Best regards,

    Bob B

    Ch T said:

    Hi Bob,

    Thanks for the help.

    I have put all the jumpers back to the default position as seen in the user guide. I have made sure that JP11 is tying the middle and 3.3v pin together. 
    I have then put a jumper for the reset pin on J3 to a DVDD pin on the board. Using TP18 (AVDD to ADC) and TP19 (DVDD to ADC) across to a GND, I can measure 3.3V on each test point. Is this the correct settings with the USB cable plugged in or should I move the JP11 back to the 5V position? [Bob] I would start with this supply configuration at least until you can get the communication working.  However if you are powering from the USB, then the AVDD selection on JP11 should work in either position.

    In terms of duplexing, although i'm using a rs232 at the moment, I am using code from a previous question put up on TI that was said to work (This is for debugging purposes). I also tried a rs485 but it ended up giving me incorrect ascii characters when I used spy// on the ports. However I still receive no Bytes from the ADC no matter how long I change the time.sleep command before a ser.read(). [Bob] RS232 and RS485 are standards that imply certain types of interfaces.  The ADS112U04 uses an asynchronous serial communication that operates at a defined baud rate, parity and stop settings at voltage levels that are relative to the DVDD supply voltage to the ADS112U04..  The transmission is binary (not ASCII) and must include the synchronization word for each transmission to the ADS112U04. After power-up, have you tried to read a register to see if you get a response?  Also, make sure that TX from the micro connects to RX on the EVM and RX on the micro connects to TX on the EVM.

    I have realised that when the processor on the board is reset (s4 button),  when jp1 is not shorted, I can read the values sent to the ADC to write the configuration register values. I can also read the values sent to read the ADC when the gui requests it, but even in this situation I don't get the Bytes returned, only the ones sent. It did confirm that the hex values I am sending is correct. [Bob] When you first used the EVM were you able to read/write the registers and collect data through the GUI?  If everything is connected as was original to the EVM, then the ADS112U04 should respond.  Any reasons as to why this would not work would be related to the AVDD and DVDD supplies or the RESET pin held low.  If the RESET pin is permanently held high by tying directly to the 3.3V supply, then the device may not have started properly.  Pressing S4 which invokes a processor reset, would also pulse the RESET pin connected to the ADS112U04 in the original configuration.  If you compare the communication from the firmware, you should see similar communication from your code.  It is also possible that if the ADS112U04 worked initially but doesn't respond now the device could have been damaged if the processor was connected while the EVM or ADS112U04 was unpowered.

  • Hi Bob,

    Sorry for the long wait. I have managed to get communication between the PC and the ADC (I think my script wasn't flushing the output buffer correctly - needed a time.sleep(0.01) before it), however I have only managed to do this with a TTL-rs232-3.3v USB connector. This works fine for testing, however I do need this be only straight two wire communication without the TTL. I am now wondering if the ADC can communicate with +13V to 0V signals?

    I think it doesn't but I would like some confirmation in case I will need a MAX232 for this.

    Kind Regards

  • Hi Ch T,

    You can only communicate to devices that are logic level devices in the voltage range of DVDD of the ADS122U04.  If you need RS232 levels, then you will require an interface device such as the MAX232.

    The ADS122U04 was not designed to directly interface with RS232 signaling levels.  The major thought behind this device was for crossing isolation barriers where the signaling levels would be within standard logic levels to the interface devices.  It is certainly possible to convert the I/O levels to other protocols and voltage levels such as RS232, RS485, etc..

    Best regards,

    Bob B