Re: Question about Bluepill arduino using OnePulse mode
Posted: Sat Dec 31, 2022 3:05 am
It sounds like you are getting close.
I'm pretty sure that if I wanted to, I could create a program that behaves that way, where deleting "unused" variables could make it work or not. How you have managed to do that accidentally is impossible to say when you show us only tiny parts of your code. Now if you are having a problem with some little part of a big project, then creating a small self-contained example that demonstrated the problem would be Good Thing, but what you posted does not demonstrate anything.
Taking a step back to what you said before.
Do you have some good reason to not use the official STM core?
I'm pretty sure that if I wanted to, I could create a program that behaves that way, where deleting "unused" variables could make it work or not. How you have managed to do that accidentally is impossible to say when you show us only tiny parts of your code. Now if you are having a problem with some little part of a big project, then creating a small self-contained example that demonstrated the problem would be Good Thing, but what you posted does not demonstrate anything.
Taking a step back to what you said before.
The specifications for the DHT11 says you can read it at most once per second. Including the 18ms start pulse, it takes a maximum of 23ms to get a reading. Than means that whatever you do, you stand to gain an extra 2.3% of total available CPU time for your computations. If that is enough to make or break your project, perhaps you should consider using a faster processor. I quite like the STM32F411 Blackpill boards.xlwww wrote: Tue Dec 27, 2022 1:24 pm I am using Timer2 channel1 (PA0) to drive the DHT11 sensor, saving CPU resources for computationally intensive work.
Do you have some good reason to not use the official STM core?