Search found 143 matches

by ozcar
Thu Feb 29, 2024 1:48 am
Forum: General discussion
Topic: STM32 hangs when >100khz signal applied to input
Replies: 19
Views: 907

Re: STM32 hangs when >100khz signal applied to input

Dannyf, I missed your updates on the second page previously. It is a very different situation if you can avoid the STM32DUINO and maybe HAL code as well, but this could be easier said than done depending on what other parts of STM32DUINO need to be used in the final project. Maybe your "cut dow...
by ozcar
Wed Feb 28, 2024 9:07 pm
Forum: General discussion
Topic: STM32 hangs when >100khz signal applied to input
Replies: 19
Views: 907

Re: STM32 hangs when >100khz signal applied to input

for around 5µs that's too long. your ISR overhead will be 20 ticks. Hard to imagine this thing goes over 100 ticks end-to-end. I will do some testing later on as well. I would be interested to see what you find. I've done tests like that before, and the result is not out of line with what I have se...
by ozcar
Wed Feb 28, 2024 5:22 am
Forum: General discussion
Topic: STM32 hangs when >100khz signal applied to input
Replies: 19
Views: 907

Re: STM32 hangs when >100khz signal applied to input

I would approach the problem this way. 1. Set up an input capture on falling edge. No interrupt. 2. Set up one input capture on rising edge, interrupt enabled. In this isr, you will need to calculate the timer count elapsed between two isr invocations, and the difference between the count captures ...
by ozcar
Mon Feb 26, 2024 8:54 pm
Forum: General discussion
Topic: STM32 hangs when >100khz signal applied to input
Replies: 19
Views: 907

Re: STM32 hangs when >100khz signal applied to input

I lifted up the first code you posted (that uses input capture) and tried it on 72MHz F103. I could not get it to work anywhere near 100kHz. At 20kHz it was producing output, but looking like this: Frequency = 0.0000 Dutycycle = 0.0000 I then changed it to produce the pwm output on pin PA1 instead o...
by ozcar
Mon Nov 20, 2023 9:06 pm
Forum: General discussion
Topic: Convert Arduino cod from stm
Replies: 2
Views: 3975

Re: Convert Arduino cod from stm

I lifted up you code (which would have been easier if you had made proper use of code tags) and tried to compile it using the "official" STM32DUINO core, and yes, there are several references to AVR registers like SPDR that will need attention, and also definition of an ISR routine. Howeve...
by ozcar
Fri Sep 29, 2023 3:51 am
Forum: General discussion
Topic: Problem with mils not working with max6675 library.
Replies: 11
Views: 1772

Re: Problem with mils not working with max6675 library.

in setup() add timer = millis(); you forgot to initialize the variable. And use \[code\] blocks to enclose the code in posts here, that makes it much more readable. (global) variables that are uninitialised takes an undefined value, not necessary 0 (zero). imagine that it is 0xffffff, then that loo...
by ozcar
Thu Sep 28, 2023 2:14 am
Forum: General discussion
Topic: Problem with mils not working with max6675 library.
Replies: 11
Views: 1772

Re: Problem with mils not working with max6675 library.

Not having all your hardware, I can’t lift up your whole program and try it. However I can pretend that I have a MAX6675 attached, and when I include this in the loop() if ((millis()-timer ) >= 500) { temp1 = thermocouple.readCelsius(); Serial.println(temp1); timer = millis(); } delay(1000); then it...
by ozcar
Wed Sep 27, 2023 9:25 pm
Forum: General discussion
Topic: Problem with mils not working with max6675 library.
Replies: 11
Views: 1772

Re: Problem with mils not working with max6675 library.

When using classic milis processing if ((millis()-timer ) >= 500) { temp1 = thermocouple.readCelsius(); Serial.println(thermocouple.readCelsius()); timer = millis(); } Maybe you need to explain more as to what the problem actually is. Does the code as you showed work OK, but stops working if you re...
by ozcar
Thu Aug 24, 2023 10:33 pm
Forum: Projects
Topic: Voltage divider on Nucleo STM32L452RE bad accuracy
Replies: 8
Views: 4541

Re: Voltage divider on Nucleo STM32L452RE bad accuracy

With less than 500nA through the resistors, have you checked the input leakage current specifications?
by ozcar
Mon Jul 31, 2023 2:57 am
Forum: Libraries & Hardware
Topic: PWM pin in STM32F103C8 blue pill
Replies: 8
Views: 5057

Re: PWM pin in STM32F103C8 blue pill

This is the basic code:- ... I checked the PWM pins according to the following pin diagram:- https://how2electronics.com/wp-content/uploads/2019/02/STM32-Pin-Details.jpg Your link also does not work for me, so I'm not sure what you were working from. From what you said before, I got the impression ...

Go to advanced search