Search found 447 matches

by dannyf
Mon Feb 19, 2024 4:01 pm
Forum: General discussion
Topic: Properly handling timer overflow ?
Replies: 6
Views: 599

Re: Properly handling timer overflow ?

My somewhat poorly commented/structured code below Impossible to follow. I think you are trying to configure TIM1 to over flow at 8049, and then set output compare to trigger at 1 - not sure why. maybe you can help more by stating what you are trying to do - invoking DoPid() periodically? your code...
by dannyf
Mon Feb 19, 2024 3:50 pm
Forum: General discussion
Topic: How to access low level registers or How to set TIM1 to 128Mhz
Replies: 10
Views: 1655

Re: How to access low level registers or How to set TIM1 to 128Mhz

if you need 128Mhz PWM, there is something wrong with your solution, or the application of this MCU in your solution. In that case, it is much helpful for you to say "here is a problem I want to solve. what would you suggest as a solution?" if you indeed need 128Mhz PWM (for whatever reaso...
by dannyf
Sat Jan 20, 2024 4:08 pm
Forum: General discussion
Topic: Using interrupts to extend a 32-bit timer to 64 bits and a pitfall to avoid
Replies: 2
Views: 1743

Re: Using interrupts to extend a 32-bit timer to 64 bits and a pitfall to avoid

you got that right. a double-read is a must here. a few other ways to get this working: 1. using a struct + union so you can read / write individual 32-bit pieces without shifting. 2. using pointers to the write to / read from the individual 32-bit pieces as well. the code will be endian-dependent, ...
by dannyf
Mon Jan 15, 2024 9:35 pm
Forum: General discussion
Topic: Seek assist-Arduino GIGA R1 (STM32H7) RTC usage
Replies: 7
Views: 1192

Re: Seek assist-Arduino GIGA R1 (STM32H7) RTC usage

did a quick scan of the reference manual. Some unique aspects of this chip: 1. rtc clocks can only be selected once. Need to reset BDCR for each clock change. 2. rtc clock cannot be changed if LSECSSON bit is on. 3. didn't find PWR block clock enable -> didn't look too hard either. the basic flow is...
by dannyf
Mon Jan 15, 2024 6:42 pm
Forum: General discussion
Topic: Seek assist-Arduino GIGA R1 (STM32H7) RTC usage
Replies: 7
Views: 1192

Re: Seek assist-Arduino GIGA R1 (STM32H7) RTC usage

maybe you can go through the reference manual to see how to enable the rtc. generally BDCR is write-protected and you have to do something special to change its default values.
by dannyf
Wed Dec 06, 2023 4:45 pm
Forum: General discussion
Topic: STM32G030F6P6 Backup Registers
Replies: 10
Views: 14195

Re: STM32G030F6P6 Backup Registers

I can also confirm that the STM32 F 030 has backup registers, in the RTC domain. i can see values stored there persist from reset to reset. An undocumented feature as it is not in the datasheet. I posted a write-up on that here: https://dannyelectronics.wordpress.com/2023/12/06/stm32f030-backup-regi...
by dannyf
Wed Nov 08, 2023 2:43 pm
Forum: General discussion
Topic: What is the fastest way to change pin mode from INPUT_PULLUP to OUTPUT and back
Replies: 3
Views: 3337

Re: What is the fastest way to change pin mode from INPUT_PULLUP to OUTPUT and back

#define PB13toPU() do {REG_MOD(GPIOB->CRH, 0x08<<((13%8)*4), 0x0f<<((13%8)*4));} while (0) //set PB13 to INPUT_PULLUP 0b1000, ODR bit set separately #define PB13toPP() do {REG_MOD(GPIOB->CRH, 0x01<<((13%8)*4), 0x0f<<((13%8)*4));} while (0) //set PB13 to OUTPUT Pushpull 0b0001/0010/0011, ODR bit set...
by dannyf
Tue Nov 07, 2023 9:39 pm
Forum: General discussion
Topic: What is the fastest way to change pin mode from INPUT_PULLUP to OUTPUT and back
Replies: 3
Views: 3337

Re: What is the fastest way to change pin mode from INPUT_PULLUP to OUTPUT and back

The CNFx and MODEx bits do that. Check out the CRH...CRL registers.

A macro will be sufficient.
by dannyf
Mon Nov 06, 2023 12:00 pm
Forum: General discussion
Topic: new Blackpill STM32G431CBU6
Replies: 22
Views: 13626

Re: new Blackpill STM32G431CBU6

That means it is working. As the crystal is like a few mhz and your default oscillator likely runs at 10s of mhz.
by dannyf
Mon Nov 06, 2023 11:58 am
Forum: Off topic
Topic: Taking a look at STM32G0 series
Replies: 94
Views: 138173

Re: Taking a look at STM32G0 series

R1 turns a NOT gate into a high gain linear amplifier. It was one of the tricks during the cmos days.

You can also think of R1 plus stray capacitance to form a RC oscillator that gets the oscillator started.

Go to advanced search