Dont try to modify the code written for another core. Take a look at the Timer documentation for the stm32duino core
https://github.com/stm32duino/wiki/wiki ... y#Examples
The InputCapture.ino example should help with configuring timers and attaching an input capture interrupt.
Search found 94 matches
- Thu Mar 11, 2021 5:23 pm
- Forum: General discussion
- Topic: 'Timer2' was not declared in this scope
- Replies: 8
- Views: 6108
- Tue Mar 09, 2021 8:01 pm
- Forum: IDE's
- Topic: Arduino IDE 2.0
- Replies: 18
- Views: 13790
Re: Arduino IDE 2.0
I downloaded and tried to code some encoder stuff onto a Nucleo L476 board. Starting from a Arduino 1.8 installation with stm32duino I downloaded IDE 2.0 and started the new IDE. After adding the the STM32Duino additional board manager path https://github.com/stm32duino/BoardManagerFiles/raw/master/...
- Sat Mar 06, 2021 2:46 pm
- Forum: General discussion
- Topic: Problem with multiple timer input capture
- Replies: 3
- Views: 3546
Re: Problem with multiple timer input capture
Since both inputs are on the same timer, TIM2, there should be only one HardwareTimer object, and both channels should be configured for this timer.
- Sat Mar 06, 2021 8:02 am
- Forum: General discussion
- Topic: Problem with STM32F103C8 and SPI OLED with U8g2 lib
- Replies: 3
- Views: 3025
Re: Problem with STM32F103C8 and SPI OLED with U8g2 lib
How is the display connected to the SM32, what pins ?
What core are you using, what board and variant selection ?
What core are you using, what board and variant selection ?
- Mon Mar 01, 2021 5:11 pm
- Forum: General discussion
- Topic: Cannot get any HW serial interface working on STM32F407VG Discovery
- Replies: 3
- Views: 2598
Re: Cannot get any HW serial interface working on STM32F407VG Discovery
Try pins PA2 and PA3, or pD8 and PD9, it looks like PA10 and PA9 are connected to the debug ST-Link
- Sun Feb 28, 2021 3:12 pm
- Forum: General discussion
- Topic: Error when running STM32_Programmer_CLI
- Replies: 2
- Views: 4296
Re: Error when running STM32_Programmer_CLI
Just as the error message states: The FTDI adapter is not a ( ST-Link ) debug probe. The FTDI is opened as a serial port on the Linux side and also when connected to the STM32F103C, I assume it is connected to RX and TX pins. So for STM32_Programmer_CLI you must give the serial port on Arch Linux th...
- Thu Feb 25, 2021 9:48 am
- Forum: General discussion
- Topic: Port manipulation STM32F411
- Replies: 6
- Views: 5577
Re: Port manipulation STM32F411
The analogRead() function is very generic, and it intializes and deinitializes the HAL ADC layer for every call. A quick test on a F407 Discovery board gave around 60uS per call or 18kHz sampling frequency. If you do your own calls to the HAL layer, this can be improved a lot. I tested the code from...
- Tue Feb 23, 2021 10:18 am
- Forum: General discussion
- Topic: Port manipulation STM32F411
- Replies: 6
- Views: 5577
Re: Port manipulation STM32F411
You can use PWM outputs for precisely timed sequences of pulses, or make it yourself using the timer library, its really convenient but the interrupt overhead in HAL for attach'd interrupts is a bit long, depends on your speed and timing requirements. Another pattern for timed events is something li...
- Mon Feb 15, 2021 7:04 pm
- Forum: General discussion
- Topic: STM32 - detachInterrupt and deepSleep
- Replies: 9
- Views: 11429
Re: STM32 - detachInterrupt and deepSleep
Looking at the source code in the Low Power library: https://github.com/stm32duino/STM32LowPower void STM32LowPower::attachInterruptWakeup(uint32_t pin, voidFuncPtrVoid callback, uint32_t mode, LP_Mode LowPowerMode) this function does two things, it attaches the pin interrupt and it enables the pin ...
- Tue Jan 05, 2021 4:24 pm
- Forum: General discussion
- Topic: Compensate for LSE error
- Replies: 12
- Views: 8375
Re: Compensate for LSE error
I dont have the hardware to test but if the LSE runs correctly when not sleeping then my wild guess would be that the core somehow switches to LSI when sleeping.