Search found 33 matches

by dannyf
Sat Jan 23, 2021 12:04 am
Forum: Other
Topic: STM8
Replies: 12
Views: 2194

Re: STM8

i'm a big fan of those little beasts: stm8s003 and stm32f030. but the 8s has limited utility as an arduino clone - as the space is quite limited, especially if you compile with a free compiler. under iar, they work wonders.
by dannyf
Wed Jan 06, 2021 12:47 am
Forum: General discussion
Topic: Compensate for LSE error
Replies: 10
Views: 557

Re: Compensate for LSE error

i would first make sure that the hardware works - the right crystal is used, and the LSE oscillates in run mode correctly, ... I would then try to find out if the code is wrong -> it would be unthinkable if this is a (chip) hardware problem. all else fails, I would try to correct the problem. the si...
by dannyf
Fri Dec 25, 2020 2:18 am
Forum: General discussion
Topic: Compensate for LSE error
Replies: 10
Views: 557

Re: Compensate for LSE error

unless you are using something truly bad, those crystals are spec'd to 20ppm and usually within 5ppm. so 5% is a little extraordinary. I would first verify the cause. if it is indeed in the crystal, the hardware does allow LSE compensation - look to the reference manual. but unlikely to the extent o...
by dannyf
Fri Nov 27, 2020 11:53 pm
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 1574

Re: incorrect micros() value for stm32f411re

stm32f1
those chips have DWT and you can get timing resolution down to ns -> at 72Mhz, you get 13.9ns
by dannyf
Thu Nov 26, 2020 9:00 pm
Forum: STM8 Core
Topic: How to use Interrupts on STM8 with sduino
Replies: 3
Views: 1514

Re: How to use Interrupts on STM8 with sduino

GPIO_Init (an STM8-specific API function) to actually enable interrupts for a particular pin.
or you can set the CR2 bits. CR1 bits enable pull-up.
by dannyf
Thu Nov 26, 2020 8:53 pm
Forum: General discussion
Topic: how to PWM Frequency stm32duino and resolution
Replies: 10
Views: 7058

Re: how to PWM Frequency stm32duino and resolution

I know all the registers to use, I get bit arithmetics, but what is the syntax?
it might be simpler to just check the 1k-page reference manual. most of those bits are in CCER but there should be a section on the right bits for all of that.

beats out going through the HAL functions.
by dannyf
Thu Nov 26, 2020 12:52 am
Forum: Ideas & suggestions
Topic: Bare metal STM32 programming
Replies: 23
Views: 6783

Re: Bare metal STM32 programming

Bare Metal is the closest you can get to the processor,
you can always code assembly. or even hand-generate binary.
A potential problem about Bare Metal is how portable your code will be.
I usually code to cmsis. it has the most portability.
by dannyf
Thu Nov 26, 2020 12:48 am
Forum: General discussion
Topic: incorrect micros() value for stm32f411re
Replies: 18
Views: 1574

Re: incorrect micros() value for stm32f411re

result
you will notice that your reading changes a little bit, partly because of the sequence of reading the timer can differ based on if you are trying to read the leading edge or the trailing edge.

one way to do that is to always read the timer first in the isr
by dannyf
Mon Sep 21, 2020 12:15 am
Forum: General discussion
Topic: analogRead showing a digital behaviour
Replies: 6
Views: 906

Re: analogRead showing a digital behaviour

analogwrite() produces a digital output whose duty cycle carries the analog information.

what you observed is expected.
by dannyf
Sat Sep 19, 2020 5:55 pm
Forum: Ideas & suggestions
Topic: Bare metal STM32 programming
Replies: 23
Views: 6783

Re: Bare metal STM32 programming

most of the code you find will be developed against CMSIS and a set of vendor header files. so I would encourage you to at least try to align there.

Go to advanced search