Search found 1626 matches

by Pito
Sun Nov 26, 2017 1:44 pm
Forum: STM Nucleo boards
Topic: How to change the clock speed of STM32L476RG nucleo board?
Replies: 16
Views: 311

Re: How to change the clock speed of STM32L476RG nucleo board?

Here http://www.stm32duino.com/viewtopic.php?f=18&t=2888&p=37578#p37593 you may see a for-loop takes 417ns with toggling 1/0 (BRR/BSRR registers) at 72MHz, that is 2.39MHz toggling freq.. In order to maximize your io pin frequency you must "unroll the loop". void loop() { // put your main code here,...
by Pito
Sun Nov 26, 2017 1:18 pm
Forum: Code snipplets
Topic: Fast bitbanding gpio/sram access
Replies: 22
Views: 383

Re: Fast bitbanding gpio/sram access

Here under our core: //port/gpio oriented macros #define IO_SET(port, pins) port->regs->ODR |= (pins) //set bits on port #define IO_CLR(port, pins) port->regs->ODR &=~(pins) //clear bits on port //fast routines through BRR/BSRR registers #define FIO_SET(port, pins) port->regs->BSRR = (pins) #define ...
by Pito
Sun Nov 26, 2017 11:21 am
Forum: General discussion
Topic: Reducing Bluepill flash memory usage
Replies: 14
Views: 364

Re: Reducing Bluepill flash memory usage

pito: My understanding is that the BluePill is 64k flash. That's what I have selected in the IDE. STM32F103C8T6 data states it has 64k of flash. Yes, your understanding is correct, according to the datasheet the BluePill's C8 is 64kB. In reality it is 128kB. That is like "the Sum of n from n=1 to i...
by Pito
Sun Nov 26, 2017 9:28 am
Forum: General discussion
Topic: Reducing Bluepill flash memory usage
Replies: 14
Views: 364

Re: Reducing Bluepill flash memory usage

BluePill has got 128kB of flash.
by Pito
Sun Nov 26, 2017 9:12 am
Forum: Code snipplets
Topic: Fast bitbanding gpio/sram access
Replies: 22
Views: 383

Re: Fast bitbanding gpio/sram access

1mil for-loops switching pin 1/0 with: digitalWrite 1517ms (591ns/Write) DIGITAL_WRITE 570ms (118ns/WRITE) 1mil for-loops reading pin with: digitalRead 974ms (640ns/Read) DIGITAL_READ 584ms (250ns/READ) Empty for-loop 334ms. BPill, 72MHz, default opt., Roger's core. #include "Arduino.h" #define BITB...
by Pito
Sat Nov 25, 2017 6:19 pm
Forum: General discussion
Topic: OverClock. at Runtime ~90MHz
Replies: 32
Views: 684

Re: OverClock. at Runtime ~90MHz

Did you notice if the USB stops working if you switch to 96 MHz for a short time ?
I did not use the usb while messing with switching the cpuclock under forth..
by Pito
Fri Nov 24, 2017 7:39 pm
Forum: General discussion
Topic: OverClock. at Runtime ~90MHz
Replies: 32
Views: 684

Re: OverClock. at Runtime ~90MHz

Add the 38kHz CPU clock setting and you may run the complete BluePill at 38kHz while taking maybe 20uA of current. Except USB and uart (or do 300baud?) everything will work as usual. .. set_clock(128000, 460800); // do math, send/receive big data.. set_clock(38, 300); // scan sensors, buttons, write...
by Pito
Fri Nov 24, 2017 6:29 pm
Forum: Code snipplets
Topic: Dual LFO with choice of waveforms using PT8211 and Blue Pill
Replies: 22
Views: 586

Re: Dual LFO with choice of waveforms using PT8211 and Blue Pill

An RC is called "integrative circuit (low-pass)", RC wired as CR is called "derivative circuit (high-pass)". When you integrate or differentiate a sine/cosine signal you will get the same signal shape (math). With input signal as below the RC will "round the edges", while the CR will pass the fast c...
by Pito
Fri Nov 24, 2017 5:28 pm
Forum: General discussion
Topic: OverClock. at Runtime ~90MHz
Replies: 32
Views: 684

Re: OverClock. at Runtime ~90MHz

Uh, wich core? Arduino_STM32 doesn't have any set_cpu_clk, set_ticks or set_baudrate.
All cores we have got include routines/functions/methods for setting up the CPU clock, SysTick reload value and Uart Baudrate settings..
by Pito
Fri Nov 24, 2017 12:25 pm
Forum: General discussion
Topic: OverClock. at Runtime ~90MHz
Replies: 32
Views: 684

Re: OverClock. at Runtime ~90MHz

Look for files like

Code: Select all

rcc.c
systick.c 
usart.c 
in ..\STM32F1\cores\maple\libmaple

and in ..\STM32F1\variants\generic_stm32f103c\wirish

Code: Select all

boards.cpp
boards_setup.cpp
and use the functions which init the stuff..