PWM support

dimitry
 
Posts: 16
Joined: Thu Sep 07, 2017 7:57 pm

PWM support

Fri Sep 08, 2017 6:19 pm

VoCore2 spec sheet shows that it has 4 PWM pin. Is there any documentation on how to use them?

Vonger
 
Posts: 896
Joined: Sun Oct 19, 2014 6:00 am

Re: PWM support

Sat Sep 09, 2017 1:30 am

You can check the datasheet part of the PWM, and use command mem(at bottom of vocore.io/v2) directly control the register.

dimitry
 
Posts: 16
Joined: Thu Sep 07, 2017 7:57 pm

Re: PWM support

Sat Sep 09, 2017 8:04 pm

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?

MikeXu007
 
Posts: 1
Joined: Sat Jan 06, 2018 2:09 pm

Re: PWM support

Sun Jan 07, 2018 2:41 pm

could it be use to control spi signal led lights?
as the ws2813b or the sk6812 led chips,
sk6812 ws2813b dmx led strip

Return to VoCore2/Lite/Ultimate

Who is online

Users browsing this forum: No registered users and 42 guests