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?