[ModusToolbox™] 【英飞凌CYW20829测评】篇2 串口打印测试

[复制链接]
 楼主| abner_ma 发表于 2024-7-22 17:19 | 显示全部楼层 |阅读模式
本帖最后由 abner_ma 于 2024-7-22 17:24 编辑



CYW20829与友商一款对比:


二、应用场景
  • CYW20829:专为物联网、智能家居和工业应用设计,能够支持所有的低功耗蓝牙应用场景,包括传感器、照明、蓝牙Mesh、遥控器等。其低功耗和出色的性能表现使其成为这些领域的理想选择。
  • Nordic **:作为nRF52系列中最先进的成员,它支持低功耗蓝牙、蓝牙网状网络、NFC、Thread和Zigbee的多协议蓝牙SoC。适用于需要协议并发性和丰富多样的外围设备和功能的复杂应用程序,如智能穿戴设备、医疗设备、智能家居设备等。
三、小结
  综上所述,CYW20829与Nordic nRF52**在蓝牙版本、处理器性能、内存与存储规格、功耗、射频性能、接口与外设以及安全性等方面均有所不同。选择哪款芯片取决于具体的应用场景、性能需求和预算等因素。例如,如果应用需要最新的蓝牙5.3支持,那么CYW20829可能是一个更好的选择

APP  工程建立



ModusToolbox™ CPU 内存消耗





软件只跑串口打印
  1. int main(void)
  2. {
  3.     cy_rslt_t result;

  4. #if defined (CY_DEVICE_SECURE)
  5.     cyhal_wdt_t wdt_obj;

  6.     /* Clear watchdog timer so that it doesn't trigger a reset */
  7.     result = cyhal_wdt_init(&wdt_obj, cyhal_wdt_get_max_timeout_ms());
  8.     CY_ASSERT(CY_RSLT_SUCCESS == result);
  9.     cyhal_wdt_free(&wdt_obj);
  10. #endif /* #if defined (CY_DEVICE_SECURE) */

  11.     /* Initialize the device and board peripherals */
  12.     result = cybsp_init();

  13.     /* Board init failed. Stop program execution */
  14.     if (result != CY_RSLT_SUCCESS)
  15.     {
  16.         CY_ASSERT(0);
  17.     }

  18.     /* Enable global interrupts */
  19.     __enable_irq();

  20.     /* Initialize retarget-io to use the debug UART port */
  21.     result = cy_retarget_io_init_fc(CYBSP_DEBUG_UART_TX, CYBSP_DEBUG_UART_RX,
  22.             CYBSP_DEBUG_UART_CTS,CYBSP_DEBUG_UART_RTS,CY_RETARGET_IO_BAUDRATE);

  23.     /* retarget-io init failed. Stop program execution */
  24.     if (result != CY_RSLT_SUCCESS)
  25.     {
  26.         CY_ASSERT(0);
  27.     }

  28.     /* Initialize the User LED */
  29.     result = cyhal_gpio_init(CYBSP_USER_LED, CYHAL_GPIO_DIR_OUTPUT,
  30.                              CYHAL_GPIO_DRIVE_STRONG, CYBSP_LED_STATE_OFF);

  31.     /* GPIO init failed. Stop program execution */
  32.     if (result != CY_RSLT_SUCCESS)
  33.     {
  34.         CY_ASSERT(0);
  35.     }

  36.     /* \x1b[2J\x1b[;H - ANSI ESC sequence for clear screen */
  37.     printf("\x1b[2J\x1b[;H");

  38.     printf("****************** "
  39.            "HAL: Hello World! Example "
  40.            "****************** \r\n\n");

  41.     printf("Hello World!!!\r\n\n");

  42.     printf("For more projects, "
  43.            "visit our code examples repositories:\r\n\n");

  44.     printf("https://github.com/Infineon/"
  45.            "Code-Examples-for-ModusToolbox-Software\r\n\n");

  46.     /* Initialize timer to toggle the LED */
  47.     timer_init();

  48.     printf("Press 'Enter' key to pause or "
  49.            "resume blinking the user LED \r\n\r\n");

  50.     printf("Hello 21ic, Hello Infineon CYW20829!\r\n\n");

  51.     for (;;)
  52.     {
  53.         /* Check if 'Enter' key was pressed */
  54.         if (cyhal_uart_getc(&cy_retarget_io_uart_obj, &uart_read_value, 1)
  55.              == CY_RSLT_SUCCESS)
  56.         {
  57.             if (uart_read_value == '\r')
  58.             {
  59.                 /* Pause LED blinking by stopping the timer */
  60.                 if (led_blink_active_flag)
  61.                 {
  62.                     cyhal_timer_stop(&led_blink_timer);

  63.                     printf("LED blinking paused \r\n");
  64.                 }
  65.                 else /* Resume LED blinking by starting the timer */
  66.                 {
  67.                     cyhal_timer_start(&led_blink_timer);

  68.                     printf("LED blinking resumed\r\n");
  69.                 }

  70.                 /* Move cursor to previous line */
  71.                 printf("\x1b[1F");

  72.                 led_blink_active_flag ^= 1;
  73.             }
  74.         }
  75.         /* Check if timer elapsed (interrupt fired) and toggle the LED */
  76.         if (timer_interrupt_flag)
  77.         {
  78.             /* Clear the flag */
  79.             timer_interrupt_flag = false;

  80.             /* Invert the USER LED state */
  81.             cyhal_gpio_toggle(CYBSP_USER_LED);
  82.         }
  83.     }
  84. }
复制代码


编译结束:
串口打印结果



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
为你转身 发表于 2024-9-30 13:13 来自手机 | 显示全部楼层
NFC、Thread和Zigbee的多协议蓝牙SoC。适用于需要协议并发性和丰富多样的外围设备和功能的复杂应用程序,如智能穿戴设备、医疗设备
sj8zw8 发表于 2025-4-30 23:06 | 显示全部楼层
CYW20829特别适合传感器、照明、蓝牙Mesh、遥控器等低功耗蓝牙应用。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

认证:项目经理
简介:资深嵌入式开发工程师

95

主题

181

帖子

3

粉丝
快速回复 在线客服 返回列表 返回顶部