RX8 串行接收器接收不到数据?

[复制链接]
 楼主| zj.ok 发表于 2017-4-13 11:11 | 显示全部楼层 |阅读模式


#include <m8c.h>        // part specific constants and macros
#include "PSoCAPI.h"    // PSoC API definitions for all User Modules
#include "RX8.h"


BOOL fWaitToReceiveByte(void)
{
    BYTE bRxStatus;

    /* Wait to receive full byte*/
    while ( !( bRxStatus=RX8_bReadRxStatus() & RX8_RX_COMPLETE ) )
    {
        /* might want to sleep or keep track of time */
    }

    /* data received, now check for errors */
    if (( bRxStatus & RX8_RX_NO_ERROR ) == 0 )
    {
        /* no error detected */
        bRxData = RX8_bReadRxData();
        return( TRUE );
    }
    else
    {
        /* error detected */
        bRxData = bRxStatus;
        return( FALSE );
    }
}

void main(void)
{

本帖子中包含更多资源

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

×
 楼主| zj.ok 发表于 2017-4-13 17:44 | 显示全部楼层
补充一下,数据可以接受到,但是数据不对,是波特率问题吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

2

帖子

0

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

1

主题

2

帖子

0

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