Search found 97 matches

by dannyf
Fri Sep 15, 2017 12:51 pm
Forum: Code snipplets
Topic: GPIO registers and port manipulation
Replies: 15
Views: 6045

Re: GPIO registers and port manipulation

the CRL settings are just for current drive capabilities. the two measurements you got should be identical. the variation you saw is likely due to other factors and may go away if you run multiple trials. edit: as a test, I ran the following, to flip a pin using BSRR/BRR and tested speed for 1 milli...
by dannyf
Thu Sep 14, 2017 10:54 pm
Forum: General discussion
Topic: We have been infiltrated by Bots
Replies: 10
Views: 292

Re: We have been infiltrated by Bots

i'm wondering what the goal of those bots is.
most bots are run by the site owners, with the goal to increase traffic.
by dannyf
Thu Sep 14, 2017 10:15 am
Forum: General discussion
Topic: We have been infiltrated by Bots
Replies: 10
Views: 292

Re: We have been infiltrated by Bots

bots are fairly easy to spot: just look at those "posters" without follow-ups.
by dannyf
Mon Sep 11, 2017 11:16 am
Forum: General discussion
Topic: STM's New "Low Level" API in STM32Cube ??
Replies: 7
Views: 240

Re: STM's New "Low Level" API in STM32Cube ??

I never understood their love for constantly investing in different libraries. I'm a big fan of spl. It is reasonably structured, with workable documentation and a high degree of similarity from family to family. The bad rep they got on spl in my view is mostly from people who don't know how modern ...
by dannyf
Sat Sep 09, 2017 10:09 pm
Forum: General discussion
Topic: Translating Atmega Registers into STM32F1 SOS!
Replies: 2
Views: 85

Re: Translating Atmega Registers into STM32F1 SOS!

fairly easy. 1) take out the datasheet, set / clear the bits for each of the registers and figure out what the module is doing. looks like it is enabling input capture interrupt 1 -> so take a look at the associated isr; 2) then go to your target chip and see how you would enable input capture inter...
by dannyf
Sat Sep 09, 2017 1:01 pm
Forum: STM32F103 Boards
Topic: A board slightly different from the Blue Pill
Replies: 21
Views: 1772

Re: A board slightly different from the Blue Pill

the board seems to be quite easy to trace.

short of that, flip those pins to find out how it is connected.
by dannyf
Sat Sep 09, 2017 11:25 am
Forum: Code snipplets
Topic: 100 kHz PWM signal with complementary signal
Replies: 4
Views: 143

Re: 100 kHz PWM signal with complementary signal

rather than hardwire the period to 10, tie it to desired pwm frequency (F_PWM) and then the buss frequency (F_CPU or F_AHB or F_...).

then you have a piece of code that's much more generic.
by dannyf
Thu Sep 07, 2017 11:04 pm
Forum: General discussion
Topic: "Irregular" non-integer timer interrupt values (e.g. 22.67us/44.1khz)
Replies: 35
Views: 836

Re: "Irregular" non-integer timer interrupt values (e.g. 22.67us/44.1khz)

way to complicated for me. Go here https://github.com/dannyf00/Use-Output-Compare-Channels-as-Timers/tree/master/STM32F1 and take the appropriate files, say tmr2oc.h, if you are using TIM2. the code would be something like this: //TIM2_IRQHandler() needs to be changed by commenting out "TIMx->CCR1 +...
by dannyf
Thu Sep 07, 2017 7:55 pm
Forum: General discussion
Topic: "Irregular" non-integer timer interrupt values (e.g. 22.67us/44.1khz)
Replies: 35
Views: 836

Re: "Irregular" non-integer timer interrupt values (e.g. 22.67us/44.1khz)

Fairly easy.

1. Put the timer in output compare mode. Interrupt enabled.

2. Work out the math. For example, 22.67us is a combination of 1x 22us and 2x 23us.

3. In your isr, advance the output compare register by 22us, 23us, and 23us. And then back to 22us, ....

4. Done.
by dannyf
Wed Sep 06, 2017 9:12 pm
Forum: USB to Serial adaptors
Topic: Problem programming Blue Pill using an Arduino Mega
Replies: 14
Views: 268

Re: Blue Pill - Error trying to program

With the money you spend on a serial adapter you could have gotten a stlink, gaining debug capabilities and saving yourself a dollar or so.

I buy (avr) Arduino or stm32 Arduino boards to use avr or stm32 boards. Much more robust.