Timeline for STM32 ADC sampling with timer and DMA and send data to computer with USB
Current License: CC BY-SA 4.0
23 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 1, 2022 at 6:58 | answer | added | Ralph Hempel | timeline score: 2 | |
May 7, 2021 at 14:59 | history | edited | SeAlGhz | CC BY-SA 4.0 |
added 520 characters in body
|
May 7, 2021 at 14:43 | vote | accept | SeAlGhz | ||
May 7, 2021 at 14:43 | history | edited | SeAlGhz | CC BY-SA 4.0 |
added 45 characters in body; edited title
|
May 7, 2021 at 13:28 | history | edited | SeAlGhz | CC BY-SA 4.0 |
added 159 characters in body
|
May 7, 2021 at 13:21 | history | edited | SeAlGhz | CC BY-SA 4.0 |
edited title
|
May 7, 2021 at 13:03 | history | edited | JRE | CC BY-SA 4.0 |
added 18 characters in body; edited title
|
May 7, 2021 at 12:45 | history | edited | SeAlGhz | CC BY-SA 4.0 |
added 350 characters in body
|
May 7, 2021 at 12:19 | history | edited | SeAlGhz | CC BY-SA 4.0 |
added 760 characters in body
|
May 7, 2021 at 12:11 | answer | added | Jiří Maier | timeline score: 0 | |
May 7, 2021 at 11:57 | comment | added | SeAlGhz | @JiříMaier. That is a subtle point. But how does it transmit the data when it does not use interrupt? | |
May 7, 2021 at 11:56 | comment | added | Jiří Maier | But if you use (unmodified) CDC_Transmit_FS inside usb_put_arr_int(arr,ARRAY_LENGTH), the function returns immediately after the transfer is started (and not yet finished). So you start the timer and DMA before USB is finished anyway. | |
May 7, 2021 at 11:53 | comment | added | SeAlGhz | @JiříMaier but as you can see I stopped the DMA and timer so it does not supposed to transmit new data into DMA. You mean that CDC_Transmit_FS((uint8_t*) buf, len) does not block the code? But interrupt is not enabled for transmission. | |
May 7, 2021 at 11:50 | comment | added | Jiří Maier | How is the usb_put_arr_int implemented? The CDC_Transmit_FS((uint8_t*) buf, len) function (which I suppose you use for transmitting buffer) doesn't block until the transmit is finished. It only starts the transfer and code continues immediately. So you are probably overwriting the buffer by new measurement while it is being transmited. | |
May 7, 2021 at 11:45 | history | edited | SeAlGhz | CC BY-SA 4.0 |
added 426 characters in body
|
May 7, 2021 at 11:37 | comment | added | SeAlGhz | @user_1818839, I updated the question | |
May 7, 2021 at 11:37 | comment | added | SeAlGhz | @DeanFranks, I updated the question. | |
May 7, 2021 at 11:36 | history | edited | SeAlGhz | CC BY-SA 4.0 |
added 426 characters in body
|
May 7, 2021 at 11:20 | comment | added | user16324 | Something else is running at 1/200 of the sample rate. Disable any interrupts with slow handlers while sampling; re-enable them after. | |
May 7, 2021 at 5:33 | answer | added | Simon Peacock | timeline score: 0 | |
May 7, 2021 at 2:31 | comment | added | Dean Franks | You'll have to post code to get an answer. I strongly suspect you have a buffer length/handling problem with the DMA buffer but it is impossible to tell without seeing the code. If you have the RAM, set up two buffers in memory and in the interrupt handler at the end of the conversions just swap to the other buffer and set a flag. In a main polling loop, check the flag and process the complete buffer outside the interrupt handler. | |
May 6, 2021 at 22:55 | review | First posts | |||
May 18, 2021 at 21:32 | |||||
May 6, 2021 at 22:55 | history | asked | SeAlGhz | CC BY-SA 4.0 |