Search found 14 matches

by xlwww
Thu Jan 05, 2023 3:59 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

Re: Question about Bluepill arduino using OnePulse mode

This looks great, I will try it. Obviously you already know a lot about STM32!
by xlwww
Wed Jan 04, 2023 8:11 am
Forum: General discussion
Topic: Proteus Simulation Failure
Replies: 9
Views: 4595

Re: Proteus Simulation Failure

Yes, I also encountered this problem when using F103C6, proteus8.9, after making changes it can be loaded, but the code does not run normally.Have you solved it? Thanks~
by xlwww
Mon Jan 02, 2023 5:10 pm
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

Re: Question about Bluepill arduino using OnePulse mode

I think that external pin interrupts will bring more complex code logic and code layout requirements, so I think it seems more appropriate to use a timer. I want DMA to pass the captured data directly into the array, but I didn't find the relevant code, I think this will double the efficiency
by xlwww
Mon Jan 02, 2023 3:37 pm
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

Re: Question about Bluepill arduino using OnePulse mode

This is a good idea, how should I use DMA to capture the pulse width.
by xlwww
Mon Jan 02, 2023 1:01 pm
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

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 cap...
by xlwww
Mon Jan 02, 2023 8:08 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

Re: Question about Bluepill arduino using OnePulse mode

I found the reason again, I defined an array char temp[10]="", hum[10]=""; it seems to be out of bounds when using sprintf, I changed them to char temp[30]= "",hum[30]=""; it can work! It turns out that the array should be set as large as possible when startin...
by xlwww
Mon Jan 02, 2023 6:37 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

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 ...
by xlwww
Mon Jan 02, 2023 5:40 am
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

Re: Question about Bluepill arduino using OnePulse mode

your approach (and implementation) is driven by your goal and your constraints. the code you are using is a blocking implementation and your goal seems to be a non-blocking implementation. the most "correct" implementation would be to use interrupts - a state machine implementation. If yo...
by xlwww
Sun Jan 01, 2023 2:58 pm
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

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 you...
by xlwww
Sun Jan 01, 2023 2:53 pm
Forum: General discussion
Topic: Question about Bluepill arduino using OnePulse mode
Replies: 33
Views: 3850

Re: Question about Bluepill arduino using OnePulse mode

Happy New Year! Here is my code, I tested it for days and it doesn't work. Since it only responds once the first time, I use print_reg() to record the main register state before it works fine, and try to restore the first time register state on the next time. At the same time, when an interrupt is t...

Go to advanced search