MediaTek-Labs / mt3620_m4_software

mt3620_m4_driver
Other
32 stars 29 forks source link

PWM on the wrong GPIO pin #5

Closed LennardSchmit closed 4 years ago

LennardSchmit commented 4 years ago

Hi, I noticed pwm wasn't working on my MT3620. Now i found out the pwm signal is pushed to the wrong GPIO pin.

I set pwm on group 0 and channel 0 and that should resolve in a pwm signal at header 1, pin 4 (GPIO0). But with my logic analyzer i only measured a pwm signal on header 1, pin 6 (GPIO1).

I used OS_HAL_PWM and the defines: OS_HAL_GROUP0 and OS_HAL_PWM_0.

LawranceLiu commented 4 years ago

Hi, MTK tried to reconfirm the PWM function on GPIO0 & GPIO1 again. Everything works fine, we could not reproduce the problem. One suggestion for you is to review the parameters of the PWM APIs. There are three parameters: PWM Group, Channel, Bitmap. You could refer to the latest release (https://github.com/MediaTek-Labs/mt3620_m4_software/commit/faf06fe8dd02a7900cbcb8ea35a6e66b6721f5f3) for the PWM sample code.

//------------------------------------------------------- // PWM Group , PWM Channel , PWM Bitmap : GPIO //------------------------------------------------------- // OS_HAL_PWM_GROUP0, PWM_CHANNEL0, OS_HAL_PWM_0: GPIO0 // OS_HAL_PWM_GROUP0, PWM_CHANNEL1, OS_HAL_PWM_1: GPIO1 // OS_HAL_PWM_GROUP0, PWM_CHANNEL2, OS_HAL_PWM_2: GPIO2 // OS_HAL_PWM_GROUP0, PWM_CHANNEL3, OS_HAL_PWM_3: GPIO3 // OS_HAL_PWM_GROUP1, PWM_CHANNEL0, OS_HAL_PWM_0: GPIO4 // OS_HAL_PWM_GROUP1, PWM_CHANNEL1, OS_HAL_PWM_1: GPIO5 // OS_HAL_PWM_GROUP1, PWM_CHANNEL2, OS_HAL_PWM_2: GPIO6 // OS_HAL_PWM_GROUP1, PWM_CHANNEL3, OS_HAL_PWM_3: GPIO7 // OS_HAL_PWM_GROUP2, PWM_CHANNEL0, OS_HAL_PWM_0: GPIO8 (LED Red) // OS_HAL_PWM_GROUP2, PWM_CHANNEL1, OS_HAL_PWM_1: GPIO9 (LED Green) // OS_HAL_PWM_GROUP2, PWM_CHANNEL2, OS_HAL_PWM_2: GPIO10 (LED Blue) // OS_HAL_PWM_GROUP2, PWM_CHANNEL3, OS_HAL_PWM_3: GPIO11

You are welcome to let me know if you still see any problem.