Page 1 of 1

PWM support

Posted: Fri Sep 08, 2017 6:19 pm
by dimitry
VoCore2 spec sheet shows that it has 4 PWM pin. Is there any documentation on how to use them?

Re: PWM support

Posted: Sat Sep 09, 2017 1:30 am
by Vonger
You can check the datasheet part of the PWM, and use command mem(at bottom of vocore.io/v2) directly control the register.

Re: PWM support

Posted: Sat Sep 09, 2017 8:04 pm
by dimitry
Thanks Vonger. Could you please let me know if my understanding is correct?

To enable 4 PWM outputs I would do this:
Code: Select all
# UART1_MODE = 2 (PWM ch0/1)
# UART2_MODE = 2 (PWM ch2/3)
# PWM0_MODE = 0 (PWM ch0)
# PWM1_MODE = 0 (PWM ch1)
# SPIS_MODE = 3 (PWM ch0/1 & UART2)
mem 0x10000060 0x0a05040c

The spec sheet says on page 30 to also set EPHY_APGIO_AIO_EN[4:1] but I can't find what it is... I am guessing they meant EPHY_GPIO_AIO_EN instead?... So I would do:
Code: Select all
# EPHY_GPIO_AIO_EN = 15
mem 0x1000003C 0x001f001f

Does that look correct?

Next, when it comes to controlling the PWMs I get lost.

PWM_ENABLE:
- Makes sense.

PWM0_CON:
- What's New PWM mode vs Old PWM mode?
- What's stop bit position and FIFO mode?
- What's guard time?

PWM0_LDURATION / PWM0_HDURATION:
- Set low/high duty cycle, right?

PWM0_SEND_DATA0 / PWM_SEND_DATA1:
- What do they do? (FIFO mode again)

PWM0_WAVE_NUM:
- Set how many cycles to generate, right? (0 = forever)

PWM0_DATA_WIDTH:
- What's it do?

PWM0_THRESH:
- What's it do?

PWM0_SEND_WAVENUM:
- Shows how many cycle were generated so far? (Set in PWM0_WAVE_NUM)

Does anybody have any data on the above?

Re: PWM support

Posted: Sun Jan 07, 2018 2:41 pm
by MikeXu007
could it be use to control spi signal led lights?
as the ws2813b or the sk6812 led chips,