Search found 231 matches

by dannyf
Sat Feb 24, 2018 12:17 pm
Forum: Code snipplets
Topic: 32-bit timers
Replies: 15
Views: 732

Re: 32-bit timers

The cost is that it slows things down a little (10-15%?) when you enable it.
i have never experienced it slowing down anything. it is a hardware counter that's always there, with no cpu involvement in its operations. so hard to imagine a reason that it would slow down the rest of the chip.
by dannyf
Fri Feb 23, 2018 9:53 pm
Forum: Projects
Topic: LSE RTC calibration
Replies: 15
Views: 274

Re: LSE RTC calibration

Code: Select all

how the ADC library function readTemp() is supposed to be used.
alternatively, you can just use a regular adc channel on a resistor + diodes (or a transistor amplifier for more sensitivity).
by dannyf
Fri Feb 23, 2018 9:51 pm
Forum: Projects
Topic: LSE RTC calibration
Replies: 15
Views: 274

Re: LSE RTC calibration

would it be simpler if you just wrap a ptc heater onto the crystal?
by dannyf
Fri Feb 16, 2018 8:41 pm
Forum: STM Nucleo boards
Topic: How to generate 100khz pwm frequency on STM32L476 Nucleo board
Replies: 5
Views: 210

Re: How to generate 100khz pwm frequency on STM32L476 Nucleo board

easy: 1) set the timebase, with a top/prescaler pair set to deliver your frequency; 2) put the output compare / pwm mode to your desired duty cycle. 3) sit back and enjoy. my code would look something like this: pwm1_init(TMR_PS8x, F_CPU / F_PWM / 8); //set pwm to generate F_PWM pwm1_setdc2(pwm_dc);...
by dannyf
Tue Feb 13, 2018 12:00 pm
Forum: General discussion
Topic: Access the PC register through ST-Link V2?
Replies: 11
Views: 245

Re: Access the PC register through ST-Link V2?

Getting your debugger to work, or ro use uart or a display is much more efficient.

The chip has extensive built in debug capabilities.
by dannyf
Mon Feb 12, 2018 11:08 pm
Forum: General discussion
Topic: Access the PC register through ST-Link V2?
Replies: 11
Views: 245

Re: Access the PC register through ST-Link V2?

Why couldn't you just step through the code?
by dannyf
Mon Feb 12, 2018 1:25 am
Forum: General discussion
Topic: Timer "One-Pulse" mode
Replies: 14
Views: 311

Re: Timer "One-Pulse" mode

Would not be better to regulate the power by switching on/off at zero crossing? I mean by counting sine periods (like 100 periods = 1kW, 1 period = 10W)..
an interesting concept. I haven't seen people trying it however. I can see it being quite useful when emi is of paramount concern.
by dannyf
Sun Feb 11, 2018 2:18 pm
Forum: General discussion
Topic: Timer "One-Pulse" mode
Replies: 14
Views: 311

Re: Timer "One-Pulse" mode

btw, the reason to set the compare value to 1 (or 0 if possible) is so the OC fires right away.
by dannyf
Sun Feb 11, 2018 2:16 pm
Forum: General discussion
Topic: Timer "One-Pulse" mode
Replies: 14
Views: 311

Re: Timer "One-Pulse" mode

it probably doesn't need to be that elaborate. I would do it this way, assuming you want pam: 1) initialize the timer into one pulse mode, and interrupt at the top. 2) set up the compare to be 1 (or 0 if it works), and the top to be a value designed for the right amount of power; 3) in the isr, zero...
by dannyf
Sun Feb 11, 2018 12:47 am
Forum: STM32F103 Boards
Topic: Driving LED dim/glow using PWM pins and MOSFET
Replies: 15
Views: 836

Re: Driving LED dim/glow using PWM pins and MOSFET

As there are only 4 timers on he F103C, you will only be able to output 4 unique PWM values The chip itself is much more powerful than that. I don't have a datasheet handy but tim1..5 eagh has 4 channels. And others with 1 to 2 channels as well. Tim6 and 7 no channels. So take a look at the datashe...