图片
设为首页加入收藏
导航菜单
全站搜索
当前位置
产品详情
RS485 mini DIN
RS485 mini DIN

RS485 mini DIN 8P male

  • FTDI FT232RL chip
  • Support VCC, GND, DATA+, DATA-
  • Support 'Win 8, Support Android
  • Support EEPROM, support Mprog3.5 programming
  • Baut rate: 9600 ~ 256000bps
  • half duplex, non-isolated
  • Support up to 5km distrance transfering


what is pull up resistor?

Introduction

atmega328 reset pullup

Pull-up resistors are very common when using microcontrollers (MCUs) or any digital logic device. This tutorial will explain when and where to use pull-up resistors, then we will do a simple calculation to show why pull-ups are important.

Suggested Reading

Concepts that you should be familiar with before proceeding:

What is a Pull-up Resistor

Let’s say you have an MCU with one pin configured as an input. If there is nothing connected to the pin and your program reads the state of the pin, will it be high (pulled to VCC) or low (pulled to ground)? It is difficult to tell. This phenomena is referred to as floating. To prevent this unknown state, a pull-up or pull-down resistor will ensure that the pin is in either a high or low state, while also using a low amount of current.

For simplicity, we will focus on pull-ups since they are more common than pull-downs. They operate using the same concepts, except the pull-up resistor is connected to the high voltage (this is usually 3.3V or 5V and is often refereed to as VCC) and the pull-down resistor is connected to ground.

Pull-ups are often used with buttons and switches.

schematic pull-up

With a pull-up resistor, the input pin will read a high state when the button is not pressed. In other words, a small amount of current is flowing between VCC and the input pin (not to ground), thus the input pin reads close to VCC. When the button is pressed, it connects the input pin directly to ground. The current flows through the resistor to ground, thus the input pin reads a low state. Keep in mind, if the resistor wasn’t there, your button would connect VCC to ground, which is very bad and is also known as a short.

So what value resistor should you choose?

The short and easy answer is that you want a resistor value on the order of 10kΩ for the pull-up.

A low resistor value is called a strong pull-up (more current flows), a high resistor value is called a weak pull-up (less current flows).

schematic pull-up internal

The value of the pull-up resistor needs to be chosen to satisfy two conditions:

  1. When the button is pressed, the input pin is pulled low. The value of resistor R1 controls how much current you want to flow from VCC, through the button, and then to ground.

  2. When the button is not pressed, the input pin is pulled high. The value of the pull-up resistor controls the voltage on the input pin.

For condition 1, you don’t want the resistor’s value too low. The lower the resistance, the more power will be used when the button is hit. You generally want a large resistor value (10kΩ), but you don’t want it too large as to conflict with condition 2. A 4MΩ resistor might work as a pull-up, but its resistance is so large (or weak) that it may not do its job 100% of the time.

The general rule for condition 2 is to use a pull-up resistor (R1) that is an order of magnitude (1/10th) less than the input impedance (R2) of the input pin. An input pin on a microcontroller has an impedance that can vary from 100k-1MΩ. For this discussion, impedance is just a fancy way of saying resistance and is represented by R2 in the picture above. So, when the button is not pressed, a very small amount of current flows from VCC through R1 and into the input pin. The pull-up resistor R1 and input pin impedance R2 divides the voltage, and this voltage needs to be high enough for the input pin to read a high state.

For example, if you use a 1MΩ resistor for the pull-up R1 and the input pin’s impedance R2 is on the order of 1MΩ (forming a voltage divider), the voltage on the input pin is going to be around half of VCC, and the microcontroller might not register the pin being in a high state. On a 5V system, what does the MCU read on the input pin if the voltage is 2.5V? Is it a high or a low? The MCU doesn’t know and you might read either a high or a low. A resistance of 10k to 100kΩ for R1 should avoid most problems.

Since pull-up resistors are so commonly needed, many MCUs, like the ATmega328 microcontroller on the Arduino platform, have internal pull-ups that can be enabled and disabled. To enable internal pull-ups on an Arduino, you can use the following line of code in your setup() function:

pinMode(5, INPUT_PULLUP); // Enable internal pull-up resistor on pin 5

Another thing to point out is that the larger the resistance for the pull-up, the slower the pin is to respond to voltage changes. This is because the system that feeds the input pin is essentially a capacitor coupled with the pull-up resistor, thus forming a RC filter, and RC filters take some time to charge and discharge. If you have a really fast changing signal (like USB), a high value pull-up resistor can limit the speed at which the pin can reliably change state. This is why you will often see 1k to 4.7KΩ resistors on USB signal lines.

All of these factors play into the decision on what value pull-up resistor to use.

Calculating a Pull-up Resistor Value

schematic pull-up

Let’s say you want to limit the current to approximately 1mA when the button is pressed in the circuit above, where Vcc = 5V. What resistor value should you use?

It is easy to show how to calculate the pull-up resistor using Ohm’s Law:

alt text

Referring to the schematic above, Ohm’s Law now is:

alt text

Rearrange the above equation with some simple algebra to solve for the resistor:

alt text

Remember to convert all of your units into volts, amps and Ohms before calculating (e.g. 1mA = 0.001 Amps). The solution is to use a 5kΩ resistor.

Going Further

Now you should be familiar with what a pull-up resistor is and how it works. To learn more about electronic components and their applications, check out these other tutorials:



如何快速安装USB串口驱动

      很多客户买了USB转串口线后不知怎么使用,其中最多的是安装驱动的问题,现给大家详细介绍下具体操作方法。有需要的朋友们,可以一起来看看(以CP2102为例, PL2303, FT232RL安装过程想似)。
推荐:win7 64位系统下载
1、请先不要插USB-串口转换线,点击下载USB转串口驱动,下载完成后打开按照下面的步骤进行安装;
2. 下载后存到电脑,并记下存放路径
3. 插上USB转串口线,这时会出现以下提示:

CP2102和PL2303芯片的会弹出以下提示:


点击否,点击下一步,选择从列表或指定位置安装

再点下一步;

输入刚才下载的驱动的存放路径

点击确定,再回到上一步的窗口

点击是否继续的对话框,当然点继续啦
出现复制文件进度,会很快的啦

在接下来的窗口中,点击完成

安装完成后电脑硬件会出来一个虚拟串口

注意不能出现黄色的感叹号才算正确安装完成,USB转串口线才能正常工作
同时还要记住是COM几,因为后面下载软件还会用到。

PL2303TA, PL2303HXD在WINDOWS安装驱动和以上类似,但FT232RL会有不同,FTDI的芯片会更简单(当然也说明贵有贵的道理,嘿嘿)
FTDI芯片的USB串口线插上后,可以自动安装(以前是WINDOWS嵌入的驱动,但由于芯片和系统已经更新过很多次啦,就只有让WINDOWS自动下载最新驱动(这种方法比较好,至少可以防止那些乱七八糟的驱动下载网站所带的广告或病毒)
插上去后就这样

安装后就会显示

省去了很多手脚,一步自动完成,这就是FTDI芯片的USB串口线优点之一



还有一些朋友安装后说没有通讯,那就要看看以下问题:
一, 是不是软件设置里面串口号是不是一致,有些终端软件串口只能设COM1到COM8,这样您就需要在串口列表中将串口号改为1-8中的其中的一个,串口号一致后,电脑和设备就能互相找到对方了

二, 看TXD,RXD有没有接反, 本人从事USB转串口产品有十多年了,遇到最多也是最容易搞混淆的概念就是DTE和DTC的TXD和RXD, 用一个大家比较容易接受的比方来说,大家就明白了,就好象在要两个水池中间搭建一个水温冷却循环系统, 这样,一边的送水管(TXD)必须接要接另一端的进水管(RXD),进水管要接到对方的送水管(TXD)这样水才能循环起来。 用到串口中,就是说,设备的TXD,必须要接到电脑的RXD, RXD必须要接到TXD, TXD就是数据发送,RXD就是数据接收。 但这个TXD和RXD有个相对相言的, TXD/RXD必须是相对电脑或设备而言, 也就是DTE和DTC

三,就看你是不是没搞清楚设备是什么信号就胡乱的买了一根线接上去就用了。 串口最常用的是RS232,但还有一种TTL(有TTL1.8V电平,TTL3.3V电平, TTL5V电平),还有RS485啦,RS422等,都称为串口信号,如果所买的线和设备信号不一致就当然不能通信了,就象讲不同语言的人不能交流一样,不同信号类别是不能互发数据的,至少是乱码。那恐怕您要联系厂家重新买线了。

再附上一点有用的知识:如何辨别RS232,TTL信号?
打开设备,并让设备处在发送数据的模式下,这时用万表测试发送信号的PIN脚和GND(注意万用表打在测试直流电压挡,20V),如果是RS232信号,会出现一个9-12V的电压,如果是TTL就会出出一个1.8V/3.3V/5V的电压,当然不完全是这个数值,根据测试环境会稍有差异。 同样的道理,可以没出线是什么信号啦。

今天就分享到这里了,有问题欢迎咨询我们信和康技术在线解答或电话

浏览 (474) | 评论 (0) | 评分(0) | 支持(0) | 反对(0) | 产品发布:管理员
将本产品加入收藏
标签:usb rs485
图片
脚注信息
Copyright(C)2009-2010 Reserved by Shenzhen Sinforcon Electronics
Tel: +86-755-85236100    Fax: +86-755-82893356   Email: sales@sinforcon.com Skype: richard90072000   Msn: connectingcables@hotmail.com