Hi Chetan, What is the clock polarity set to? This DAC requires data to be shifted out on the falling edge, and the DAC captures the data on the rising edge. If clock phase = 1, the clock polarity should = 1. Best, Katlynne Jones
↧
Forum Post: RE: DAC8831: Voltage Supply and grounding for Bipolar Implementation of DAC
↧
Forum Post: RE: ADS1261EVM: modes
Hi Daria, Thanks for providing more information. ADS1261 datasheet has a section 9.4.2 Chop Mode which show the operation of the chop mode on this ADC, but I will send you another document to explain the mechanism with more details via email. BR, Dale
↧
↧
Forum Post: RE: ADS1298: ads1298 init and configure issues
Finaly got is solved, thanks Ryan, I needed to call the DMA read in the Interrupt Now we have a final code that can everyone use. Signal Analyzer data: e2e.ti.com/.../ads_5F00_communication-and-packages.zip Code for Main void main(){ SPI_ADS_COM_ON_OFF(1); SPI_P_config(&hspi1); SPI_CS_config(E_CS_GPIO_Port, E_CS_Pin); SPI_ADS_pin_config(E_START_GPIO_Port, E_START_Pin, E_RST_GPIO_Port, E_RST_Pin); // Initialise communication function of the ADS ads1298r_ctrl_init_device(); // Stop ADS conversion and configure the ADS accordingly ads1298r_init(); while (1) { if(ads_data_DMA_finished){ cs= ads_data_buffer[0] Instance == SPI){ SPI_ADS_COM_ON_OFF(0); ads_data_DMA_finished = 1; } } Code for setup void ads1298r_ctrl_init_device(void) { // Disable data interrupts for the ADS converter // HAL_NVIC_DisableIRQ(EXTI1_IRQn); SPI_ADS_START_ON_OFF(0); HAL_Delay(1); // HAL_Delay(1); // Initialise ADS using RESET PIN ads1298r_reset_pin(); // Reset sequence is finished } //-- Configure the ADS through SPI void ads1298r_init(void) { // Enabling the ADS modules SPI_ADS_COM_ON_OFF(0); // Stopping the ADS sensor SPI_ADS_START_ON_OFF(0); HAL_Delay(1); // Send dumy data to be able to continue with the configuration ads_read_reg(0x00); // STOP all data transmission for configuration ads1298r_SDATAC(); ads1298r_STOP(); HAL_Delay(1); // Sending out configuration data to the ECG sensors init_ads1298r_EPMCG_experiment_LOFF(); // Initialise Data reception form the ADS // First it need to be started this function includes a command and also a START pin set to LOW // ads1298r_RDATAC_START(); // SPI_ADS_START_ON_OFF(1); // ads1298r_START(); ads1298r_RDATAC(); // use only this to work HAL_Delay(100); // Re Enable the interrupts to have a breathing time for DMA // HAL_NVIC_EnableIRQ(EXTI1_IRQn); } /* * New configuration file for the ECG ADS sensors */ void init_ads1298r_EPMCG_experiment_LOFF(void){ uint8_t buffer[3]; // REG CONFIG 1 //Set Data Rate 4kHz with DEFAULT LOW-POWER mode // REGS - 0b0xxx xxxx - LP mode // REGS - 0bx1xx xxxx - Multiple readback mode // REGS - 0bxx0x xxxx - Oscillator clock output disabled // REGS - 0bxxxx x010 - Set data ready to 4kSPS // REGS Final - 0b0100 0010 ADS_Transmit(ADS129X_REG_CONFIG1, 0x00, 0b01000010); // REG CONFIG 3 // Enable internal reference buffer - 0_1xxxxxxx // SET Internal RLD signals - 0_xxxx1xxx // RLD buffer ENABLE - 0_xxxxx1xx // REG - 0x10001100 ADS_Transmit(ADS129X_REG_CONFIG3, 0x73, ADS129X_PD_REF_ENABLED | ADS129X_RLD_REF_SIG_INTERNAL | ADS129X_RLD_BUFFER_ENABLED); // ADS_Transmit(ADS129X_REG_CONFIG3, 0x7F, ADS129X_PD_REF_ENABLED); // ADS_Transmit(ADS129X_REG_CONFIG3, 0xF7, ADS129X_RLD_REF_SIG_INTERNAL); // ADS_Transmit(ADS129X_REG_CONFIG3, 0xFB, ADS129X_RLD_BUFFER_ENABLED); // ALL GAIN and Electrode MODE set to 0x00 // Setup channels of the ECG ADS // Easier if channels are set up using simple SPI transfer to ADS // Currently it checks the state of the register then writes in the changes ADS_Transmit(ADS129X_REG_CH1SET, 0xF8, ADS129X_MUX_NORMAL); ADS_Transmit(ADS129X_REG_CH2SET, 0xF8, ADS129X_MUX_NORMAL); ADS_Transmit(ADS129X_REG_CH3SET, 0xF8, ADS129X_MUX_NORMAL); ADS_Transmit(ADS129X_REG_CH4SET, 0xF8, ADS129X_MUX_NORMAL); ADS_Transmit(ADS129X_REG_CH5SET, 0xF8, ADS129X_MUX_NORMAL); ADS_Transmit(ADS129X_REG_CH6SET, 0xF8, ADS129X_MUX_NORMAL); ADS_Transmit(ADS129X_REG_CH7SET, 0xF8, ADS129X_MUX_NORMAL); ADS_Transmit(ADS129X_REG_CH8SET, 0xF8, ADS129X_MUX_NORMAL); // Channel gain settings each channel has to be written separately // Gain set to GAIN_6 ADS_Transmit(ADS129X_REG_CH1SET, 0x00, ADS129X_GAIN_6X); ADS_Transmit(ADS129X_REG_CH2SET, 0x00, ADS129X_GAIN_6X); ADS_Transmit(ADS129X_REG_CH3SET, 0x00, ADS129X_GAIN_6X); ADS_Transmit(ADS129X_REG_CH4SET, 0x00, ADS129X_GAIN_6X); ADS_Transmit(ADS129X_REG_CH5SET, 0x00, ADS129X_GAIN_6X); ADS_Transmit(ADS129X_REG_CH6SET, 0x00, ADS129X_GAIN_6X); ADS_Transmit(ADS129X_REG_CH7SET, 0x00, ADS129X_GAIN_6X); ADS_Transmit(ADS129X_REG_CH8SET, 0x00, ADS129X_GAIN_6X); // Setup reference voltage to REF_2_4_V // Config REG - 0_xx0xxxxx ADS_Transmit(ADS129X_REG_CONFIG3, 0xDF, ADS129X_REF_VOLTAGE_2_4V); // RLD_SENSP // ch2 and ch3 set - 0x00000110 // Note channels are counted from the right side - 0x87654321 ADS_WREG(ADS129X_REG_RLD_SENSP, 0b00000110); // RLD_SENSN // ch2 set - 0x00000010 - NOT USED // 0x00000000 - Currently Used // Note channels are counted from the right side - 0x87654321 ADS_WREG(ADS129X_REG_RLD_SENSN, 0b00000000); // WCT1 // bit3 PD_WCTS = 1 poweron // WCTA 011, channel2 negative //WCT settings ADS_Transmit(ADS129X_REG_CONFIG3, 0xFB, ADS129X_WCTA_STAT_POWERED_DOWN); ADS_Transmit(ADS129X_REG_WCT1, 0xF8, ADS129X_WCTAC_AMP_CH2_N); // WCT2 // PD_WCTC = 1 powered on // PD_WCTB = 1 powered on // WCTB 010 // WCTC 100 //WCT connection settings ADS_Transmit(ADS129X_REG_WCT2, 0xBF, ADS129X_WCTB_STAT_POWERED_ON); ADS_Transmit(ADS129X_REG_WCT2, 0xC7, ADS129X_WCTB_AMP_CH2_P); ADS_Transmit(ADS129X_REG_WCT2, 0x7F, ADS129X_WCTC_STAT_POWERED_ON); ADS_Transmit(ADS129X_REG_WCT2, 0xF8, ADS129X_WCTAC_AMP_CH3_P); } void ads1298r_RDATAC(void) { // START continuous read on the ADS converter // Setup command for START sequence SPI_ADS_START_ON_OFF(0); HAL_Delay(1); // 0x10 - Data to be sent to START the continuouse conversion ads_write_command(ADS129X_CMD_RDATAC); HAL_Delay(1); // pull up the START pin SPI_ADS_START_ON_OFF(1); HAL_Delay(1); } void ads1298r_SDATAC(void) { // STOP continuous read on the ADS converter // Setup command for STOP sequence SPI_ADS_START_ON_OFF(1); HAL_Delay(1); // 0x11 - Data to be sent to STOP the continuouse conversion ads_write_command(ADS129X_CMD_SDATAC); HAL_Delay(1); // Pull up the START pin SPI_ADS_START_ON_OFF(0); HAL_Delay(1); } void ads1298r_RDATAC_START(void) { // START continuous read on the ADS converter // Setup command for START sequence SPI_ADS_START_ON_OFF(0); HAL_Delay(1); // 0x10 - Data to be sent to START the continuouse conversion ads_write_command(ADS129X_CMD_RDATAC); HAL_Delay(1); // 0x08 - Data to be sent to START the continuouse conversion ads_write_command(ADS129X_CMD_START); HAL_Delay(1); // pull up the START pin SPI_ADS_START_ON_OFF(1); HAL_Delay(1); } void ads1298r_START(void) { // START continuous read on the ADS converter // Setup command for START sequence SPI_ADS_START_ON_OFF(0); HAL_Delay(1); // 0x00 - Data to be sent to START the conversion ads_write_command(ADS129X_CMD_START); HAL_Delay(1); // pull up the START pin SPI_ADS_START_ON_OFF(1); HAL_Delay(1); } void ads1298r_STOP(void) { // STOP continuous read on the ADS converter // Setup command for STOP sequence SPI_ADS_START_ON_OFF(0); HAL_Delay(1); SPI_ADS_START_ON_OFF(1); HAL_Delay(1); // 0x00 - Data to be sent to STOP the conversion ads_write_command(ADS129X_CMD_STOP); HAL_Delay(1); // pull up the START pin SPI_ADS_START_ON_OFF(0); HAL_Delay(1); } void ads1298r_reset_pin(void) { SPI_ADS_RST_OFF_ON(1); HAL_Delay(200); // Perform a ADS reset sequence Pull RESET pin LOW SPI_ADS_RST_OFF_ON(0); HAL_Delay(10); SPI_ADS_RST_OFF_ON(1); HAL_Delay(100); } void ads1298r_reset_command(void) { // Setup command for RESET sequence // 0x06 - Data to be sent to RESET the continuouse conversion ads_write_command(ADS129X_CMD_RESET); // ADS_WREG(_address, 0x00); HAL_Delay(10); } Other support code: SPI_HandleTypeDef ads_spiHandle; GPIO_TypeDef* _csPort; uint16_t _csPin; GPIO_TypeDef* _startPort; uint16_t _startPin; GPIO_TypeDef* _rstPort; uint16_t _rstPin; void SPI_config(SPI_HandleTypeDef *spi_cls, GPIO_TypeDef* cs_port, uint16_t cs_pin) { ads_spiHandle = *spi_cls; _csPort = cs_port; _csPin = cs_pin; } void SPI_P_config(SPI_HandleTypeDef *spi_cls) { ads_spiHandle = *spi_cls; } void SPI_CS_config(GPIO_TypeDef* cs_port, uint16_t cs_pin) { _csPort = cs_port; _csPin = cs_pin; } void SPI_ADS_pin_config(GPIO_TypeDef* start_port, uint16_t start_pin, GPIO_TypeDef* rst_port, uint16_t rst_pin) { _startPort = start_port; _startPin = start_pin; _rstPort = rst_port; _rstPin = rst_pin; } void SPI_ADS_COM_ON_OFF(uint8_t state) { if(state){ HAL_GPIO_WritePin(_csPort, _csPin, GPIO_PIN_RESET); } else{ HAL_GPIO_WritePin(_csPort, _csPin, GPIO_PIN_SET); } } void SPI_ADS_START_ON_OFF(uint8_t state) { if(state){ HAL_GPIO_WritePin(_startPort, _startPin, GPIO_PIN_SET); } else{ HAL_GPIO_WritePin(_startPort, _startPin, GPIO_PIN_RESET); } } void SPI_ADS_RST_OFF_ON(uint8_t state) { if(state){ HAL_GPIO_WritePin(_rstPort, _rstPin, GPIO_PIN_SET); } else{ HAL_GPIO_WritePin(_rstPort, _rstPin, GPIO_PIN_RESET); } } uint8_t ads_read_reg(uint8_t reg_address) { uint8_t txData[3]; uint8_t rxData[3]; txData[0] = ADS129X_CMD_RREG | reg_address; txData[1] = 0x00; txData[2] = 0x00; SPI_ADS_COM_ON_OFF(1); HAL_SPI_TransmitReceive(&ads_spiHandle, &txData, &rxData, 3, 1); while(HAL_SPI_GetState(&ads_spiHandle)!= HAL_SPI_STATE_READY){} SPI_ADS_COM_ON_OFF(0); return rxData[2]; } uint8_t ads_write_reg(uint8_t reg_address, uint8_t data) { uint8_t txData[3]; uint8_t rxData[3]; txData[0] = ADS129X_CMD_WREG | reg_address; txData[1] = 0x00; txData[2] = data; SPI_ADS_COM_ON_OFF(1); HAL_SPI_Transmit(&ads_spiHandle, &txData, 3, 0); while(HAL_SPI_GetState(&ads_spiHandle)!= HAL_SPI_STATE_READY){} SPI_ADS_COM_ON_OFF(0); return rxData[2]; } uint8_t ads_write_command(uint8_t reg_address) { uint8_t txData[3]; uint8_t status; txData[0] = reg_address; SPI_ADS_COM_ON_OFF(1); status = HAL_SPI_Transmit(&ads_spiHandle, &txData, 1, 0); while(HAL_SPI_GetState(&ads_spiHandle)!= HAL_SPI_STATE_READY){} SPI_ADS_COM_ON_OFF(0); return status; } uint8_t ads1298r_transfer(uint8_t address, uint8_t* buffer, uint8_t length) { uint8_t transferOK; uint8_t errorCode = 0x00; uint8_t add[1] = {address}; uint8_t len = length; uint8_t *buf = buffer; uint8_t tempRxBuffer[1]; uint8_t count_len; count_len = 1; transferOK = HAL_SPI_TransmitReceive(&ads_spiHandle, &add, &tempRxBuffer[0], count_len, 1); while(HAL_SPI_GetState(&ads_spiHandle)!= HAL_SPI_STATE_READY){} // Check if the SPI communication is good if(transferOK != HAL_SPI_STATE_READY) { errorCode = 0x01; } if (length > 0) { // Send length to ADS1298r len = length - 1; transferOK = HAL_SPI_TransmitReceive(&ads_spiHandle, &len, &tempRxBuffer[0], count_len, 1); while(HAL_SPI_GetState(&ads_spiHandle)!= HAL_SPI_STATE_READY){} // Check if the SPI communication is good if(transferOK != HAL_SPI_STATE_READY) { errorCode = 0x01 << 1; } count_len = length; // Send data to ADS1298r transferOK = HAL_SPI_TransmitReceive(&ads_spiHandle, &buf, &buffer, count_len, 1); while(HAL_SPI_GetState(&ads_spiHandle)!= HAL_SPI_STATE_READY){} // Check if the SPI communication is good if(transferOK != HAL_SPI_STATE_READY) { errorCode = 0x01 << 2; } } return errorCode; } uint8_t ads1298r_read_data(uint8_t *buffer) { uint8_t status; uint8_t txData[27]; memset(&txData[0], 0xFF, sizeof(txData)); SPI_ADS_COM_ON_OFF(1); // status = HAL_SPI_Receive(&ads_spiHandle, (uint8_t *)buffer, 27, 4); status = HAL_SPI_TransmitReceive(&ads_spiHandle, &txData, buffer, 27, 1); SPI_ADS_COM_ON_OFF(0); if (status == HAL_OK){ // SPI_ADS_COM_ON_OFF(0); return 1; } else{ // SPI_ADS_COM_ON_OFF(0); return 0; } return status; } uint8_t ads1298r_read_DMA(uint8_t *buffer) { uint8_t status; uint8_t txData[27]; memset(&txData, 0xFF, sizeof(txData)); HAL_SPI_DMAStop(&ads_spiHandle); SPI_ADS_COM_ON_OFF(1); status = HAL_SPI_TransmitReceive_DMA(&ads_spiHandle, &txData, buffer, 27); // status = HAL_SPI_Receive_DMA(&ads_spiHandle, buffer, 27); // status = HAL_SPI_Receive(&ads_spiHandle, (uint8_t *)buffer, 27, 5); // SPI_ADS_COM_ON_OFF(0); if (status == HAL_OK){ return 1; } else{ HAL_SPI_DMAStop(&ads_spiHandle); SPI_ADS_COM_ON_OFF(0); return 0; } return status; } uint8_t SPI_device_transfer(uint8_t data) { uint8_t txData[2], rxData[2]; txData[0] = data; txData[1] = 0xFF; HAL_SPI_TransmitReceive(&ads_spiHandle, &txData, &rxData, sizeof(rxData), HAL_MAX_DELAY); while (HAL_SPI_GetState(&ads_spiHandle) != HAL_SPI_STATE_READY); return rxData[1]; } void SPI_device_read(uint8_t address, uint8_t *buffer, uint8_t size) { SPI_ADS_COM_ON_OFF(1); address |= 0x80; SPI_device_transfer(address); for (uint8_t i = 0; i < size; i++) { buffer[i] = SPI_device_transfer(0xFF); } SPI_ADS_COM_ON_OFF(0); } void SPI_device_write(uint8_t address, uint8_t *buffer, uint8_t size) { SPI_ADS_COM_ON_OFF(1); SPI_device_transfer(address); for (uint8_t i = 0; i < size; i++) { SPI_device_transfer(buffer[i]); } SPI_ADS_COM_ON_OFF(0); } HAL_StatusTypeDef SPI_ReadRegister(uint8_t addr, uint8_t *byte) { HAL_StatusTypeDef hal_status; uint8_t txData[2]; uint8_t rxData[2]; txData[0] = addr | 0x80; // read operation txData[1] = 0x00; // dummy byte for response SPI_ADS_COM_ON_OFF(1); hal_status = HAL_SPI_TransmitReceive(&ads_spiHandle, &txData, &rxData, sizeof(txData), HAL_MAX_DELAY); SPI_ADS_COM_ON_OFF(0); if (hal_status == HAL_OK) { *byte = rxData[1]; // response is in the second byte } return hal_status; } void SPI_deviceRead(uint8_t address, uint8_t *buffer, uint8_t size) { uint8_t _address = address | 0x80; SPI_ADS_COM_ON_OFF(1); // HAL_SPI_TransmitReceive(&ads_spiHandle, &_address, buffer, size, HAL_MAX_DELAY); HAL_SPI_Transmit(&ads_spiHandle, &_address, 1, HAL_MAX_DELAY); //HAL_MAX_DELAY HAL_SPI_Receive(&ads_spiHandle, buffer, size, HAL_MAX_DELAY); while(HAL_SPI_GetState(&ads_spiHandle) != HAL_SPI_STATE_READY); SPI_ADS_COM_ON_OFF(0); } void SPI_write_reg8(uint8_t address, uint8_t reg_data) { uint8_t txData[2], rxData[2]; txData[0] = address; txData[1] = reg_data; SPI_ADS_COM_ON_OFF(1); HAL_SPI_TransmitReceive(&ads_spiHandle, &txData, &rxData, sizeof(txData), HAL_MAX_DELAY); while(HAL_SPI_GetState(&ads_spiHandle) != HAL_SPI_STATE_READY); SPI_ADS_COM_ON_OFF(0); } uint8_t SPI_read_reg8(uint8_t address) { uint8_t txData[2], rxData[2]; txData[0] = address | 0x80; txData[1] = 0xFF; SPI_ADS_COM_ON_OFF(1); HAL_SPI_TransmitReceive(&ads_spiHandle, &txData, &rxData, sizeof(txData), HAL_MAX_DELAY); while(HAL_SPI_GetState(&ads_spiHandle) != HAL_SPI_STATE_READY); SPI_ADS_COM_ON_OFF(0); return rxData[1]; } // ******************************************** // // SIMPLE ADS Read Write commands // // ******************************************** uint8_t transferSPI(uint8_t data){ uint8_t rx = 0x00; HAL_SPI_TransmitReceive(&ads_spiHandle, &data, &rx, sizeof(rx),0x1000); return rx; } void ADS_Transmit(uint8_t address, uint8_t mask, uint8_t command) { uint8_t reg_data = ADS_RREG(address); reg_data &= mask; reg_data |= command; ADS_WREG(address, reg_data); } uint8_t ADS_RREG(uint8_t _address){ // reads ONE register at _address uint8_t reg_address = _address + ADS129X_CMD_RREG; // RREG expects 001rrrrr where rrrrr = _address uint8_t reg_data; SPI_ADS_COM_ON_OFF(1); // DELAY_US(1); transferSPI( reg_address); // opcode1 // DELAY_US(1); transferSPI( 0); // opcode2 // DELAY_US(1); reg_data = transferSPI( 0); // update mirror location with returned byte // DELAY_US(1); SPI_ADS_COM_ON_OFF(0); return reg_data; // return requested register value } void ADS_WREG(uint8_t _address, uint8_t _value) { // Write ONE register at _address uint8_t reg_address = _address + ADS129X_CMD_WREG; // WREG expects 010rrrrr where rrrrr = _address SPI_ADS_COM_ON_OFF(1); // DELAY_US(1); transferSPI( reg_address); // Send WREG command & address // DELAY_US(1); transferSPI( 0x00); // Send number of registers to read -1 // DELAY_US(1); transferSPI( _value); // Write the value to the register // DELAY_US(1); SPI_ADS_COM_ON_OFF(0); } uint8_t ads1298_ReadRegister(uint8_t regAddress) { uint8_t txBuffer[3]; uint8_t rxBuffer[3]; uint8_t regValue; // Construct the command byte (READ_REG_CMD + register address) txBuffer[0] = ADS129X_CMD_RREG | regAddress; txBuffer[1] = 0x00; // Dummy byte to read the register value txBuffer[2] = 0x00; // Dummy byte to read the register value // Pull CS low to start communication SPI_ADS_COM_ON_OFF(1); // Transmit the command byte and receive the register value if (HAL_SPI_TransmitReceive(&ads_spiHandle, txBuffer, rxBuffer, 3, HAL_MAX_DELAY) != HAL_OK) { // Handle error SPI_ADS_COM_ON_OFF(0); // Pull CS high return 0; // Return 0 in case of error } // Pull CS high to end communication SPI_ADS_COM_ON_OFF(0); // The received register value is in rxBuffer[1] regValue = rxBuffer[1]; return regValue; } REGS H file #define ADS1X_ECG_CHANNEL_VALUE ADS1X_MUX_NORMAL_ELECTRODE //#define ADS1X_ECG_CHANNEL_VALUE ADS1X_MUX_TEST_SIGNAL //#define ADS1X_ECG_CHANNEL_VALUE ADS1X_MUX_INPUT_SHORTED #define ADS1X_PMCG_CHANNEL_VALUE ADS1X_MUX_NORMAL_ELECTRODE //#define ADS1X_PMCG_CHANNEL_VALUE ADS1X_MUX_TEST_SIGNAL //#define ADS1X_PMCG_CHANNEL_VALUE ADS1X_MUX_INPUT_SHORTED // SPI Command Definition Byte Assignments (Datasheet, pg. 35) #define ADS129X_CMD_WAKEUP 0x02 // Wake-up from standby mode #define ADS129X_CMD_STANDBY 0x04 // Enter Standby mode #define ADS129X_CMD_RESET 0x06 // Reset the device #define ADS129X_CMD_START 0x08 // Start and restart (synchronize) conversions #define ADS129X_CMD_STOP 0x0A // Stop conversion #define ADS129X_CMD_RDATAC 0x10 // Enable Read Data Continuous mode (default mode at power-up) #define ADS129X_CMD_SDATAC 0x11 // Stop Read Data Continuous mode #define ADS129X_CMD_RDATA 0x12 // Read data by command; supports multiple read back #define ADS129X_CMD_RREG 0x20 // (also = 00100000) is the first opcode that the address must be added to for RREG communication #define ADS129X_CMD_WREG 0x40 // 01000000 in binary (Datasheet, pg. 35) // Register Addresses #define ADS129X_REG_ID 0x00 // ID Control Register #define ADS129X_REG_CONFIG1 0x01 // Configuration Register 1 #define ADS129X_REG_CONFIG2 0x02 // Configuration Register 2 #define ADS129X_REG_CONFIG3 0x03 // Configuration Register 3 #define ADS129X_REG_LOFF 0x04 // Lead-Off Control Register #define ADS129X_REG_CH1SET 0x05 // Individual Channel Settings 1-8 #define ADS129X_REG_CH2SET 0x06 // --- #define ADS129X_REG_CH3SET 0x07 // --- #define ADS129X_REG_CH4SET 0x08 // --- #define ADS129X_REG_CH5SET 0x09 // --- #define ADS129X_REG_CH6SET 0x0A // --- #define ADS129X_REG_CH7SET 0x0B // --- #define ADS129X_REG_CH8SET 0x0C // --- #define ADS129X_REG_RLD_SENSP 0x0D // Right Leg Drive, positive side #define ADS129X_REG_RLD_SENSN 0x0E // Right Leg Drive, negative side #define ADS129X_REG_LOFF_SENSP 0x0F // Lead-Off Detection, positive side #define ADS129X_REG_LOFF_SENSN 0x10 // Lead-Off Detection, negative side #define ADS129X_REG_LOFF_FLIP 0x11 // Lead-Off Detection, current direction #define ADS129X_REG_LOFF_STATP 0x12 // Electrode Status, positive (read-only) #define ADS129X_REG_LOFF_STATN 0x13 // Electrode Status, negative (read-only) #define ADS129X_REG_GPIO 0x14 // General-Purpose I/O Register #define ADS129X_REG_PACE 0x15 // PACE Detect Register #define ADS129X_REG_RESP 0x16 // Respiration Control Register #define ADS129X_REG_CONFIG4 0x17 // Configuration Register 4 #define ADS129X_REG_WCT1 0x18 // Wilson Central Terminal and Augmented Lead Control Register #define ADS129X_REG_WCT2 0x19 // Wilson Central Terminal Control Register // IDs #define ADS129X_ID_ADS1294 0x90 #define ADS129X_ID_ADS1296 0x91 #define ADS129X_ID_ADS1298 0x92 #define ADS129X_ID_ADS1294R 0xD0 #define ADS129X_ID_ADS1296R 0xD1 #define ADS129X_ID_ADS1298R 0xD2 // Configuration Register 1 #define ADS129X_BIT_HR 0x7 #define ADS129X_BIT_DAISY_EN 0x6 #define ADS129X_BIT_CLK_EN 0x5 // always 0 // always 0 #define ADS129X_BIT_DR2 0x2 #define ADS129X_BIT_DR1 0x1 #define ADS129X_BIT_DR0 0x0 // Configuration Register 2 // always 0 // always 0 #define ADS129X_BIT_WCT_CHOP 0x5 #define ADS129X_BIT_INT_TEST 0x4 // always 0 #define ADS129X_BIT_TEST_AMP 0x2 #define ADS129X_BIT_TEST_FREQ1 0x1 #define ADS129X_BIT_TEST_FREQ0 0x0 #define ADS129X_TEST_FREQ_1HZ 0x0 #define ADS129X_TEST_FREQ_2HZ 0x1 #define ADS129X_TEST_FREQ_DC 0x3 // Configuration Register 3 #define ADS129X_BIT_PD_REFBUF 0x7 // always 1 #define ADS129X_BIT_VREF_4V 0x5 #define ADS129X_BIT_RLD_MEAS 0x4 #define ADS129X_BIT_RLDREF_INT 0x3 #define ADS129X_BIT_PD_RLD 0x2 #define ADS129X_BIT_RLD_LOFF_SENS 0x1 #define ADS129X_BIT_RLD_STAT 0x0 // CONFIG 3 REG Settings #define ADS129X_REF_VOLTAGE_2_4V 0x00 // VREFP is set to 2.4V (default) #define ADS129X_REF_VOLTAGE_4_0V 0x20 // VREFP is set to 4V (use only with a 5V analog supply) #define ADS129X_PD_REF_POWER_DOWN 0x00 // power-down internal reference buffer (default) #define ADS129X_PD_REF_ENABLED 0x80 // enable internal reference buffer #define ADS129X_RLD_REF_SIG_EXTERNAL 0x00 // RLDREF signal fed externally (default) #define ADS129X_RLD_REF_SIG_INTERNAL 0x08 // RLDREF signal (AVDD – AVSS)/2 generated internally #define ADS129X_RLD_BUFFER_POWERED_DOWN 0x00 // RLD buffer is powered down (default) #define ADS129X_RLD_BUFFER_ENABLED 0x04 // RLD buffer is enabled // Lead-Off Control Register #define ADS129X_BIT_COMP_TH2 0x7 #define ADS129X_BIT_COMP_TH1 0x6 #define ADS129X_BIT_COMP_TH0 0x5 #define ADS129X_BIT_VLEAD_OFF_EN 0x4 #define ADS129X_BIT_ILEAD_OFF1 0x3 #define ADS129X_BIT_ILEAD_OFF0 0x2 #define ADS129X_BIT_FLEAD_OFF1 0x1 #define ADS129X_BIT_FLEAD_OFF0 0x0 // Individual Channel Settings #define ADS129X_BIT_PD 0x7 #define ADS129X_BIT_GAIN2 0x6 #define ADS129X_BIT_GAIN1 0x5 #define ADS129X_BIT_GAIN0 0x4 // always 0 #define ADS129X_BIT_MUX2 0x2 #define ADS129X_BIT_MUX1 0x1 #define ADS129X_BIT_MUX0 0x0 // Channel Select #define ADS129X_BIT_CH8 0x7 #define ADS129X_BIT_CH7 0x6 #define ADS129X_BIT_CH6 0x5 #define ADS129X_BIT_CH5 0x4 #define ADS129X_BIT_CH4 0x3 #define ADS129X_BIT_CH3 0x2 #define ADS129X_BIT_CH2 0x1 #define ADS129X_BIT_CH1 0x0 // General-Purpose I/O Register #define ADS129X_BIT_GPIOD4 0x7 #define ADS129X_BIT_GPIOD3 0x6 #define ADS129X_BIT_GPIOD2 0x5 #define ADS129X_BIT_GPIOD1 0x4 #define ADS129X_BIT_GPIOC4 0x3 #define ADS129X_BIT_GPIOC3 0x2 #define ADS129X_BIT_GPIOC2 0x1 #define ADS129X_BIT_GPIOC1 0x0 // PACE Detect Register // always 0 // always 0 // always 0 #define ADS129X_BIT_PACEE1 0x4 #define ADS129X_BIT_PACEE0 0x3 #define ADS129X_BIT_PACEO1 0x2 #define ADS129X_BIT_PACEO0 0x1 #define ADS129X_BIT_PD_PACE 0x0 // Respiration Control Register #define ADS129X_BIT_RESP_DEMOD_EN1 0x7 #define ADS129X_BIT_RESP_MOD_EN1 0x6 // always 1 #define ADS129X_BIT_RESP_PH2 0x4 #define ADS129X_BIT_RESP_PH1 0x3 #define ADS129X_BIT_RESP_PH0 0x2 #define ADS129X_BIT_RESP_CTRL1 0x1 #define ADS129X_BIT_RESP_CTRL0 0x0 // Configuration Register 4 #define ADS129X_BIT_RESP_FREQ2 0x7 #define ADS129X_BIT_RESP_FREQ1 0x6 #define ADS129X_BIT_RESP_FREQ0 0x5 // always 0 #define ADS129X_BIT_SINGLE_SHOT 0x3 #define ADS129X_BIT_WCT_TO_RLD 0x2 #define ADS129X_BIT_PD_LOFF_COMP 0x1 // always 0 // Wilson Central Terminal and Augmented Lead Control Register #define ADS129X_BIT_aVF_CH6 0x7 #define ADS129X_BIT_aVF_CH5 0x6 #define ADS129X_BIT_aVF_CH7 0x5 #define ADS129X_BIT_aVF_CH4 0x4 #define ADS129X_BIT_PD_WCTA 0x3 #define ADS129X_BIT_WCTA2 0x2 #define ADS129X_BIT_WCTA1 0x1 #define ADS129X_BIT_WCTA0 0x0 // Wilson Central Terminal Control Register #define ADS129X_BIT_PD_WCTC 0x7 #define ADS129X_BIT_PD_WCTB 0x6 #define ADS129X_BIT_WCTB2 0x5 #define ADS129X_BIT_WCTB1 0x4 #define ADS129X_BIT_WCTB0 0x3 #define ADS129X_BIT_WCTC2 0x2 #define ADS129X_BIT_WCTC1 0x1 #define ADS129X_BIT_WCTC0 0x0 // WCT settings #define ADS129X_WCT_TO_RLD_OFF 0x00 // WCT to RLD connection off (default) #define ADS129X_WCT_TO_RLD_ON 0x04 // WCT to RLD connection on // WCT amplifier A and C channel selection; typically connected to RA and LL electrode #define ADS129X_WCTAC_AMP_CH1_P 0x00 // channel 1 positive input connected to WCTA or WCTC amplifier (default) #define ADS129X_WCTAC_AMP_CH1_N 0x01 // channel 1 negative input connected to WCTA or WCTC amplifier #define ADS129X_WCTAC_AMP_CH2_P 0x02 // channel 2 positive input connected to WCTA or WCTC amplifier #define ADS129X_WCTAC_AMP_CH2_N 0x03 // Channel 2 negative input connected to WCTA or WCTC amplifier #define ADS129X_WCTAC_AMP_CH3_P 0x04 // channel 3 positive input connected to WCTA or WCTC amplifier #define ADS129X_WCTAC_AMP_CH3_N 0x05 // Channel 3 negative input connected to WCTA or WCTC amplifier #define ADS129X_WCTAC_AMP_CH4_P 0x06 // channel 4 positive input connected to WCTA or WCTC amplifier #define ADS129X_WCTAC_AMP_CH5_N 0x07 // Channel 4 negative input connected to WCTA or WCTC amplifier // WCT amplifier B channel selection; typically connected to LA electrode #define ADS129X_WCTB_AMP_CH1_P 0x00 // channel 1 positive input connected to WCTB amplifier (default) #define ADS129X_WCTB_AMP_CH1_N 0x08 // channel 1 negative input connected to WCTB amplifier #define ADS129X_WCTB_AMP_CH2_P 0x10 // channel 2 positive input connected to WCTB amplifier #define ADS129X_WCTB_AMP_CH2_N 0x18 // Channel 2 negative input connected to WCTB amplifier #define ADS129X_WCTB_AMP_CH3_P 0x20 // channel 3 positive input connected to WCTB amplifier #define ADS129X_WCTB_AMP_CH3_N 0x28 // Channel 3 negative input connected to WCTB amplifier #define ADS129X_WCTB_AMP_CH4_P 0x30 // channel 4 positive input connected to WCTB amplifier #define ADS129X_WCTB_AMP_CH5_N 0x38 // Channel 4 negative input connected to WCTB amplifier // power-down WCTA #define ADS129X_WCTA_STAT_POWERED_DOWN 0x00 // powered down (default) #define ADS129X_WCTA_STAT_POWERED_ON 0x08 // powered on // power-down WCTB #define ADS129X_WCTB_STAT_POWERED_DOWN 0x00 // powered down (default) #define ADS129X_WCTB_STAT_POWERED_ON 0x40 // powered on // power-down WCTC #define ADS129X_WCTC_STAT_POWERED_DOWN 0x00 // powered down (default) #define ADS129X_WCTC_STAT_POWERED_ON 0x80 // powered on // Gain Configuration #define ADS129X_GAIN_6X 0x0 #define ADS129X_GAIN_1X 0x1 #define ADS129X_GAIN_2X 0x2 #define ADS129X_GAIN_3X 0x3 #define ADS129X_GAIN_4X 0x4 #define ADS129X_GAIN_8X 0x5 #define ADS129X_GAIN_12X 0x6 // Mux Configuration #define ADS129X_MUX_NORMAL 0x0 // Normal electrode input (default) #define ADS129X_MUX_SHORT 0x1 // Input shorted (for offset or noise measurements) #define ADS129X_MUX_RLD_MEAS 0x2 // Used in conjunction with RLD_MEAS bit for RLD measurements #define ADS1X_MUX_BIAS_MEAS 0x2// used in conjunction with BIAD_MEAS bit for BIAS measurements #define ADS129X_MUX_MVDD 0x3 // MVDD for supply measurement #define ADS129X_MUX_TEMP 0x4 // Temperature sensor #define ADS129X_MUX_TEST 0x5 // Test signal #define ADS129X_MUX_RLD_DRP 0x6 // RLD_DRP (positive electrode is the driver) #define ADS1X_MUX_BIAS_DRP 0x6// BIAS_DRP (positive electrode is the driver) #define ADS1X_MUX_RLD_DRN 0x7// RLD_DRN (negative electrode is the driver) #define ADS1X_MUX_BIAS_DRN 0x7// BIAS_DRN (negative electrode is the driver) // Sample-rate Configuration #define ADS129X_SAMPLERATE_0_250k_1024 0x6 #define ADS129X_SAMPLERATE_0_500k_512 0x5 #define ADS129X_SAMPLERATE_1k_256 0x4 #define ADS129X_SAMPLERATE_2k_128 0x3 #define ADS129X_SAMPLERATE_4k_64 0x2 #define ADS129X_SAMPLERATE_8k_32 0x1 #define ADS129X_SAMPLERATE_16k_16 0x0 /* typedef enum ADS1x_DataRate { // ADS1298_LR_MODE / ADS1298_HR_MODE / ADS131E06 ADS1x_DR6 = 0x06, // 0.250 kHz / 0.500 kHz / 1 kHz ADS1x_DR5 = 0x05, // 0.500 kHz / 1 kHz / 2 kHz ADS1x_DR4 = 0x04, // 1 kHz / 2 kHz / 4 kHz ADS1x_DR3 = 0x03, // 2 kHz / 4 kHz / 8 kHz ADS1x_DR2 = 0x02, // 4 kHz / 8 kHz / 16 kHz ADS1x_DR1 = 0x01, // 8 kHz / 16 kHz / 32 kHz ADS1x_DR0 = 0x00, // 16 kHz / 32 kHz / 64 kHz } ads1x_data_rate_t; */
↧
Forum Post: RE: TLA2024: The datasheet for TLA8062
Hi Alex, hi Roland, could you please get back to Zhang on the TLA8062 question above. Regards, Joachim Wuerker
↧
Forum Post: RE: DAC38RF85: Search for a 100 MHz clock generator with 10 MHz reference
Alain, We may be able to support this phase noise requirement with the CDCE6214. I can check the result on a PNA and let you know by Monday. Thanks, Kadeem
↧
↧
Forum Post: RE: Datasheet for TLA8062
Hi Zhang, Please see attached. e2e.ti.com/.../TLA8062.pdf
↧
Forum Post: RE: Datasheet for TLA8062
Hi Zhang, Please see attached. e2e.ti.com/.../5100.TLA8062.pdf
↧
Forum Post: RE: TSC2007: Touch Screen Drivers Interface Y+/Y- cannot work
Let me try to understand the setup. The Touch panel is removed but the digital output of the TSC is used to put the blue pointer at x,y coordinate. Is that correct ? Is this waveform when you drive the X+ pin with a 470 ohm resistor? When you increase the level of the DC Voltage Does the bottom level of the waveform go up. At the DC supply set at 0v does this level go below 0.5V? Also at position of X+=0 V connect the input side of 470 ohm to ground and let me know if the situation changes ----------------------- Also as an additional test make x+=1.65v and move the Y+ with the DC Supply. Does this go all the way from top to bottom?
↧
Forum Post: RE: ADS112C04: Please help to check the setting for PT100 3-wire RTD
Hi Wayne, These settings should be okay, depending on your circuit. Do you have a schematic you can share? Please reference our application note for additional information on 3-wire RTD configurations: A Basic Guide to RTD Measurements (Rev. A) (ti.com) The following circuit examples show how to interface different 3-wire RTD configurations with our ADC's and are a good reference point for your design. For a 3-wire RTD configuration using a single IDAC, you can follow the example from Figure 2-4. Make sure to select an Rbias resistance that will not violate the IDAC compliance voltage for your selected excitation current value. Best Regards, Angel
↧
↧
Forum Post: RE: AMC131M03EVM: Problem Activating "HLDO_OUT" with the Evaluation Module
Hi Wilson, Have you checked the low side voltage to verify it is at 3.3V once the DCDC is enabled? What MCU are you using? The Device when operating can consume >20mA on the primary side power supply. Thanks.
↧
Forum Post: RE: ADS1100: I bought 5 ADS1100A1IDBVR on the official website at that time, but during testing, two were found to be abnormal and three were normal. Could you please ask the engineer to help take a look and solve it!
Hi, Could you provide more details on what the abnormal vs normal behavior is for the devices? When the terminals 1 and 2 of J9 are suspended (unloaded), or shorted, what is the reading output you expect to see? If there is no signal present, how is this reading of interest when not connected to the 4-20mA loop? Does this affect other measurements? Also have you considered using the ADS1114 instead of ADS1100? This is a newer version of the device with the same functionality and better performance specs: ADS1114 data sheet, product information and support | TI.com Best Regards, Angel
↧
Forum Post: RE: ADS7128:ADS7128
Hi Takahiko, This seems to be the correct operation, as the I2C lines shared between the host and device are pulled up high with resistors since these pins are in the open-drain configuration. To the controller, this would look like a data stream of all F's. If you have any more concerns, it would be helpful to send an oscilloscope capture of the SDA line as soon as power is turned off to the device. Regards, Joel
↧
Forum Post: RE: TSC2046E: TSC2046EIPW on STM32MP151AAC doesn't work
Hi Kim, I am working on getting access to a screen and an EVM to test your setup on a Linux device. In the meantime, have you tried running evtest in a TTY (virtual) terminal? I read that evtest may need to be run on a different process to be able to see active events, if the device has already been grabbed by a process. I will test this when I can, hopefully next week. Let me know if this fixes your problem and you are able to make progress. Best, Mir Jeffres Audio Converters Applications Engineer
↧
↧
Forum Post: RE: ADS7128: When reading a Continuous Block of Registers in ADS7182 IC, there is no explanation including CRC.
Hi Yong, Sure. Below is what it would look like. If you don't have access to hardware yet and would like to test your software, there is an ADS7128 booster pack EVM available for purchase. See the link below. This board is intended for use with the MSP-EXP432E401Y that can be purchased separately, but you can connect your own power supply and I2C controller as well! https://www.ti.com/tool/BP-ADS7128 Regards, Joel
↧
Forum Post: RE: DAC8501: Behavior when 23-bit data is input to the DAC8501E
Hi Shirai-san, Thanks for sharing these additional details. Can you measure the output of the DAC output directly during the unintended output shift? What is the value of VREF in your schematic? In the first waveform, it looks like the op amp output returns to 0V. Did you send another DAC code during this time? Or the output changed on its own? Between waveforms 1 and 2, the scale of channel 4 is set to 5V/div, but the output of waveform 1 looks much higher than waveform 2. Is each set of CS low to CS high incrementing the output and then at the end, decrementing the output? How long is the high time between each of your SCLK pulses? About 75us? Best, Katlynne Jones
↧
Forum Post: RE: TSC2046E: TSC2046EIPW on STM32MP151AAC doesn't work
Hi Jeffres, Thanks for the feedback. I runt evtest on terminal. Please refer to below log. root@myir-ya151c-t:~# evtest No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: pmic_onkey /dev/input/event1: joystick /dev/input/event2: ADS7846 Touchscreen Select the device event number [0-2]: 2 Input driver version is 1.0.1 Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0 Input device name: "ADS7846 Touchscreen" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 4095 Event code 1 (ABS_Y) Value 0 Min 0 Max 4095 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Properties: Testing ... (interrupt to exit) Although I press touch screen, nothing happens.
↧
Forum Post: ADS1219: How to calibrate ADS1219?
Part Number: ADS1219 Other Parts Discussed in Thread: OPA4277 Tool/software: I'm using an ADS1219 on a project. I've chosen to use the internal 2.048 voltage reference, and I'm feeding it a voltage between -0.25 and 2.0 volts (the -0.25 value is created because I have a Germanium diode protecting the input from lower than -0.3V). When I feed the device approx 0V (typically around 0.005V) I get -229 (upper 16 bits, shifted down 8 bits) from the ADS1219. When I feed it 2.000V, I get around 29150. I'm really expecting 32000 for the 2V input. According to the spec sheet, there is a calibration option that connects the AinP and AinN inputs to AVDD/2; however, I suspect this is useless as I'm using the internal reference. Nevertheless, if I read the device 8 times and average the values I get (all of them seem to be zero), I get a zero offset to subtract from the result. So that is not helping me at all. I am using a voltage follower to supply the ADC input (using an OPA4277 opamp) and I measure 1.999 to 2.000 (to four digits) in the input. Any suggestions on why I'm getting 291xx rather than 32000?
↧
↧
Forum Post: RE: ADS1219: How to calibrate ADS1219?
BTW, 20 SPS, continuous, vref_int, and gain=1
↧
Forum Post: ADS1299: ADS1299 voltage problem
Part Number: ADS1299 Tool/software: 1.When testing the ADS1299, I found that when the ADS1299 did not let PWDN and RESET pins go high, the AVSS was -2.49V, but after turning on PWDN and RESET, the AVSS dropped to -2.2~2.3V, so what could be the reason for this? 2.Is it necessary to add a 10K resistor between PWDN and VCC, and what is the purpose of that resistor? 3.When using the new ADS1299, vcap1 to gnd is the normal value -1.3V, but vcap3 to gnd will be floating value, about 0.4~1V, not long after the ADS1299 is bad, vcap1 to gnd will become AVSS, what may be the reason for this? Fig1.-2.5V sch Fig2. ads1299 sch Fig3.PWDN、reset connect Fig4. PCB (The white line is the -2.5V line.only connect ADS1299)
↧
Forum Post: RE: TSC2007: Touch Screen Drivers Interface Y+/Y- cannot work
The Touch panel is removed but the digital output of the TSC is used to put the blue pointer at x,y coordinate. Is that correct ? JOE: The touch panel is removed. The blue pointer is TSC x,y coordinates under Android. Is this waveform when you drive the X+ pin with a 470 ohm resistor? JOE: I derived X+ and Y+ with 470ohm resistor individually , and connect to adjustable DC power supply PST-3202. When you increase the level of the DC Voltage Does the bottom level of the waveform go up. At the DC supply set at 0v does this level go below 0.5V? JOE: The bottom level of the waveform is 0.5V when input from 0V to 0.5V. It will go up when input is over 0.5V. The X+/Y+ are same behavior. Also as an additional test make x+=1.65v and move the Y+ with the DC Supply. Does this go all the way from top to bottom? JOE: Base on our SW setting and the test result is as below, Fixed X+=1.65v , increase the Y+ form 0V to 3.3V, the pointer goes from left to right. Fixed Y+=1.65V , increase the X+ form 0V to 3.3V, the pointer goes from up do down.
↧