登录
首页 » SCM » 1. 本程序使用一个定时器和任意 2 个 I/O 口模拟一个串行口。 2. 1位起始位,8位数据位,1位停止位。发数据位时先发低位。 3. 支持半双...

1. 本程序使用一个定时器和任意 2 个 I/O 口模拟一个串行口。 2. 1位起始位,8位数据位,1位停止位。发数据位时先发低位。 3. 支持半双...

于 2022-06-19 发布 文件大小:4.09 kB
0 120
下载积分: 2 下载次数: 1

代码说明:

1. 本程序使用一个定时器和任意 2 个 I/O 口模拟一个串行口。 2. 1位起始位,8位数据位,1位停止位。发数据位时先发低位。 3. 支持半双工通讯。收、发波特率相同。 4. 应把定时器中断优先级设置为最高级。 5. 本程序每接收一个字节后就把它放到一个队列缓冲区中(也可使用环行缓冲区), 待缓冲区满后,将缓冲区中的内容原样发回。这是为了测试多字节连续收发的 能力和简化程序。实际应用中应防止缓冲区溢出。 6. 由接收转换到发送时要先调用 soft_send_enable (); 由发送转换到接收时要先调用 soft_receive_enable ()。 7. 发送最后一个字节后如果要立刻转为接收,必须等待最后一个字节后发送完毕 while ( rs_f_TI == 0) // 等待最后一个字节发送完毕-err

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 基于AT89C2051的平方
    基于at89c2051的方波发生器,MAIN: MOV SP,#60H 设置SP指针 MOV R0,#50H 显示缓冲区首地址时50H ML0: CLR A MOV @R0,A 显示缓冲区清零 INC R0 CJNE R0,#55H,ML0-AT89C2051 based on the square-wave generator, MAIN: MOV SP,# 60H Set SP pointer MOV R0,# 50H shows that the first address buffer 50HML0: CLR A MOV @ R0, A display buffer cleared INC R0 CJNE R0,# 55H, ML0
    2022-11-01 17:45:03下载
    积分:1
  • 128
    128-64点阵液晶模块的显示程序带反显平移等功能.rar,非常实用.-128-64 dot-matrix LCD display module procedures with significant anti-translation capabilities. Rar, very practical.
    2022-07-02 09:53:57下载
    积分:1
  • TLC2543实时时钟芯片的读取程序,采用AVR单片机读取,并附上芯片的Datasheet。...
    TLC2543实时时钟芯片的读取程序,采用AVR单片机读取,并附上芯片的Datasheet。-TLC2543 real-time clock chip reader, using AVR read, accompanied Chip Datasheet.
    2022-11-20 00:05:03下载
    积分:1
  • 粮情测控系统的设计 (基于凌阳单片机)硬件软件设计
    粮情测控系统的设计 (基于凌阳单片机)硬件软件设计-Grain monitoring and control system design (based on Sunplus Single-chip) hardware and software design
    2022-03-01 19:15:26下载
    积分:1
  • BasicCAN Driver
    BasicCAN 驱动程序-BasicCAN Driver
    2022-02-05 19:59:05下载
    积分:1
  • LT-1B msp430开发板例子程序-ADC12_-LT-1B msp430开发板例子程序-ADC12_11
    2022-12-07 02:05:03下载
    积分:1
  • 该程序是将18B20测得的温度值经单片机处理后在数码管上显示,比较适合单片机初学者使用。...
    该程序是将18B20测得的温度值经单片机处理后在数码管上显示,比较适合单片机初学者使用。-The program is 18B20 measured temperature value has been processed in the digital control microcomputer displays are more suitable for beginners to use microcontroller.
    2022-03-17 20:03:56下载
    积分:1
  • * Hardware architecture: PA0
    * 硬件结构: PA0-5对应6个LED数显管的位 ,PC0-7对应各LED数显管的段 ,PB4-7为键盘。 * 软件描述: 上电后,时钟从00.00.00(时/分/秒)自动走时,在走时状态时 , 按PB4(设定 * 键)超过3秒可循环选择调整时间/工作参数 ,接着按PB5以确定选择的操作 ,进入调整操作后 , * 按PB5选择欲调整参数,按PB6(增加键)完成调整参数操作 。按PB7,进入时控运行,PB1亮, * 再按PB7停止时控运行,回显走时。在定时到时,PB0点亮。- * Hardware architecture: PA0-5 corresponds 6 LED numbers to reveal the tube the position, PC0-7 corresponds each LED number to reveal the tube the section, PB4-7 is a keyboard. * Software description: After on electricity, clock from 00.00.00 (when/a minute/second) is in luck automatically, when is in luck the condition, according to PB4 (hypothesis * The key) surpasses for 3 seconds to be possible to circulate the choice time/operational parameter, then presses PB5 by to determine the choice the operation, after enters the adjustment operation * Wants according to the PB5 choice to adjust the parameter, (increases key) according to PB6 to complete the adjustment parameter operation.According to PB7, enters when controls the mov
    2022-04-16 19:29:12下载
    积分:1
  • 8019和51单片机的接口电路
    8019和51单片机的接口电路-8019 and 51 MCU Interface Circuit
    2022-07-23 11:45:08下载
    积分:1
  • C51中必备的汉字内码提取工具,让单片机很好的输入输出汉字.
    C51中必备的汉字内码提取工具,让单片机很好的输入输出汉字.-C51 in the essential character of the code extraction tool that allows single-chip input and output of Chinese characters very well.
    2023-05-02 07:10:04下载
    积分:1
  • 696518资源总数
  • 106164会员总数
  • 18今日下载