Search found 25 matches

by julian_lpp
Sat Mar 22, 2025 11:30 pm
Forum: General discussion
Topic: Migration - need more GPIO
Replies: 3
Views: 445

Migration - need more GPIO

I'm in the needing of migrating to a UC that provides more timers and GPIO. In this case I dont need more math power/clock freq , etc

I'd like to know if the code that is working in the low enty point F103 series is directly compilable in F103 higher performance line chips
For instance, coming from ...
by julian_lpp
Tue Mar 18, 2025 5:37 pm
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop

Just added SetPixelColor as to let modify each led individually....
Tested with RGBW (dont have now rgb neopixels)

regards, julian


#include <Arduino.h>
#include <HardwareTimer.h>

//con o sin white
#define ES_RGBW 1
#define LED_COUNT 7


#if ES_RGBW == 1
#define BITS_PER_LED 32
uint8_t leds ...
by julian_lpp
Tue Mar 18, 2025 3:22 pm
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop


It was generating pulses, but the whole timing was way out - pulses were like 25ms or 50ms! Maybe the prescaler was wrong


Pros and cons of libraries (and not reading carefully the documentation) vs direct registry config, so when I wrote:

timer.setPrescaleFactor(0); // No prescaler (72MHz ...
by julian_lpp
Tue Mar 18, 2025 3:12 pm
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop

Hey ozcar it works like a charm! :P

I'll carefully be reading line by line as to know where I was wrong with my original attempt. The extra dummy "0" cycles are very apropiate. I had been trying with one extra cycle as a reset pulse as well (with no luck)

Thank you for your time
regards
julian
by julian_lpp
Tue Mar 18, 2025 5:15 am
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop

ozcar wrote: Mon Mar 17, 2025 8:46 am Is ES_RGBW equal to 1 supposed to mean that you do have RGBW LEDs, or maybe that you do not have RGBW?
yes, ES_RGBW == 1 means "the neopixels have White led"
by julian_lpp
Tue Mar 18, 2025 5:13 am
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop

oscar,
I've done a lot and lot of tests without any signigicant progress, but i'm using a tft display to get the debug messages so I've to clean the code to post it here to let someone (like you've been doing) can keep an eye of it. Something very wrong i'm doing that something almost simple as ...
by julian_lpp
Sun Mar 16, 2025 10:38 pm
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop

i've managed to write some code to start playing with tmr+dma (gpt help)
I uploaded the binary but nothing happens, would need confirmation wheter there are pwm signal on PB6 or not
I'm using timer 4 which is the only one available in my original project

#include <Arduino.h>
#include ...
by julian_lpp
Sun Mar 16, 2025 3:11 pm
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop

ozcar wrote: Sat Mar 15, 2025 9:58 pm For the same alternating 01010101... pattern, with target times of 400ns and 800ns, and using a timer running at the maximum rate of 72MHz on F103, I get:

Code: Select all

400 804 402 804 402 804 402 804 ... 
:shock:
almost perfect
by julian_lpp
Sun Mar 16, 2025 3:10 pm
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop

well, I'll start investigating about DMA and Timer combination, maybe with gpt help to speed it up, given that never looked into dma stuff, hardly imagine what it is, but need to figure out exacly how it works, how to configure a timer to start reading a buffer and increment its index, the way and ...
by julian_lpp
Sat Mar 15, 2025 1:27 pm
Forum: General discussion
Topic: PWM and code in the main loop
Replies: 30
Views: 3319

Re: PWM and code in the main loop



I found it was possible to use a timer (assuming available to use), like a normal PWM generator, but with no interrupt or DMA to set the pulse times, instead just doing it in the code with something like:

while( !(TIMx->SR & TIM_SR_UIF) ); // wait for update event
(set CCR for next pulse time ...

Go to advanced search