Other Parts Discussed in Thread: REF6030, REF6050
Hello Keith,
Now I am trying to use 2 ADC to obtain 2 channel input for 2 process values using ADS8860 EVM in prototype stage.
I have connected it in the following way to use ADS8860 in 4wire CS mode:
The DIN pin of both cards is connected to my MCU ports P2.3 and P2.7 individually
The CONV pin of both cards is connected together to my MCU port P2.6
The SDO pin of both cards are connected to my MCU port P2.5(remappable to PM_UCA0SOMI)
The CLK pin of both cards are connected to my MCU port P2.0(remappable to PM_UCA0CLK)
REF voltage (REF6030 used instead of REF6050) is changed to 3V which has been checked
Avdd and Dvdd voltage provided is 3.3V which has been checked
Now for reading the ADC count for CH1 coming to input of card1 and CH2 coming to input of card2 following is implemented in the software:
1) First CONV pin for both cards is kept permanently high. Therefore P2.6 is kept high from MCU. The voltage level at CONV was observed to be 3.3V
2) Then initially both DIN pin is kept high for both the cards
3) After 1ms delay, DIN of CH2(P2.7) is turned Low and data is read from DOUT using SPI read driver and value for CH2 is stored
4) Then after 1m delay, DIN of CH1(P2.3) is turned Low and data is read from DOUT using SPI read driver and value for CH1 is stored
Now here I found that the value received in DOUT is 0xffff even if the analogue input when measured changed from 0 – 3V. When checked in oscilloscope I always get the DOUT signal as high. Please find below the software implemented, changes done in hardware is as above(also provided the schematic of ADS8860 with changes written on it) and the oscilloscope screenshot attached.
In the oscilloscope the green coloured waveform is SCLK, pink coloured signal is for P2.3 and blue coloured signal is for P2.7 given to individual DIN from MCU
DOUT is the yellow coloured signal
uint16_t SPI_ADC_CH_Read(ADC_Ch_EnumTypeDef enPV_SV)
{
__delay_cycles(24000);//1ms delay
if(POSITION_ADC_COUNT == enPV_SV)
{
P2OUT |= 1 << 3;//DIN for 1st channel is high for data conversion
P2OUT &= ~(1 << 7); //DIN for 2nd channel is low for data acquisition
adc_read_val_adc = SPI_Read();//SPI_Read is the driver to read data via SPI interface
}
else
{
P2OUT |= 1 << 7; //DIN for 2nd channel is high for data conversion
P2OUT &= ~(1 << 3); //DIN for 1st channel is low for data acquisition
adc_read_val_adc = SPI_Read();
}
return adc_read_val_adc;//adc_read_val_adc returns data as per channel specified
}
uint16_t SPI_Read(void)
{
uint16_t adc_read_val_msb;
uint16_t adc_read_val_lsb;
UCA0TXBUF = 0x0FF; //TX buffer write to initiate SPI transfer
while (!(UCA0IFG & UCTXIFG));
while(UCA0STAT & UCBUSY);
UCA0IFG &= ~UCTXIFG;
while(!(UCA0IFG & UCRXIFG));
while(UCA0STAT & UCBUSY);
adc_read_val_msb = UCA0RXBUF;//Read 1st byte by reading SPI buffer
UCA0TXBUF = 0x0FF; //TX buffer write to initiate SPI transfer
while (!(UCA0IFG & UCTXIFG));
while(UCA0STAT & UCBUSY);
UCA0IFG &= ~UCTXIFG;
while(!(UCA0IFG & UCRXIFG));
while(UCA0STAT & UCBUSY);
adc_read_val_lsb = UCA0RXBUF; //Read 2nd byte by reading SPI buffer
return ((adc_read_val_msb << 8) | (adc_read_val_lsb));
}
I would like to know following:
1) Since I am using 4wire CS mode on the EVM which is not designed for the same, what more changes are required so that I can get the output for 2 channel input
2) Whether pullup of 10K which is already provided for DOUT in the EVM is OK or whether it should be removed The DOUT is connected to both boards and then pullup is added in the line to MCU. ALso there are 2 pullup resistors in parallel coming to each other as both DOUT line with pull up are connected together and given to MCU
With warm regards,
Dhiren