Skip to content

Add support for complimentary channel output and deadtime. #900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2014

Conversation

dhylands
Copy link
Contributor

This patch enables output on the complimentary channels (TIMx_CHyN).
Timers 1 and 8 have complimentary channels available (on the pyboard, for timer 1, only complimentary channels are available).

When available (Timers 1 and 8, Channels 1-3) deadtime can also be inserted when the channels
transition. For the pyboard, TIM8_CH1/CH1N and TIM8_CH2/CH2N can
take advantage of this.

Using deadtime is extremely useful when you're using the complimentary channnels to directly drive the top and bottom halves of an H-Bridge. The deadtime allows both the top and bottom to be inactive when transittioning. Otherwise you wind up with short periods of time when Vcc is shorted to ground (while the MOFETs are switching).

@@ -822,9 +898,13 @@ STATIC mp_obj_t pyb_timer_channel(mp_uint_t n_args, const mp_obj_t *pos_args, mp
oc_config.Pulse = args[5].u_int;
oc_config.OCPolarity = args[6].u_int;
if (oc_config.OCPolarity == 0xffffffff) {
oc_config.OCPolarity = TIM_OCPOLARITY_HIGH;
oc_config.OCPolarity = TIM_OCPOLARITY_HIGH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops: missing semicolon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah - I have to figure out how to turn off the damn tapping on my touchpad. I've already unchecked tap-to-click, but I still get taps. So I'll be typing along in one window and then all of a sudden I'm unknowngly typing in another. Sigh.

This patch enables output on the complimentary channels (TIMx_CHyN).
For timers 1 and 8, deadtime can also be inserted when the channels
transition. For the pyboard, TIM8_CH1/CH1N and TIM8_CH2/CH2N can
take advantage of this.
@dhylands
Copy link
Contributor Author

Fixed missing semicolon (I'm sticking to my touchpad story). Fixed spelling mistake.

dpgeorge added a commit that referenced this pull request Oct 11, 2014
Add support for complimentary channel output and deadtime.
@dpgeorge dpgeorge merged commit 1ce916a into micropython:master Oct 11, 2014
@dhylands dhylands deleted the comp-deadtime branch November 8, 2015 02:41
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Jun 8, 2018
.. setting it based on the ad-hoc stack pointer calculation of
mp_stack_ctrl_init() meant that the stack used above main() counts
against the 1KiB safety factor that the mp_stack_set_limit call tries
to establish.  It turns out, at least on M4, that over half of the
safety factor is used up by stack-above-main()!

In the case of the basics/gen_stack_overflow.py test,
which blows the stack on purpose, it turns out that gc would be called
while handling the "maximum recursion depth exceeded" error, and this
needed more stack than was left.

Closes: micropython#900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants