Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Recent content by Alpaslan_Ersoz

  1. A

    12 Bit ADC with interfacing SPI in STM32

    Hi Klaus, Today, I try again to figure out the sampling rate based on your comments. These are all sampling rate related comments of yours. So based on that I would use SPI DMA mode instead of timer interrupt for setting sampling frequency?
  2. A

    12 Bit ADC with interfacing SPI in STM32

    Hi, I am sorry I couldn't catch it. If you explain again, I will happy with that. Otherwise, thank you very much so far for your help! Thank you,
  3. A

    12 Bit ADC with interfacing SPI in STM32

    Hi, So, I set a timer (TIM4) with internal clock in interrupt mode. I verified it with one of the GPIO pin (TIM_CRTL) which has 10kHz. Then I set a flag which will be '1' when the interrupt happens. I placed this flag in to while loop during calling the conversion function. Calling function...
  4. A

    12 Bit ADC with interfacing SPI in STM32

    Hello Klaus, How can I change it? If I set the SPI baudrate as around 1Mbits/s, the clock signal shape looks rectangular. Thank you,
  5. A

    12 Bit ADC with interfacing SPI in STM32

    I fed the my main signal to the ADC input. I observe the conversion of the signal of mid level (1.95V) as 'volt' value in the debug session. I don't know how long should I wait to see low level (1.628V) and high level (2.288V) of the signal in the watch window as output of the conversion in...
  6. A

    12 Bit ADC with interfacing SPI in STM32

    Thank you, Klaus! Just my curiosity, could you briefly describe this part of your message? I capture the ADC SCK (green), ADC SDO (blue), and ADC CS (yellow) signals. I measured the rising and falling edge for CS signal. For calculating sampling rate, I added the figure with multiple CS and...
  7. A

    12 Bit ADC with interfacing SPI in STM32

    For make more clarification, I drew the existing connection between the stm32 and ADC. I highlighted the pull up resistor. Do you think its true configuration and resistor value? Now the SPI works full duplex master mode so is it also true?
  8. A

    12 Bit ADC with interfacing SPI in STM32

    Yes I enabled NSS with Hardware output in CubeMX and pulled-up CS pin. static void MX_SPI4_Init(void) { /* SPI4 parameter configuration*/ hspi4.Instance = SPI4; hspi4.Init.Mode = SPI_MODE_MASTER; hspi4.Init.Direction = SPI_DIRECTION_2LINES; hspi4.Init.DataSize =...
  9. A

    12 Bit ADC with interfacing SPI in STM32

    Let's finalize this post. I isolate the analog input signal of ADC from the circuit, by then I connect this pin to the function generator output which generates 1kHz with 520mV peak to peak sine wave signal. I also changed supply voltage of ADC to 3.3V. I get the plot for ADC SCK (yellow...
  10. A

    12 Bit ADC with interfacing SPI in STM32

    Actually, I couldn't read the correct values with 'volt' variables. I want to share my code, input signal, and ADC signals. I miss something because the 'volt' shows different values than input signal amplitudes. Function code: uint8_t i; uint16_t Sample; float volt=0; uint8_t ADC_Buf[2]...
  11. A

    12 Bit ADC with interfacing SPI in STM32

    Thanks KlausST and Aussie Susan for great explanations! I still try to find an applications about NSS enabled SPI because mostly YouTube videos and internet search don't have NSS function. They mostly prefer GPIO type CS pin. But I wonder how it works. So I will try to implement it. The other...
  12. A

    12 Bit ADC with interfacing SPI in STM32

    Ok, I set timer in interrupt mode as 10kHz. But ADC SCK is not active only ADC CS is at low level. They are independent. What is the wrong in my code? Timer interrupt file code: void TIM4_IRQHandler(void) { /* USER CODE BEGIN TIM4_IRQn 0 */ /* USER CODE END TIM4_IRQn 0 */...
  13. A

    12 Bit ADC with interfacing SPI in STM32

    I have tried to do control sampling frequency with a timer in interrupt mode. But I couldn't figure out. My input signal has around 1.2kHz frequency, so I set the sampling frequency as 10kHz. But the clock cycle is not limited during the sampling time. The code is in the stm32f7xx_it.c /*...
  14. A

    12 Bit ADC with interfacing SPI in STM32

    Ok, I will try to control timer interrupt and share my results. At the mean time, I mean with 'all outputs' that to observe the input analog signal amplitude values in digitized "volt" variable. You see that "testdata_in" array index is updated different values of "volt" variable. So, my...
  15. A

    12 Bit ADC with interfacing SPI in STM32

    Hello, According Nyquist theorem, I know that sampling frequency is at least two times bigger than analog signal. Practically, ten times bigger is selected. For example, in post #7, there is input analog signal and its frequency is almost 3kHz, so sampling frequency should be 30kHz. After that...

Part and Inventory Search

Back
Top