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

Forum Post: RE: ADS127L01: Master-Clock vs. SPI-Clock

$
0
0
Hi Tom, first, thanks for your answer. Of course I can include the plots. Just a short snippet of my software, which shows the sequence of the register write and register read: spiState = SpiState::WriteReg; u8 buffer1[3] = {0x41, 0x00, 0b00000001}; while (!spi.Transmit(buffer1, 3)) { Thread::Sleep(2); } while (spiState != SpiState::Idle) { Thread::Sleep(2); } Thread::Sleep(2); // <----- LOOK HERE! spiState = SpiState::ReadReg; u8 buffer2[10] = {0x20, 0x07, 0, 0, 0, 0, 0, 0, 0, 0}; if (!spi.Transmit(buffer2, 10)) { log_err("[ADS127L01] Configuration error."); return; } while (spiState != SpiState::Idle) { Thread::Sleep(2); } Watch out for the thread delay which is commented with "LOOK HERE". The following plots shows a working configuration with 720kHz MCLK and 1.6875MHz SCLK. The first plot shows the overall sequence from startup: The next three plots show a detailed view of the marking "1" inside the first plot: Write to the option register: Read all registers: And here is a detailed view of point "2", marked in the overview plot, as you can see, everything seems correct: EDIT: Please ignore the MOSI-line pulled up for a few us before the conversions. I had to do some tricks with the SPI and DMA hardware of the MCU to lower the interrupt requests for the continuous data stream. Now I change the SCLK to 3.375MHz. The initialization duration is the same, here is the overview (the data gathering is not starting, because my firmware could not verify the ID of the ADC): The write-to-reg plot looks exactly like the upper one, except that the baudrate is faster. Now here the register read, all zeros: Now I change SCLK back to 1.6875MHz AND remove the delay from my software sequence: spiState = SpiState::WriteReg; u8 buffer1[3] = {0x41, 0x00, 0b00000001}; while (!spi.Transmit(buffer1, 3)) { Thread::Sleep(2); } while (spiState != SpiState::Idle) { Thread::Sleep(2); } // Thread::Sleep(2); // <----- LOOK HERE! spiState = SpiState::ReadReg; u8 buffer2[10] = {0x20, 0x07, 0, 0, 0, 0, 0, 0, 0, 0}; if (!spi.Transmit(buffer2, 10)) { log_err("[ADS127L01] Configuration error."); return; } while (spiState != SpiState::Idle) { Thread::Sleep(2); } And here now the corresponding plot of the register read: OSR and FILTER is set to 0 by pulling the corresponding pins low. The register value I read out confirms this. Thanks in advance and greetings, Reggie

Viewing all articles
Browse latest Browse all 27683

Trending Articles



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