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

Forum Post: ADS1293: SPI communication with Master device, no output from SDO.

$
0
0
Part Number: ADS1293 Hi everyone! I'm trying to use an nrf52 board as the master to initially read one of the registers on the ADS1293. I've gotten everything to work fine using an arduino but can't get it to work with the nrf board. The problem is that nothing gets returned through the SDO/MISO wire. The code I have for the arduino is basically this: void setup() { // put your setup code here, to run once: Serial.begin(115200); Serial.println("Starting SPI\n"); SPI.begin(); SPI.setClockDivider(SPI_CLOCK_DIV2); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE2); } void loop() { byte data; digitalWrite(53, LOW); byte reg = 0x00; reg |= 0x80; SPI.transfer(reg); data = SPI.transfer(0); digitalWrite(53, HIGH); Serial.println("we got:"); Serial.println(data,HEX); } And for the NRF52: #define SPI_INSTANCE 0 static uint8_t tx[2]; static uint8_t rx[2]; static const nrfx_spim_t m_spi_master_0 = NRFX_SPIM_INSTANCE(SPI_INSTANCE); void ADS_init( void ) { nrfx_spim_config_t const spi_config = { .sck_pin = 4, .mosi_pin = 22, .miso_pin = 23, .ss_pin = 3, .irq_priority = APP_IRQ_PRIORITY_LOW, .orc = 0xFF, .frequency = NRF_SPIM_FREQ_4M, .mode = NRF_SPIM_MODE_2, .bit_order = NRF_SPIM_BIT_ORDER_MSB_FIRST, }; ret_code_t err_code = nrfx_spim_init(&m_spi_master_0, &spi_config, NULL, NULL); SEGGER_RTT_printf(0, nrf_strerror_get(err_code)); } uint8_t Read_reg(uint8_t addr) { tx[0] = addr | ADS1293_READ_BIT; tx[1] = 0x00; nrfx_spim_xfer_desc_t xfer_desc = NRFX_SPIM_XFER_TRX(tx, 2, rx, 2); ret_code_t err_code = nrfx_spim_xfer(&m_spi_master_0, &xfer_desc, 0); SEGGER_RTT_printf(0, nrf_strerror_get(err_code)); return rx[1]; } Since nothing return to the MISO the excution basically gets stuck. I hope this is the right place to post.

Viewing all articles
Browse latest Browse all 90537


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