PWM support

dimitry
 
Posts: 3
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: 567
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: 3
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?

Return to VoCore2

Who is online

Users browsing this forum: No registered users and 2 guests