great video! you actually got me hooked for the whole 42 minutes. i was looking for how to speed up moving a framebuffer to a display through the gpio pins, this gave me a lot of pointers
I recently uploaded a video making a RF transmission in 1.6 MHz only with the PWM of an arduino nano and a cable, just for fun I programmed the mariobros music in PWM, I made a very quiet video of this on my channel. With the BluePill I see that I can continue transmitting RF but now in 31MHz thanks to your video, very good explanation! greetings from far away.
Technically you have a very jittery output that is 50% most of the time and now and then jitters as it takes a long branching break. Depending on your application this may be disaster. I'd just use the clock peripheral and let it do the pulsing. Also, make sure to set the pin driver speed or you may be left with slow flanks on the pin. The most powerfull thing about the STM series of microcontrollers is their good peripherals and you can get them to do a LOT of the work for you, even for outputting very weird sequences of bits at a very high speed. Timers, and DMA are your friends here as well as the internal loopback peripherals allowing you to control the datarate of the DMA instead of doing pure mem-2-mem transfers. Have fun!
I implemented this on my Nucleo-G431 and I had the same dramatic increase in speed. However, then I checked my optimization settings and it was set to -O0 i.e no optimization. After changing this to -Os then I got equally fast toggling with GPIOA->BSRR = PA9_Pin; as with assembly code.
great video! you actually got me hooked for the whole 42 minutes.
i was looking for how to speed up moving a framebuffer to a display through the gpio pins, this gave me a lot of pointers
I recently uploaded a video making a RF transmission in 1.6 MHz only with the PWM of an arduino nano and a cable, just for fun I programmed the mariobros music in PWM, I made a very quiet video of this on my channel. With the BluePill I see that I can continue transmitting RF but now in 31MHz thanks to your video, very good explanation! greetings from far away.
You sir, has gained a new subscriber through this video! Awesome content.
Underrated and very informative video!
Great example of why we have a need for much faster processors. Imagine of our os's and programs were done in assy
You good man .......group your videos into the playlist for better access by users.
Love your videos man!
Nice video, very informative.
Technically you have a very jittery output that is 50% most of the time and now and then jitters as it takes a long branching break.
Depending on your application this may be disaster.
I'd just use the clock peripheral and let it do the pulsing. Also, make sure to set the pin driver speed or you may be left with slow flanks on the pin.
The most powerfull thing about the STM series of microcontrollers is their good peripherals and you can get them to do a LOT of the work for you, even for outputting very weird sequences of bits at a very high speed. Timers, and DMA are your friends here as well as the internal loopback peripherals allowing you to control the datarate of the DMA instead of doing pure mem-2-mem transfers. Have fun!
I implemented this on my Nucleo-G431 and I had the same dramatic increase in speed. However, then I checked my optimization settings and it was set to -O0 i.e no optimization. After changing this to -Os then I got equally fast toggling with GPIOA->BSRR = PA9_Pin; as with assembly code.
Preach. I like arduino bit getting down to register level is a great experience
I would actually trust your compiler if you have the right settings to produce the same quality as hand written assembly
for ULTIMATE speed go bare metal
Interesting stuff, I would like to see this output on a scope !...cheers.
..compared loop count /sec between stm32 , uno & esp8266..,..I got uno ~= 230000 counts , stm32 ~= 600000 counts, esp8266~=170000..love testing this afforable boards
long lastMillis = 0;
long loops = 0;
void setup(){
Serial.begin(9600); // Serial1.begin(9600); on STM32
}
void loop(){
long currentMillis = millis();
loops++;
if(currentMillis - lastMillis > 1000){
Serial.print("Loops / second :");
Serial.println(loops);
lastMillis = currentMillis;
loops = 0;
}
}
OMG this video
5