What is the "primary channel"?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
bittware
Posts: 45
Joined: Mon Aug 18, 2014 3:27 am

What is the "primary channel"?

Post by bittware » Fri Nov 23, 2018 3:47 am

Hi,
I'd like to use the 32-bit capture unit to log the timestamp of the event.
It seems that only TIM2 and TIM5 support 32-bit counter.
The docs say:
Timer(2) and Timer(3) are used for PWM to set the intensity of LED(3) and LED(4) respectively. But these timers are only configured for PWM if the intensity of the relevant LED is set to a value between 1 and 254. If the intensity feature of the LEDs is not used then these timers are free for general purpose use. Similarly, Timer(5) controls the servo driver, and Timer(6) is used for timed ADC/DAC reading/writing. It is recommended to use the other timers in your programs.
Because I don't care the LED intensity, Timer(2) looks promising to my application.
But most channels of Timer(2) are allocated to port A where I need for other purpose.
So only Timer(2) channel 3 (pin Y9) and channel 4 (pin Y10) could be used.
However, I read following statement in docs:
Note that capture only works on the primary channel, and not on the complimentary channels.
My question is what is the "primary channel"? (got no clue from the chip's manual)
Can I rely on the capture functionality brought by Timer(2) channel 3 (pin Y9) and channel 4 (pin Y10)?
Thanks for any comments.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: What is the "primary channel"?

Post by dhylands » Fri Nov 23, 2018 6:17 am

The channels which end on an N are complimentary channels (i.e. TIM1_CH1N) and the channels which don't end an N (i.e. TIM1_CH1) are the primary channels.

bittware
Posts: 45
Joined: Mon Aug 18, 2014 3:27 am

Re: What is the "primary channel"?

Post by bittware » Sun Nov 25, 2018 12:58 am

dhylands wrote:
Fri Nov 23, 2018 6:17 am
The channels which end on an N are complimentary channels (i.e. TIM1_CH1N) and the channels which don't end an N (i.e. TIM1_CH1) are the primary channels.
Thank you, dhylands.
Following the hint given, I found the below description in the manual regarding the Complementary pair definition.
17.3.11 Complementary outputs and dead-time insertion
The advanced-control timers (TIM1 and TIM8) can output two complementary signals and
manage the switching-off and the switching-on instants of the outputs.
This time is generally known as dead-time and it has to be adjust it depending on the
devices connected to the outputs and their characteristics (intrinsic delays of level-shifters,
delays due to power switches...)

Post Reply