Search found 29 matches

by nmz787
Mon Mar 20, 2017 6:31 am
Forum: Other Boards
Topic: How can I increase the callback priority/importance on my Timer? (STM32F401)
Replies: 12
Views: 4408

Re: How can I increase the callback priority/importance on my Timer? (STM32F401)

another odd issue with that code, is that the board locks up if I try to set the default period to something small, like 100 This is odd especially because if I start the board with higher period and width settings, then adjust things later, with the adjust_tim1 function, it works to decrease things...
by nmz787
Mon Mar 20, 2017 6:27 am
Forum: Other Boards
Topic: How can I increase the callback priority/importance on my Timer? (STM32F401)
Replies: 12
Views: 4408

How can I increase the callback priority/importance on my Timer? (STM32F401)

I have an STM32F401RET6 (on a G30Th dev board) that I've programmed TIM1 with one pulse mode (OPM), and have enabled n-pulse mode by setting a number of pulses to the repetition count register (RCR). I also attach a callback (interrupt function) to the Timer object at creation time, and by using OPM...
by nmz787
Thu Mar 02, 2017 9:49 am
Forum: General Discussion and Questions
Topic: Enabling a timer PWM channels in-sync
Replies: 5
Views: 2200

Re: Enabling a timer PWM channels in-sync

Ok, I think I got it working... I need to really clean things up, but here's what I've got as of now, and it seems glitch-free for startup and shutdown, as well as for adjusting the pulse width and period. https://gist.github.com/nmz787/edd964e9f06ade61de75fbc38bee9b8e Basically, TIM1 starts TIM2, T...
by nmz787
Wed Mar 01, 2017 9:37 pm
Forum: General Discussion and Questions
Topic: Enabling a timer PWM channels in-sync
Replies: 5
Views: 2200

Re: Enabling a timer PWM channels in-sync

P.S. The problem with using PWM_INVERTED is that I actually care about the positive portions, while using INVERTED means the logic sees the pulse is actually "period - pulse_width"... but the portion I use is the wing/edge of this... so when I stop the timers, the last 'useful to me pulse' is cut in...
by nmz787
Wed Mar 01, 2017 9:29 pm
Forum: General Discussion and Questions
Topic: Enabling a timer PWM channels in-sync
Replies: 5
Views: 2200

Re: Enabling a timer PWM channels in-sync

Does anyone around here take bounties? :? I spent another night trying things with no phenomenal progress. Hopefully it doesn't take too many more of these kind of nights. By out of phase, imagine a PWM pulse train (of constant period and pulse-width), then add the requirement that every-other pulse...
by nmz787
Tue Feb 28, 2017 8:56 pm
Forum: General Discussion and Questions
Topic: Enabling a timer PWM channels in-sync
Replies: 5
Views: 2200

Re: Enabling a timer PWM channels in-sync

What I really want to do is enable two PWM channels which are exactly 180 degrees out of phase.

Here is an example image from the previously-posted (glitch-prone) code:
https://cibolo.us/pipermail/open_electr ... t-0009.png
by nmz787
Tue Feb 28, 2017 10:10 am
Forum: General Discussion and Questions
Topic: Enabling a timer PWM channels in-sync
Replies: 5
Views: 2200

Enabling a timer PWM channels in-sync

In another post, I read about synchronizing timer channels should not be an issue, but I see if I have slow operations in between channel instantiation (i.e. a print statement), I can see the first channel toggling twice for example. My guess is a solution as indicated in this post might help, i.e. ...
by nmz787
Sun Aug 07, 2016 1:39 am
Forum: General Discussion and Questions
Topic: pyb.Timer() and pyb.Timer.channel() syntax
Replies: 5
Views: 2131

Re: pyb.Timer() and pyb.Timer.channel() syntax

jgriessen wrote:Here's my latest code
Still has invalid variable name:

Code: Select all

xfmr_pulse_pos_half-cycle = 1
by nmz787
Thu Jul 28, 2016 9:46 am
Forum: General Discussion and Questions
Topic: Bitwise Assignment Operator
Replies: 22
Views: 9043

Re: Bitwise Assignment Operator

Can I use the syntax examples in this thread to toggle entire port of GPIO pins (I am really interested in toggling two GPIO pins simultaneously)? Now a different question: I am guessing if I needed very precise timing between two pins toggles, I'd need to code some inline-ASM NOPs? (if I wanted to ...
by nmz787
Fri Jul 15, 2016 8:28 am
Forum: Other Boards
Topic: Q: Nucleo F401 with UART bootloader
Replies: 37
Views: 12938

Re: Q: Nucleo F401 with UART bootloader

Hmm, strangest thing I am seeing now is that main.py is running even though I don't import it in boot.py (it is commented out)... oh well, not such a big deal as not being able to upload files or make edits easily.