PSoC 6 WiFi-BT Kit map PWM to GPIO
user_265343250 Jun 10, 2018 6:02 PMI've been trying to map WICED_PWM_3 to WICED_GPIO_9 pin on the PSoC6 WiFi BT kit for a RC servo motor not having any luck. I was able to map it on the PSoC BLE kit using PSoC Creator without any issue. I've tried modifying the follow code in platform.c but it doesn't seem to work.
const platform_pwm_t platform_pwm_peripherals[] =
{
[WICED_PWM_1] = PLATFORM_PWM_COMPL(0, 1, WICED_GPIO_4, 0, 3),
[WICED_PWM_2] = PLATFORM_PWM_COMPL(0, 3, WICED_GPIO_8, 1, 1),
[WICED_PWM_3] = PLATFORM_PWM_COMPL(1, 1, WICED_GPIO_78, 11, 1),
to
const platform_pwm_t platform_pwm_peripherals[] =
{
[WICED_PWM_1] = PLATFORM_PWM_COMPL(0, 1, WICED_GPIO_4, 0, 3),
[WICED_PWM_2] = PLATFORM_PWM_COMPL(0, 3, WICED_GPIO_8, 1, 1),
[WICED_PWM_3] = PLATFORM_PWM_COMPL(1, 1, WICED_GPIO_9, 11, 1),
I get it to build but if I change the port to 1 and the pin number to 2 it fails to build see build errors below. I'm not sure what values I should use for _block_ and _cntr_
Compiling Platform_CY8CKIT_062
platforms/CY8CKIT_062/platform.c:343:17: error: 'P1_2_TCPWM1_LINE_COMPL1' undeclared here (not in a function); did you mean 'P11_1_TCPWM1_LINE_COMPL1'?
.hsiom = P ## _port_ ## _ ## _pin_ ## _TCPWM ## _block_ ## _LINE_COMPL ## _cntr_
^
platforms/CY8CKIT_062/platform.c:359:7: note: in expansion of macro 'PWM_PIN_ELEM_COMPL'
PWM_PIN_ELEM_COMPL(_block_, _cntr_, _wiced_gpio_port_, _wiced_gpio_pin_) \
^~~~~~~~~~~~~~~~~~
platforms/CY8CKIT_062/platform.c:370:22: note: in expansion of macro 'PLATFORM_PWM_COMPL'
[WICED_PWM_3] = PLATFORM_PWM_COMPL(1, 1, WICED_GPIO_9, 1, 2),
^~~~~~~~~~~~~~~~~~
platforms/CY8CKIT_062/platform.c:343:17: error: 'P1_2_TCPWM1_LINE_COMPL1' undeclared here (not in a function); did you mean 'P11_1_TCPWM1_LINE_COMPL1'?
.hsiom = P ## _port_ ## _ ## _pin_ ## _TCPWM ## _block_ ## _LINE_COMPL ## _cntr_
^
platforms/CY8CKIT_062/platform.c:359:7: note: in expansion of macro 'PWM_PIN_ELEM_COMPL'
PWM_PIN_ELEM_COMPL(_block_, _cntr_, _wiced_gpio_port_, _wiced_gpio_pin_) \
^~~~~~~~~~~~~~~~~~
platforms/CY8CKIT_062/platform.c:370:22: note: in expansion of macro 'PLATFORM_PWM_COMPL'
[WICED_PWM_3] = PLATFORM_PWM_COMPL(1, 1, WICED_GPIO_9, 1, 2),
^~~~~~~~~~~~~~~~~~
make.exe[3]: *** [build/waf.sflash_write-NoOS-CY8CKIT_062-SDIO/Modules/platforms/CY8CKIT_062/platform.o] Error 1
tools/makefiles/wiced_elf.mk:232: recipe for target 'build/waf.sflash_write-NoOS-CY8CKIT_062-SDIO/Modules/platforms/CY8CKIT_062/platform.o' failed
make.exe[2]: *** [main_app] Error 2
Makefile:351: recipe for target 'main_app' failed
make.exe[1]: *** [sflash_write_app] Error 2
tools/makefiles/wiced_apps.mk:415: recipe for target 'sflash_write_app' failed
make.exe[1]: *** Waiting for unfinished jobs....
make.exe[3]: *** [build/waf.bootloader-NoOS-CY8CKIT_062/Modules/platforms/CY8CKIT_062/platform.o] Error 1
make.exe[2]: *** [main_app] Error 2
make.exe[1]: *** [bootloader] Error 2
tools/makefiles/standard_platform_targets.mk:90: recipe for target 'bootloader' failed
make: *** [main_app] Error 2
Makefile:351: recipe for target 'main_app' failed
I tried to follow the Macros but not having any luck. Any help would be greatly appreciated.