Other Parts Discussed in Thread: TLA2528
Tool/software:
Hi TI Team,
Following my last post regarding my unresponsive TLA2518, I have successfully corrected the issue.
Now I am receiving data but despite correctly setting the registers for Auto Sequence and Channel Append, I am not receiving a correct channel update.
The TLA2528 channel append worked really well but I can't get it to function on the TLA2518.
Here is the output from setting up the device. Can you see anything wrong with these register settings?
** Monitor Output **
TLA2518 ADC2 started
All Pins Set to Inputs
Channel Append Added to Result
OSR Register =:11
Sampling Speed set to 160 SPS & Oscillator set to Low Power
All Pins added to Auto Sequence
Auto Sequence Started
System Status ADC2 = :11000001
ADC2 Configuration Complete
ADC2 Config =:
-------- TLA2518 --------
System Status = 11000001
General Config = 0
Data Config = 10000
OSR Config = 11
OP Mode = 11111
Pin Config = 0
GPIO Config = 0
GPO Drive Config = 0
GPO Value = 0
GPI Value = 0
Sequence Config = 10001
Manual Channel Select = 0
Auto Sequence Channel Select = 11111111
-------- TLA2518 --------
Battery Voltage =: 10011000110
Channel =: 101 **Should be AIN0**
Battery Voltage =: 1111111000110
Channel =: 101 **Should be AIN1**
Battery Voltage =: 1111110001000
Channel =: 101 **Should be AIN2**
Battery Voltage =: 11011100000
Channel =: 101 **Should be AIN3**
In addition to the channel ID error, the reading above is also incorrect in that I expect with 1.1VDC on AIN0 (DVDD & AVDD = 5VDC), a reading of 14,418 or 0011100001010010 (16 bits due to OSR being on) should be presented. I am also expecting the 4 bit channel ID to occupy bits 16-19. I'm reading the value into an array that is 3 x 8 bit elements long so array element 0 & 1 will have the data and element 2 has the channel ID. The channel ID needs bit shifting 4 bits to the right to make it correct. Code is pretty straightforward. Is it possible that I'm getting the data out as LSB first, through to MSB? My understanding of the chip manual and the ESP32 SPI implementation is that it should be giving MSB first?
Should I wait for the SYSTEM_STATUS OSR_DONE bit to be set before trying to read the data? I didn't need to do this with the TLA 2528 so haven't implemented it.
The main reason for the question is that as I'm able to set and read registers OK, my understanding of the SPI comms seems sound.