Search found 144 matches

by ozcar
Mon Jan 02, 2023 9:36 pm
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

There is another funky, hardware driven way using a counter is to use a timer and DMA. Accordingly, a timer can trigger DMA, e.g. to read a set of gpios in sequence, this is actually 'the' way to 'read/write parallel data'. As DHT11/DHT22 is first triggered using a single pulse from the mcu, this c...
by ozcar
Mon Jan 02, 2023 10:58 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

I can easily get your previous code to fail - as in stop responding altogether, by just presenting it with more pulses than it expects. I cannot get it to stop responding if I add this to the handler_channel_1() routine: void handler_channel_1(void) { //This function is called when channel 1 is capt...
by ozcar
Mon Jan 02, 2023 6:06 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

So I took your code and tried it. Yes, I had to install the "Roger" core to get it to compile. It has been a very long time since I used this core and I have either forgotten, or perhaps I never did know where Serial2 goes to, so all I did initially was to redefine Serial2 as Serial so I c...
by ozcar
Sat Dec 31, 2022 3:05 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

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...
by ozcar
Thu Dec 29, 2022 10:59 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

I don't have a DHT11 to test with, but this seems to work for me. However it is written for the official STM core as that is all I use now, and I tried it on a F401 board. As far as I know it does not do anything that could not work on F103 Bluepill. It works the same regardless of whether one pulse...
by ozcar
Wed Dec 28, 2022 6:19 pm
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

... if you tie the output line to a spare pin configured for input, then you can tell at any point in your code whether the timer is driving the line low or not. I was thinking about this later, and maybe you don't even need a "spare" pin to do that. In https://www.stm32duino.com/viewtopi...
by ozcar
Wed Dec 28, 2022 11:51 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

I should have realised that you are using a Leaflabs/Libmaple based core, not the "official" STM one. For a long time now I have only used the STM core, so what I said before may not apply, but then the underlying hardware is the same so it is possible that you could run into similar probl...
by ozcar
Tue Dec 27, 2022 8:20 pm
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

I'm not familiar with DHT11 at all, but two things come to mind: Firstly, maybe you have run into a problem like here - https://www.stm32duino.com/viewtopic.php?f=7&t=1563 . That did result in a change to the hardwaretimer code, but it still may be necessary to move the Timer2.refresh() to after...
by ozcar
Tue Dec 27, 2022 11:31 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3826

Re: Question about Bluepill arduino using OnePulse mode

Show us what you tried, and in what way did it not work?
by ozcar
Tue Dec 27, 2022 5:19 am
Forum: Projects
Topic: STM32F103C8 Fast Input Rate Counter
Replies: 23
Views: 5346

Re: STM32F103C8 Fast Input Rate Counter

Good to hear that you are making progress. A few comments: Like "counter", "Direction" should be declared as volatile. It may be reasonable to assume, or maybe you know for sure, that there will not be a step pulse very close to a change of direction, so it might be "safe&qu...

Go to advanced search