[PIC32/SAM] SAM D21Curiosity Nano+MPLABX+串口

[复制链接]
9699|6
 楼主| Cjy_JDxy 发表于 2020-5-22 14:19 | 显示全部楼层 |阅读模式
今天搞了一下串口。
用harmony配置。







代码:
#include <stddef.h>                     // Defines NULL
#include <stdbool.h>                    // Defines true
#include <stdlib.h>                     // Defines EXIT_FAILURE
#include "definitions.h"                // SYS function prototypes


// *****************************************************************************
// *****************************************************************************
// Section: Main Entry Point
// *****************************************************************************
// *****************************************************************************

int main ( void )
{
    /* Initialize all modules */
    long int i;
    unsigned char a=0x55;
    /* Initialize all modules */
    SYS_Initialize ( NULL );

    while ( true )
    {
        /* Maintain state machines of all polled MPLAB Harmony modules. */
        //SYS_Tasks ( );
        SERCOM5_USART_Write(&a,1);
        for(i=10000000;i>0;i--);

    }

    /* Execution should not come here during normal operation */

    return ( EXIT_FAILURE );
}


/*******************************************************************************
End of File
*/
效果图:


工程:

本帖子中包含更多资源

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

×
wakayi 发表于 2020-6-6 15:24 | 显示全部楼层
非常感谢楼主分享
wowu 发表于 2020-6-6 15:26 | 显示全部楼层
请问harmony是什么工具
xiaoqizi 发表于 2020-6-6 15:26 | 显示全部楼层
我对楼主的佩服之情犹如滔滔江水啊  我就没忍住 呵呵呵
木木guainv 发表于 2020-6-6 15:26 | 显示全部楼层
非常不错的帖子
磨砂 发表于 2020-6-6 15:27 | 显示全部楼层
学习一下 呵呵
 楼主| Cjy_JDxy 发表于 2020-6-6 15:56 | 显示全部楼层
xiaoqizi 发表于 2020-6-6 15:26
我对楼主的佩服之情犹如滔滔江水啊  我就没忍住 呵呵呵

微芯的一个软件工具
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:绿水本无忧因风皱面,青山原不老为雪白头。

553

主题

3530

帖子

20

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