- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Now, I can configure the GPIO successful, but I don't know how to put the desired frequency that come from ACLK. Can you give me some advice? Looking forward to your reply! how to put aclk_output_frequency to GPIO.jpg Have a good day to you!
Solved! Go to Solution.
- Tags:
- aclk
- cyw20719b1
- gpio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi qzy_4727816,
If you look at the parameters of API wiced_hal_aclk_enable(), first parameter is to set the desired output frequency. I would again suggest you to look at /20719-B1_Bluetooth/apps/snip/hal/pwm/hal_pwm.c. Here a GPIO is seletced & configured.
Desired frequency and other parameters are defined.
If you right click on the function name and select 'Open Declaration', you will get more details about the function and its parameters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi qzy_4727816,
If you look at the parameters of API wiced_hal_aclk_enable(), first parameter is to set the desired output frequency. I would again suggest you to look at /20719-B1_Bluetooth/apps/snip/hal/pwm/hal_pwm.c. Here a GPIO is seletced & configured.
Desired frequency and other parameters are defined.
If you right click on the function name and select 'Open Declaration', you will get more details about the function and its parameters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi SheetalJ_96,
Thanks for your reply! Now, I find a following example in a User Guide. I also cannot understand why the clock can maps to the GPIO pin(P28). And I really want to know that whether the divided frequency from ACLK output to a GPIO can only via PWM function?
Have a good day to you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using API wiced_hal_gpio_select_function(), you can configure any GPIO to the required functionality (provided GPIO is not used for any other critical function). Check the snapshot attached in my previous response.
As of now, we have only this option to get the divided frequency. There is no dedicated API or function for the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
As the following example, I want to confirm that why the value of freq not equal to the value (toggle_cnt - init_cnt)?
/// \verbatim
/// UINT16 freq = 256;
/// UINT16 init_cnt = 0xFE55;
/// UINT16 toggle_cnt = 0xFF2A;
/// wiced_hal_gpio_configurePin(28, GPIO_OUTPUT_ENABLE, 0);
/// wiced_hal_aclk_enable(freq, ACLK1, ACLK_FREQ_24_MHZ);
/// wiced_hal_pwm_start(PWM2, PMU_CLK, toggle_cnt, init_cnt, 0);
/// \endverbatim
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not sure which user guide you are referring. Please refer pwm example.