RS-232串口一度像现在的USB接口一样,是PC的标准接口,用来连接打印机、Modem和其他一些外设。后来逐渐被USB接口所取代,现在PC上已经看不到它的身影了。开发调试时如果用到串口,一般都是用USB转串口头,如下图所示。左图为USB-to-RS-232,右图为USB-to-TTL。USB-to-RS-232和USB-to-TTL因电气特性不同,所以应用场合也不同,不能互换。本文所转载的文章,重点介绍了RS-232和TTL串口的异同。

  

  One of the tools we use most when debugging our projects is serial input/output. Serial is very easy to implement, and it allows you to send/receive any data you need from your microcontroller to a computer's serial port so it can be viewed using a terminal emulator. These two devices are compatible from a software perspective, however you can't just hook a microcontroller up to a computer because the hardware interfaces are not compatible.

  Most microcontrollers these days have built in UARTs (universally asynchronous receiver/transmitter) that can be used to receive and transmit data serially. UARTs transmit one bit at a time at a specified data rate (i.e. 9600bps, 115200bps, etc.). This method of serial communication is sometimes referred to as TTL serial (transistor-transistor logic). Serial communication at a TTL level will always remain between the limits of 0V and Vcc, which is often 5V or 3.3V. A logic high ('1') is represented by Vcc, while a logic low ('0') is 0V.

  The serial port on your computer (if it's lucky enough to have one, they're quickly becoming a relic) complies with the RS-232 (Recommended Standard 232) telecommunications standard. RS-232 signals are similar to your microcontroller's serial signals in that they transmit one bit at a time, at a specificbaud rate, with or without parity and/or stop bits. The two differ solely at a hardware level. By the RS-232 standard a logic high ('1') is represented by a negative voltage – anywhere from -3 to -25V – while a logic low ('0') transmits a positive voltage that can be anywhere from +3 to +25V. On most PCs these signals swing from -13 to +13V.

  The more extreme voltages of an RS-232 signal help to make it less susceptible to noise, interference, and degradation. This means that an RS-232 signal can generally travel longer physical distances than their TTL counterparts, while still providing a reliable data transmission.

  This timing diagram shows both a TTL (bottom) and RS-232 signal sending 0b01010101

Solutions

  So, you may see where the problem lies in interfacing these two signals. To connect these two ports you not only have to invert the signals, but you also have to deal with regulating the potentially harmful RS-232 voltages to something that won't destroy a microcontroller's serial pins. There are a handful of solutions to this problem of voltage converting and inverting. The most common, and easiest solution is just plugging a MAX-232 in between the two devices:

  There are many generic derivatives of the MAX-232. Maxim IC just happened to be the first to market with this neato device (decades ago!) so out of habit, we call all ICs that do similar jobs 'MAX-232s'.

  Less expensive solutions, like our RS-232 Shifter, use transistors or inverters to flip the signals, and charge pumps to get the voltages high enough to be RS-232 compliant:

Sample Question

  With the above information at hand, here's a quick quiz to test your shiny new knowledge:

  1. What are the two main differences between RS-232 and TTL signals?

  2. True or false: Data is sent from a PC's RS-232 port at 9600 bits-per-second (bps), it's converted to TTL by a MAX232 before reaching a microcontroller. The voltages of the signals look different on each end, but the speed (bps) does not change.

Answers:

  Spoiler Alert! Highlight from here...

  1. The  '1's and '0's are inverted from each other. The minimum and maximum voltages of RS-232 signals is +/-13V, and only 0 to 3.3V/5V for TTL signals.

  2. True. The data rate will always remain the same, even if the voltages of the RS-232 and TTL signals are different.

...to here to reveal the answers. Because, you know, they're so super-secret.

  原文地址:https://www.sparkfun.com/tutorials/215

转载于:https://www.cnblogs.com/we-hjb/p/UART3.html

RS-232 vs. TTL Serial Communication(转载)相关推荐

  1. USB转网口转485转232转TTL等多接口互转调试工具,无需拨动开关自动切换连接

    USB转网口转485转232转TTL等多接口互转调试工具,无需拨动开关自动切换连接 多接口数据转换器 **本次工具是由博主自主研发的的多接口互转调试工具.主要通讯模式有USB.网口.485.232.T ...

  2. android设备rs232数据格式,如何通过rs232 android进行串口通讯?(How to do serial communication via rs232 android?)...

    如何通过rs232 android进行串口通讯?(How to do serial communication via rs232 android?) 我有一个Android设备'Micronet A ...

  3. RPI Serial Communication (一)

    这篇文章是给谁看的? 给那些有一定的51,PIC 等单片机基础的,并且对树莓派的通用输入输出(GPIO)数据传输有兴趣的菜鸟们(noobs!),比如我. 我能从这篇文章中学到嘛? 这篇文章是新手入门向 ...

  4. RPI Serial Communication (二)

    这篇文章是给谁看的? 给那些有一定的51,PIC 等单片机基础的,并且对树莓派的通用输入输出(GPIO)数据传输有兴趣的菜鸟们(noobs!),比如我. 我能从这篇文章中学到嘛? 这篇文章是新手入门向 ...

  5. 串口协议“USB/TTL转232“模块的工作原理

    文章目录 一.串口通信协议 串口协议简介 RS-232,485标准 一.RS-232-C 二.RS-485总线 RS232.485电平与TTL电平的区别 二.USB/TTL转232"模块(以 ...

  6. 串口通讯协议和RS-232的介绍以及USB/TTL转232模块的工作原理

    1 串口通讯协议简介 串口通讯 (Serial Communication)是一种设备间非常常用的串行通讯方式,电子工程师在调试设备时也经常使用该通讯方式输出调试信息. 通讯协议,我们以分层的方式来理 ...

  7. Arduino Uno R3 communication

    文章目录 Introduction Aim 目标 Objectives Device 设备 Arduino Uno Technical specifications 技术规格 General pin ...

  8. 2021-07-14 串口 、并口、接口划分(UART、RS232、RS422、RS485、TTL、USB)

    文章目录 前言 一.串口是什么? 二.并口是什么? 三.各接口的划分? 1.UART 2.USB 3.各式各样电气接口标准 1.RS232(全双工) 2.RS485(半双工) 3.RS422(全双工) ...

  9. 值得推荐的C/C++框架和库(转载)

    本文系外部转贴,原文地址:http://coolshell.info/c/c++/2014/12/13/c-open-project.htm]留作存档 下次造轮子前先看看现有的轮子吧 值得学习的C语言 ...

最新文章

  1. ARP缓存记录种类动态条目和静态条目
  2. 大系统观:第2章 系统论概述
  3. android 视频 截图,java – android获取当前视频的截图
  4. 在服务器上搭建基于yolo3 与crnn 实现中文自然场景文字检测及识别,GPU版本
  5. azure未连接_将Azure Databricks数据连接到Power BI Desktop
  6. java 网络请求 生成本地图片
  7. oracle 列出asm磁盘,如何列出ASM磁盘组的所有磁盘
  8. 开发笔记1 关于指针,结构体使用指针的问题
  9. 【CA】数字电视CA原理与破解方式
  10. python获取浏览器network_如何使用python selenium获取浏览器网络日志
  11. 华为研发模式演进历程
  12. html标题居中加背景色,如何设置CSS背景宽度后让文字居中?
  13. 新联盟呼吁结束种族主义人工智能研究,声称将面Kong与犯罪行为相匹配
  14. moss2007安装部署历程 .
  15. NOIP2016 酱油记
  16. tar,tar.gz,zip,tar.bz2压缩算法比较,tar.bz2压缩率最大最耗cpu
  17. Filter中chain.doFilter(req, res)的理解
  18. 在Linux中压缩/解压缩文件
  19. 为何,以及如何提炼一个函数
  20. TeamViewer商用该个人

热门文章

  1. ASP.NET Core——身份验证UI安装
  2. 关于json时间字符串格式化处理
  3. python总结简短_Python简单的基础总结
  4. java 复制文本内容_基于java文本复制的7种方式总结
  5. python实现屏幕录制_JavaScript 屏幕录制 API 学习
  6. 注册名字英文name域名_关于域名和备案,你想知道的都在这里
  7. python实现蒙特卡洛算法_用Python实现基于蒙特卡洛算法小实验
  8. ionic 集成websocket
  9. java图片特效轮播代码_JQuery实现图片轮播效果
  10. 下载maven依赖到指定目录