Search found 38 matches
- Sat Jan 18, 2020 7:14 pm
- Forum: General discussion
- Topic: Correct usage of HAL functions in Arduino code
- Replies: 26
- Views: 24768
Re: Correct usage of HAL functions in Arduino code
@mrburnette Don't agree with your option, here are my thoughts: ... At my current development I have to move from AVR platform (two different chips, not ATMEGA328) to STM32 (and here I had to switch to more advanced chip during development). PS. Sorry for the flame :) My final, thoughts: STM32duino...
- Sat Jan 18, 2020 7:46 am
- Forum: General discussion
- Topic: Correct usage of HAL functions in Arduino code
- Replies: 26
- Views: 24768
Re: Correct usage of HAL functions in Arduino code
mrburnette Don't agree with your option, here are my thoughts: 1. You can use Arduino not only with Arduino IDE. For example, I use it with PlatfromIO IDE joined with Visual Studio Code. 2. Working with a great number of hardware it is better to use a single framework instead of 10 different. For e...
- Thu Jan 16, 2020 5:45 pm
- Forum: General discussion
- Topic: Correct usage of HAL functions in Arduino code
- Replies: 26
- Views: 24768
Re: Correct usage of HAL functions in Arduino code
Thank you, will try over a week.fpiSTM wrote: ↑Thu Jan 16, 2020 5:31 pm @kvv213
Here an example of ADC and DMA usage:
viewtopic.php?f=41&t=110
- Mon Jan 06, 2020 2:32 pm
- Forum: General discussion
- Topic: Correct usage of HAL functions in Arduino code
- Replies: 26
- Views: 24768
Re: Correct usage of HAL functions in Arduino code
Yes this enable the IRQ, but when the IRQ raised what should be done ? In my understanding the following should happen: 1. Chip does some ADC measurments in infinite cycle. 2. When it measures enough it rises interrupt "TCIE: Transfer complete interrupt enable" 3. And in that interrupt it...
- Mon Jan 06, 2020 1:35 pm
- Forum: General discussion
- Topic: Correct usage of HAL functions in Arduino code
- Replies: 26
- Views: 24768
Re: Correct usage of HAL functions in Arduino code
I may be wrong, but as I understand the code: HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn); it enables DMA1_Channel1_IRQn IRQ-handler. That is defined at stm32f103xe.h driver as DMA1_Channel1_IRQn = 11, /*!< DMA1 Channel 1 global Interrupt */ This code works...
- Mon Jan 06, 2020 11:35 am
- Forum: General discussion
- Topic: Correct usage of HAL functions in Arduino code
- Replies: 26
- Views: 24768
Re: Correct usage of HAL functions in Arduino code
Did as you recommended :) The result is the same. Infinite loop at: /* Set the DMA half transfer complete callback */ hadc->DMA_Handle->XferHalfCpltCallback = ADC_DMAHalfConvCplt; HAL_ADC_MODULE_ONLY enabled via -DHAL_ADC_MODULE_ONLY option to compiler. The first time I indeed forgot about DMA setti...
- Sun Jan 05, 2020 8:33 pm
- Forum: General discussion
- Topic: Correct usage of HAL functions in Arduino code
- Replies: 26
- Views: 24768
Correct usage of HAL functions in Arduino code
Hello every one again! I have a question according to a correct usage of HAL functions inside Arduino code. For example, I'd like to use my custom board with STM32F103RE and use DMA processing of the chips ADC. I have code that more or less works in cube code generated. And I took everything that co...
- Fri Jan 03, 2020 7:51 pm
- Forum: General discussion
- Topic: analogRead and analogWrite troubles
- Replies: 37
- Views: 47946
Re: analogRead and analogWrite troubles
It seems that I've managed to find the problem with analogRead PA_3: Annotation 2020-01-03 224859.png There can be a mistake at line 32. Instead of #ifdef #ifndef is used. So in that case PA_3 refers to ADC3 with 3rd channel. But the rest of refers to ADC1 and ADC2. So, I've commented 46 and added 4...
- Fri Jan 03, 2020 6:59 pm
- Forum: General discussion
- Topic: analogRead and analogWrite troubles
- Replies: 37
- Views: 47946
Re: analogRead and analogWrite troubles
Unfortunately, I have no more clue and I have no board with this MCU version to test. Anyway, I see no reason it could not work. You said you use PIO? Did you try with Arduino IDE? Yes, at first I try with Arduino IDE, then try and debug under PIO. I did one more experiment based on your amendment ...
- Fri Jan 03, 2020 11:36 am
- Forum: General discussion
- Topic: analogRead and analogWrite troubles
- Replies: 37
- Views: 47946
Re: analogRead and analogWrite troubles
Is the ADC3 now works with the clock config I gave you ? I've checked the code you provided. Unfortunately it doesn't help. After receiving the value (correct from my point of view) from PA_3 it receives unexpected interrupt and went to Infinite_Loop: b Infinite_Loop section of startup_stm32f103xe....