Quantcast
Channel: Data converters
Viewing all articles
Browse latest Browse all 88821

Forum Post: ADS1299 and MSP430F5529 issue reading ID register

$
0
0

Greetings; I'm trying to get the ADS1299 working with the MSP430F5529. Right now i'm trying to do it with the ADS1299EEG-FE board without the MMB0 and the MSP-EXP430F5529. The power for the ADS1299 board and the MSP430 its from the MMB0 to ensure the DGND its share between the two boards. The MSP430 it's running at 25 Mhz.

For the communication i'm using the module USCI_B1: 

- Pin 4.1 = SIMO

- Pin 4.2 = SOMI

- Pin 4.3 = CLK

The frequency on the USCI is 1 Mhz, this are the configuration registers on my program: 3-Wire SPI, 8 bit SPI Master, Clock idle state is LOW, MSB first, and the polarity - phase is as indicated in other posts, CKPH = 1, CKPL = 0.

void USCIB1_setup(void)
{
SPI_SEL |= SPI_SIMO;
SPI_DIR |= SPI_SIMO;

SPI_SEL |= SPI_CLK;
SPI_DIR |= SPI_CLK;

UCB1CTL1 |= UCSWRST;

UCB1CTL0 = UCCKPH + UCMSB + UCMST + UCMODE_0 + UCSYNC;

UCB1CTL1 = UCSSEL_1 + UCSWRST;
UCB1BR0 = 25;
UCB1BR1 = 0;

UCB1CTL1 &= ~UCSWRST;
UCB1IFG &= ~UCRXIFG;
}

For the SPI transfer this is the function i'm using:

unsigned char TX_Byte(unsigned char data)
{
while (!(UCB1IFG & UCTXIFG)); 
         UCB1TXBUF = data;

while (UCB1STAT & UCBUSY);
         return UCB1RXBUF;
}

I already checked the power setup for the ADS1299 but maybe i'm missing something, DRDY is toggling at 250 Hz as indicated on the datasheet but i'm still not able to read the correct value from ID Register. The clock its the one installed on the EVM so CLKSEL = 0. I tried the elegant way for toggling CS, LOW before the OPCODE - RREG and then HIGH without results, so i went for CS LOW the entire operation with the same result. This is the code for the ADS1299 power up sequence: 

void ADS1299_powerup (void)
{

ADS_DIR |= ADS_CS + ADS_RESET + ADS_START;

ADS_OUT |= ADS_START;

__delay_cycles(800000);  // tpor = ~32 ms

ADS_OUT &= ~ADS_RESET; // RESET = 0
__delay_cycles(25); // trst = ~1 µs
ADS_OUT |= ADS_RESET; // RESET = 1
__delay_cycles(225); // Delay before using device ~9 µs

ADS_OUT &= ~ADS_CS;
}

This are the codes for SDATAC and RREG:

void SDATAC (void)
{
TX_Byte(_SDATAC); // SDATAC = 0x11
__delay_cycles(100); 
}

unsigned char RREG (unsigned char _address)
{
unsigned char opcode1 = _address + 0x20;
TX_Byte(opcode1);
__delay_cycles(50);
TX_Byte(0x00);
__delay_cycles(50);
_address = TX_Byte(0x00);
__delay_cycles(50);
return _address;
}

I know that you don't check the whole programming for every answer so i took some screenshots of the oscilloscope, every measure its done with the CLK from the SPI as reference that's because i just have two channels available and no Logic Analyzer.

So basically after the power up sequence if send the SDATAC command so i can read the ID register and that's it, here are the screenshots, the probes i'm using are 10x attenuated.

DOUT from EVM (ADS1299) = Yellow

SPI_CLK = Green

Same picture for more details:

As you can see the code i'm getting from DOUT its not 0x1E as indicated on the datasheet, i checked the ID register value on the EVM software (0x3E), but even that value is not the one i think i get on DOUT (or maybe i'm wrong?).

Sometimes i get this code from DOUT on the EVM:

DOUT from EVM (ADS1299) = Yellow

SPI_CLK = Green

Same screenshot as before:

This is the value i'm sending to the EVM, i think its correct, still here is the screeshot:

DIN on the EVM (ADS1299) = Yellow

SPI_CLK = Green

Same screenshot:

Finally i add photos of my connections between boards:

The connections from J3 on the EVM goes to J5 on the MSP-EXP430F5529:

#define ADS_START   BIT0      // P7.0
#define ADS_DRDY     BIT1      // P7.1
#define ADS_RESET   BIT2      // P7.2
#define ADS_CS          BIT3      // P7.3

Here is a photo of the EVM so you can see my jumpers setup:

I already tried everything i found on the forums without any luck, so this is my last resource. This is my first time using this type of device so don't be hard on me :P. Finally an apologize for any mistake on my writing, English is not my first language. 


Viewing all articles
Browse latest Browse all 88821

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>