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.
I'm trying to connect the ADS7953 to a microcontroller a TMS320F28335. The ADC is mounted on a EVM PCB so the circuit diagram can be found in the datasheet for the ADS7953EVM.
I'm having trouble changing the channels that I want to read from. Eventually I want to use mode auto-2 and multiplex through all of the channels. However when I connect the ADC it only outputs 0x0FFF and the channel address (in the first byte) doesn't change.
For debugging purposes I'm using manual mode and selecting a random channel (channel 4 in this case) in 5V mode. So I'm sending the ADC 0x1A40.
The communication signals seem to be fine. I've measured the signals on the pins of the ADC chip (shown below). The signals are:
purple - SDI
yellow - /CS
blue - SCLK
I know that I can just send 0x0000 after the initial 0x1A40 command but I just resending it to make sure that it communicating correctly.
So I think the signals look correct and I've checked all the power supply lines to the chip and they look ok.
However, on the output SDO line I still get 0x0FFF as a signal (this is also verified when monitored on the oscilloscope). So for some reason it's still not able to select a different channel.
Does anyone know what could be wrong?
Thanks in advance.
Hello Paul,
This seems to be a SPI mode issue. The ADS7953 devices expect settled DIN data at SCLK rising edge. However, the scope screenshot shows SDI changing during SCLK rising edge. This will send wrong data to the ADS7953.
Try changing the SPI phase to send data during falling edges. Also, make sure data from SDO is read during rising edges. This will match SPI mode CPOL=0,CPHA=0.
Let us know if this solves the issue.
Best regards,
Rafael
Hi Rafael,
I originally had it in SPI mode CPOL=0, CPHA=0. I've tried it with CPOL=1, CPHA=0 and it still doesn't seem to work. Outputs a constant high signal for both cases.
I've set the SPI registers as follows (TMS320F28335). CPOL and CPHA are set in the SPICCR and SPICTL registers:
// Initialize SPI FIFO registers
SpiaRegs.SPICCR.all = 0x000F; // 16-bit character, Disable loopback mode
SpiaRegs.SPIFFCT.all = 0x00; // Transmit delay
SpiaRegs.SPIBRR = 0x007F;
SpiaRegs.SPICTL.all = 0x0017; // Interrupt enabled, Master/Slave XMIT enabled
SpiaRegs.SPIFFTX.all = 0xC021; // Enable FIFO's (with interrupt)
SpiaRegs.SPIFFRX.all = 0x0021;
SpiaRegs.SPISTS.all = 0x0000; // Clear status register
SpiaRegs.SPIPRI.all = 0x0010; // Free emulation mode control
// Enable SPI
SpiaRegs.SPICCR.bit.SPISWRESET = 1;
SpiaRegs.SPIFFTX.bit.TXFIFO = 1;
SpiaRegs.SPIFFRX.bit.RXFIFORESET = 1;
Hello Paul,
In the scope, the ADC is reading 0x0D20, which is why it is ignoring the command.
The confusing thing is that the SPI modes in this DSP don't match the standard SPI modes.
To have the DSP in standard mode CPOL=0, CPHA=0, the register should be programed as CPOL=0 and CPHA=1 so that:
SPICCR.6 = 0 and SPICTL.3 = 1. This will read data in rising edge and send data in falling edge with the first bit clocked before the first rising edge.
Regards,
Rafael
Hi Rafael.
So I've changed the registers to CPOL=0, CPHA=1 and it looks like it's actually doing something.
It's still not giving me exactly what I want but I'll try sort out the issues myself. At least I have some idea of what the problem is now. I post again if I'm still having trouble.
Thanks a lot.
Cheers.
Paul