Search found 447 matches

by dannyf
Wed Oct 25, 2023 9:42 pm
Forum: General discussion
Topic: Speed Up your IO !!
Replies: 16
Views: 5621

Re: Speed Up your IO !!

18MHz signal.
Fast IO is implemented via BRR/BSRR.

Hard to imagine that they could get that fast.
by dannyf
Wed Oct 25, 2023 4:15 pm
Forum: General discussion
Topic: Speed Up your IO !!
Replies: 16
Views: 5621

Re: Speed Up your IO !!

the macros I provided earlier are for generic applications -> it can even take variable ports or bits. for fixed ports / bits, you can speed up the speed significantly by precalculating the alliasing address and operate on that address. This will require minor changes to the set of macros I provided...
by dannyf
Wed Oct 25, 2023 12:26 am
Forum: General discussion
Topic: Speed Up your IO !!
Replies: 16
Views: 5621

Re: Speed Up your IO !!

those numbers probably explain why bit-banding is rarely mentioned in the datasheets of modern CMx chips.
by dannyf
Wed Oct 25, 2023 12:25 am
Forum: General discussion
Topic: Speed Up your IO !!
Replies: 16
Views: 5621

Re: Speed Up your IO !!

well, some numbers: Keil MDK, -Odefault, STM32F103 first, using BSRR/BRR: 6.7K ticks/1K run //fast routines through BRR/BSRR registers #define FIO_SET(port, pins) port->BSRR = (pins) #define FIO_CLR(port, pins) port->BRR = (pins) #define FIO_FLP(port, pins) (IO_GET(port, pins)?FIO_CLR(port, pins):FI...
by dannyf
Tue Oct 24, 2023 9:59 pm
Forum: General discussion
Topic: Speed Up your IO !!
Replies: 16
Views: 5621

Re: Speed Up your IO !!

I remember using bit banding on luminary LM3S and TI LM4F chips. Based on my benchmarking then they aren't faster than BRR and BSRR. The better approach I think is the implementation of SET, CLR and INV registers on pic32. Bit banding is optional for CM0 I think. I have never seen a cM0 chip with bi...
by dannyf
Tue Oct 24, 2023 12:09 am
Forum: General discussion
Topic: Speed Up your IO !!
Replies: 16
Views: 5621

Re: Speed Up your IO !!

but how mutch slow? 1. the issue here isn't nearly as much HAL. but more in the arduino implementation. I have written quite extensively about this, but in general, the arduino implementation is 20x to 50x slower than the direct register access. 2. your particular implementation isn't optimal: you ...
by dannyf
Sat Oct 21, 2023 5:54 pm
Forum: General discussion
Topic: STM32G030F6P6 Backup Registers
Replies: 10
Views: 18744

Re: STM32G030F6P6 Backup Registers

Our codes are identical. In my case, I used this to initialize BKP0R in setup(): //tamper / backup registers bkpInit(); //reset the tamper if (bkp0Get()==0) bkp0Set(1); //reset backup register - only during the first wrong and I incremented theh value in BKP0R and I could watch it continued to incre...
by dannyf
Sat Oct 21, 2023 5:52 pm
Forum: General discussion
Topic: STM32G030F6P6 Backup Registers
Replies: 10
Views: 18744

Re: STM32G030F6P6 Backup Registers

I can confirm that it works as well on my G0: //unlock the domain //on some chips, it requires a set of magic numbers #define bkpUnlock() do {PWR->CR1 |= PWR_CR1_DBP;} while (!(PWR->CR1 & PWR_CR1_DBP)) //1->enable write assess, 0->disable write assess #define bkpLock() do {PWR->CR1 &=~PWR_CR...
by dannyf
Sat Oct 21, 2023 2:58 pm
Forum: General discussion
Topic: STM32G030F6P6 Backup Registers
Replies: 10
Views: 18744

Re: STM32G030F6P6 Backup Registers

I think you are right, re. the datasheet mentioning it in the RTC chapter.

the reference manual mentions none of that in the RTC chapter. However, it mentions those backup registers (all 5 of them), in the TAMPER chapter :)

doesn't sound that difficult to write your own code for it.
by dannyf
Fri Oct 20, 2023 8:38 pm
Forum: General discussion
Topic: STM32G030F6P6 Backup Registers
Replies: 10
Views: 18744

Re: STM32G030F6P6 Backup Registers

does the functionality (=backup data registers) even exist on the G0?

Go to advanced search