Search found 146 matches

by ozcar
Wed May 18, 2022 11:42 am
Forum: General discussion
Topic: Unwanted ISR call from timer ??
Replies: 7
Views: 2583

Re: Unwanted ISR call from timer ??

Thanks for your response. Note: an alternative solution would be to call setPreloadEnable(false); in order to disable the preload feature (the buffer) I tried inserting that just before the call to setOverflow() and I can see that it turns off ARPE in CR1, so that the change to ARR takes effect stra...
by ozcar
Tue May 17, 2022 6:55 pm
Forum: General discussion
Topic: Unwanted ISR call from timer ??
Replies: 7
Views: 2583

Re: Unwanted ISR call from timer ??

I also was not aware of the existence of refresh() until yesterday. When I first realised what was happening, I tried directly setting the UG flag in the timer EGR register. Then I spotted refresh() in the HarwareTimer documentation and so tried using that instead. Today I checked HardwareTimer.c, a...
by ozcar
Tue May 17, 2022 4:55 am
Forum: General discussion
Topic: Unwanted ISR call from timer ??
Replies: 7
Views: 2583

Re: Unwanted ISR call from timer ??

I took your code and tried it on a F401RE Nucleo, initially just changing the LED pin definition. The ISR does seem to be called "too soon", but not immediately. I added a couple of statements to store micros() value at GTim->resume() and then subtract that from micros() in the ISR, and th...
by ozcar
Mon May 16, 2022 3:08 am
Forum: Projects
Topic: How do I adapt this 8 bit ladder DAC for STM32F401 Black Pill?
Replies: 7
Views: 4238

Re: How do I adapt this 8 bit ladder DAC for STM32F401 Black Pill?

Some STM32 processors have built-in DAC, so if you used one of those you would not need the resistor ladder. As for writing to ODR, that should be very simple if you could arrange things to use say bit 7 to bit 0 for the DAC lines in sequence high-order to low order, with the other 8 GPIOs of the po...
by ozcar
Wed Apr 27, 2022 1:41 am
Forum: Projects
Topic: Rotary encoder with STM32F401CCU
Replies: 6
Views: 7934

Re: Rotary encoder with STM32F401CCU

something like PORTA->IDR Worked like a charm :) Well, I have to say that is a bit amazing, because I see now I was a bit crazy when I wrote that. What I meant to write was to use GPIOA->IDR instead of PORTA->regs->IDR. Maybe you were smart enough to see through my botched cut/paste/edit! Secondly,...
by ozcar
Tue Apr 26, 2022 8:04 am
Forum: Projects
Topic: Rotary encoder with STM32F401CCU
Replies: 6
Views: 7934

Re: Rotary encoder with STM32F401CCU

... Using the following code from the next linked page, I tried to do the same for the STM32 but I got a flag that PORTB has no member named "regs" (I get the same for PORTA). PORTA->regs->CRL = (PORTA->regs->CRL & 0x00F00F00) | 0x88000080 |0x00033003; https://gist.github.com/iwalpola...
by ozcar
Fri Mar 04, 2022 6:52 pm
Forum: General discussion
Topic: How to dynamically change duty cycle with HardwareTimer library?
Replies: 24
Views: 9514

Re: How to dynamically change duty cycle with HardwareTimer library?

If the duty cycle is simply retrieved from a table, perhaps you could get DMA to do it. But before going down that path, are you sure you have a problem, and if you do, how much is the setCaptureCompare(…) contributing to it. What else are you doing in the callback? If you have some spare GPIOs, and...
by ozcar
Tue Feb 08, 2022 9:49 pm
Forum: General discussion
Topic: BlackPill STM32F411CE PA11 PA12 Digital Out Not Working
Replies: 3
Views: 2326

Re: BlackPill STM32F411CE PA11 PA12 Digital Out Not Working

Imk was obviously already suspicious that it could be USB conflict. I don’t know what “turning off USB support in IDE” (as mentioned in original post) could mean other than to select USB Support None under tools. If I select that it works OK, I only tried selecting CDC to check/confirm that could ca...
by ozcar
Tue Feb 08, 2022 8:10 pm
Forum: General discussion
Topic: BlackPill STM32F411CE PA11 PA12 Digital Out Not Working
Replies: 3
Views: 2326

Re: BlackPill STM32F411CE PA11 PA12 Digital Out Not Working

My first thought was to ask what core you are using, but from your other thread it seems you are using the official ST core. It will make your code easier to view and copy if you use the code tag. I took your code and tried it on one of those Black Pill F411 boards. This was using IDE 1.8.18 and ST ...
by ozcar
Sun Feb 06, 2022 3:56 am
Forum: Libraries & Hardware
Topic: FASTLED STM32 doesnt compile
Replies: 1
Views: 5098

Re: FASTLED STM32 doesnt compile

It is not obvious to me that FastLED supports stm32duino. The README (for 3.5.0) has no mention of STM32, although is does say that “Maple” may be supported in future (something of a strange thing to be saying in 2022). However, release_notes does mention STM32, eg “improved support” for STM32 in re...

Go to advanced search