VC0706串口工具说明文档
- 格式:pdf
- 大小:605.42 KB
- 文档页数:35
USB Serial Converter USB Serial Converter20116.0520Rev. 1.0.0.000Rev. 11Contents1.1.Introduction Introduction (2)1-1. Overview.............................................................................. 2 1-2. Package Contents................................................................ 2 1-3. System Requirements and Restrictions.............................. 2 1-4. DB9(RS-232C) connector Pin Assignment..........................32.I nstallation on nstallation on Windows PC Windows PC (4)2-1. Installation on Windows 10/8.1/8/7/VistaServer2012 R2/Server2012/Server2008 R2/Server2008........ 4 2-2. Confirmation........................................................................ 8 2-3. Uninstallation on Windows 10/8.1/8/7/VistaServer2012 R2/Server2012/Server2008 R2/Server2008 (9)3. . Sp Sp Specification ecification ecifications s (11)*All trademarks and logos are the properties of their respective holders. *The specifications and pictures are subject to change without notice.21.1.Introduction Introduction Introduction1-1.1. Overview Overview Overview● REX-USB60F is a USB to serial converter.Compatible with Universal Serial Bus specifications Rev. 1.1. ● Up to 230.4Kbps data transfer rate. ● Standard USB (A type Male) Easy to connect PC.●Virtual COM port driverREX-USB60F can be used with FTDI’s VCP drivers to provide a COM port on a PC.●LED indicatorsREX-USB60F has “PWR/TXD/RXD” LED indicators for monitoring communication status.PWR: power / TXD: transmit / RXD: receive1-2. Package C Package Contents ontents ontentsThis product is shipped with the following items: ● REX-USB60F USB Serial Converter ● Setup CD-ROM. ● Installation Guide● Warranty Card in Japanese1-3. System Requirements and Restrictions System Requirements and RestrictionsHost machine●Windows PC with free Standard USB A type portOperating System● Windows 10, Windows 8.1, Windows 8, Windows7, Windows Vista● Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 200831-4. DB9(DB9(RS RS RS--232C 232C)) connector connector Pin Assignment Pin Assignment Pin AssignmentThe pin assignment of the connector is below:This DB9pin connector is compatible with ANSI/EIA/TIA-574 specifications.Signal Name Name Direction Direction DTE DTE – DCE. DCE.Meaning Meaning1 DCD <--- Data Carrier Detected2 RXD <--- Received Data3 TXD ---> Transmitted Data4 DTR ---> Data Terminal Ready5 GND - Signal Ground6 DSR <--- Data Set Ready7 RTS ---> Request to Send8 CTS <--- Clear to Send 9RI<---Ring Indicator1 2 3 4 56 7 8 942. Installation Installation on on on Windows PC Windows PC Windows PCPlease make sure that the Windows PC meets the following specifications: • USB port is Standard-USB A • Windows version is Vista or later2-1.1. Installation Installation on Windows 10/8.1/8/7/Vista/on Windows 10/8.1/8/7/Vista/on Windows 10/8.1/8/7/Vista/Server 2012Server 2012 R2/Server2012R2/Server2012/Server 2008 R2/ Server 2008/Server 2008 R2/ Server 2008/Server 2008 R2/ Server 2008Before connecting the REX-USB60F USB serial converter to a USB port, follow the instructions below:1) Insert the setup CD-ROM for the REX-USB60F into your CD-ROM drive. Navigate to the [Setup] folder on the CD that contains the USB60F_Setup.exe Double click USB60F_Setup.exe.2) A “User Account Control” dialog box may appear. Click [Yes] to proceed with the installation.3) The InstallShield Wizard for RATOC REX-USB60F Installer will start. Click [Next] to proceed with the installation.4) A “RATOC REX-USB60F Installer“ will start.Click [Install] to proceed with the installation.55) A “Windows Security” dialog box will appear.Click [Install] to proceed with the installation.6) A “Windows Security” dialog box will appear again. Click [Install] to proceed with the installation.67) The screen will automatically complete and then change to the one below:Click [Finish]. The “RATOC REX-USB60F Installer” has finished. Connect the REX-USB60F to a spare USB port on your PC.The necessary drivers will be found.It will start installation and automatically finish.Proceed to (2-2) Confirmation of setting REX-USB60F to confirm the installation has finished properly.72-2.ConfirmationConfirmationFor confirming the installation has finished properly.Open the Device Manager and select “View > Devices by Connection”. Under the “Ports(COM/LPT)”category, the label “USB Serial Port” with an additional COM port will appear.If the label “USB Serial Port” shows without yellow “!” mark, the installation is done properly.892-3. Uninstallation on Wind Uninstallation on Windo o ws 10/8.1/8/7/Vista ws 10/8.1/8/7/Vista Server 2012Server 2012 R2/R2/Server 2012/S Server 2012/S Server 2012/Server 2008erver 2008erver 2008 R2/Server 2008R2/Server 2008Open the [Program and function] at the [Control Panel].Select the [RATOC REX-USB60F Installer] and click [Uninstall].The InstallShield Wizard for RATOC REX-USB60F Installer will start.The following dialog will appear. Click [Yes] to proceed with the uninstallation.The screen will automatically complete and then change to the one below:Click [Finish] to finish with the uninstallation.103. SpecificationSpecifications sProduct Name REX-USB60FSerial Input/Output level RS-232C levelUSB Specification USB(Universal Serial Bus) Specifications Rev. 1.1 Connector USB :Standard-USB Type A maleRS-232C:D-Sub9 male (with anchor [#4-40]) Number of I/O ports 1 portUnit Dimensions 3.35[L] x 1.1[W] x 0.43[H] in (85[L] x 28[W] x 11[H] mm) Cable Length Approx. 2.83 ft (85 cm)Weight 0.194 oz (55 g)Data transfer mode Asynchronous (Start stop synchronization)Data transfer Rate (Baud) 300/600/1,200/2,400/4,800/9,600/19,200/38,40057,600/115,200/230,400 bpsTransmit Distance Within 50ft (15m)Power Voltage DC+5V (Powered for USB Bus)Power Consumption Average: 36mA(5V) Max.: 60mA(5V)Serial Parameter Data bit: 7/8 Start bit:1 Stop bit: 1/2Parity bit: even/odd/noneRS-232C connector D-SUB9PIN RS-232C connector MaleANSI/EIA/TIA-574LED Indicators PWR:Power LEDIf 5V power from USB bus is properly suppliedfrom USB bus, this indicator LED will be on.TXD:Transmit data indicator (Host to Device)RXD:Receive data indicator (Device to Host) Operating Environment Temperature: 32ºF to 122ºF (0ºC to 50ºC)Humidity: 10 to 90% (non condensing)Storage Environment Temperature: -4ºF to 149ºF (-20ºC to 65ºC)Humidity: 10 to 90%(non condensing)Note:1.Do not remove while the application is communicating. System will beunstable.2.Do not operate to suspend while the application is communicating.System will be unable to resume properly.3.This product does not support the serial mouse for connecting to RS-232Cport.1112。
串口调试助手vc源程序及其详细编写过程1.建立项目2.在项目中插入MSComm控件3.利用ClassWizard定义CMSComm类控制变量4.在对话框中添加控件5.添加串口事件消息处理函数OnComm()6.打开和设置串口参数7.发送数据8.发送十六进制字符9.在接收框中以十六进制显示10.如何设置自动发送11.什么是VARIANT数据类型?如何使用VARIANT数据类型?1.建立项目:打开VC++6.0,建立一个基于对话框的MFC应用程序SCommTest(与我源代码一致,等会你会方便一点);2.在项目中插入MSComm控件选择Project菜单下Add To Project子菜单中的Components and Controls…选项,在弹出的对话框中双击Registered ActiveX Controls项(稍等一会,这个过程较慢),则所有注册过的ActiveX控件出现在列表框中。
选择Microsoft Communications Control, version 6.0,,单击Insert按钮将它插入到我们的Project中来,接受缺省的选项。
(如果你在控件列表中看不到Microsoft Communications Control, version 6.0,那可能是你在安装VC6时没有把ActiveX一项选上,重新安装VC6,选上ActiveX就可以了),这时在ClassView视窗中就可以看到CMSComm类了,(注意:此类在ClassWizard中看不到,重构clw文件也一样),并且在控件工具栏Controls中出现了电话图标(如图1所示),现在要做的是用鼠标将此图标拖到对话框中,程序运行后,这个图标是看不到的。
3.利用ClassWizard定义CMSComm类控制对象打开ClassWizard->Member Viariables选项卡,选择CSCommTestDlg类,为IDC_MSCOMM1添加控制变量:m_ctrlComm,这时你可以看一看,在对话框头文件中自动加入了//{{AFX_INCLUDES() #i nclude "mscomm.h" //}}AFX_INCLUDES (这时运行程序,如果有错,那就再从头开始)。
EV96C70A 55W Dual Output Converter from 36V–54V Input EVB IntroductionThis document provides the description and operating procedures for Microchip's dual output 55V/30W and 5V/25W board from 36V–54V input EV96C70A. This board type is used for evaluating the performance of Microchip PoE systems and the Microchip PWM controller LX7309, which is an integral part of Microchip PoE PD controllersPD70201 and PD70211.Microchip’s PD70201 and PD70211 devices are a part of a family of devices that support the IEEE® 802.3af, IEEE 802.3at, and HDBaseT standards PD interface.The PD interface includes the following family of devices.Table 1. Microchip Powered Device Products OfferingsMicrochip’s EV96C70A evaluation board provides designers with the environment needed for evaluating the performance and implementation of PoE PD applications.The board uses two PWM LX7309, which are an integral part of Microchip PD controllers PD70201 and PD70211. This document provides all necessary procedures and instructions to install and operate this board.Figure 1. EV96C70A Block DiagramThe board can be powered through an input connector J6 by a lab supply or by an output of PoE PD front end. See section 1.3. Electrical Characteristics for the input voltage range. The external load is connected to the evaluation board using the J1 (5V/25W) and J7 (55V/30W) output connectors. The following figure shows the location of input and output connectors.D5 is the 55V indication LED and D9 is the 5V indication LED. These LEDs indicate the presence of the corresponding outputs.The following figure shows a top view of the evaluation board.Figure 2. EV96C70A Evaluation BoardTable of Contents Introduction (1)1. Product Overview (4)1.1. Evaluation Board Features (4)1.2. Evaluation Board Connectors (4)1.3. Electrical Characteristics (5)2. Installation (6)2.1. Initial Configuration (6)3. Schematic (7)4. Bill of Materials (9)5. Board Layout (16)6. Ordering Information (20)7. Revision History (21)The Microchip Website (22)Product Change Notification Service (22)Customer Support (22)Microchip Devices Code Protection Feature (22)Legal Notice (22)Trademarks (23)Quality Management System (24)Worldwide Sales and Service (25)1. Product OverviewThis section provides the product overview of the evaluation board.1.1 Evaluation Board Features•Input DC voltage connector and two output voltage connectors.•Onboard “output present” LED indicators.•36 V DC to 54 V DC input voltage range.•Evaluation board working temperature: 0 ℃ to 70 ℃.•RoHS compliant.1.2 Evaluation Board ConnectorsThe following table lists the evaluation board connectors.Table 1-1. Connector Details1.2.1 Input ConnectorThe following table lists pinout of input connector.Table 1-2. J1 Connector•Manufacturer: On Shore Technology.•Manufacturer part number: ED700/2.1.2.2 Output ConnectorsAn external load is connected to the evaluation board using the J1 and J7 output connectors. The following tables list pinouts of the output connector.The manufacturer and manufacturer part number details of the J1 and J7 output connectors are as follows:•Manufacturer: Kaifeng Electronic.•Manufacturer part number: KF350V-02P-14.Table 1-3. J1 ConnectorTable 1-4. J7 Connector1.3 Electrical CharacteristicsThe following table lists the electrical characteristics of the EV96C70A evaluation board.Table 1-5. Electrical CharacteristicsInstallation 2. InstallationThis section provides information about the installation procedure of the EV96C70A evaluation board.Note: Ensure that power source of the board is turned OFF before all peripheral devices are connected.2.1 Initial ConfigurationPerform the following steps for initial configuration:1.Connect load to the board (using J1 and J7).2.Connect a DC supply to input connector J6.3.Turn ON the DC supply.Schematic 3.l4. Bill of MaterialsThe following table lists the bill of materials.Table 4-1. Bill of MaterialsNote: Third-party components can be replaced by approved equivalents. N.C = not installed (optional).5. Board LayoutThis section describes the layout of the evaluation board. This is a four-layer board with 2 Oz copper. The following figures show the silk of the board for tracking devices placements.Figure 5-1. Top SilkFigure 5-4. Bottom CopperOrdering Information 6. Ordering InformationThe following table lists the evaluation board ordering information.Table 6-1. Evaluation Board Ordering InformationRevision History 7. Revision HistoryThe Microchip WebsiteMicrochip provides online support via our website at /. This website is used to make files and information easily available to customers. Some of the content available includes:•Product Support – Data sheets and errata, application notes and sample programs, design resources, user’s guides and hardware support documents, latest software releases and archived software•General Technical Support – Frequently Asked Questions (FAQs), technical support requests, online discussion groups, Microchip design partner program member listing•Business of Microchip – Product selector and ordering guides, latest Microchip press releases, listing of seminars and events, listings of Microchip sales offices, distributors and factory representativesProduct Change Notification ServiceMicrochip’s product change notification service helps keep customers current on Microchip products. Subscribers will receive email notification whenever there are changes, updates, revisions or errata related to a specified product family or development tool of interest.To register, go to /pcn and follow the registration instructions.Customer SupportUsers of Microchip products can receive assistance through several channels:•Distributor or Representative•Local Sales Office•Embedded Solutions Engineer (ESE)•Technical SupportCustomers should contact their distributor, representative or ESE for support. Local sales offices are also available to help customers. A listing of sales offices and locations is included in this document.Technical support is available through the website at: /supportMicrochip Devices Code Protection FeatureNote the following details of the code protection feature on Microchip products:•Microchip products meet the specifications contained in their particular Microchip Data Sheet.•Microchip believes that its family of products is secure when used in the intended manner, within operating specifications, and under normal conditions.•Microchip values and aggressively protects its intellectual property rights. Attempts to breach the code protection features of Microchip product is strictly prohibited and may violate the Digital Millennium Copyright Act.•Neither Microchip nor any other semiconductor manufacturer can guarantee the security of its code. Code protection does not mean that we are guaranteeing the product is “unbreakable”. Code protection is constantly evolving. Microchip is committed to continuously improving the code protection features of our products. Legal NoticeThis publication and the information herein may be used only with Microchip products, including to design, test,and integrate Microchip products with your application. Use of this information in any other manner violates these terms. Information regarding device applications is provided only for your convenience and may be supersededby updates. It is your responsibility to ensure that your application meets with your specifications. Contact yourlocal Microchip sales office for additional support or, obtain additional support at /en-us/support/ design-help/client-support-services.THIS INFORMATION IS PROVIDED BY MICROCHIP "AS IS". MICROCHIP MAKES NO REPRESENTATIONSOR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORYOR OTHERWISE, RELATED TO THE INFORMATION INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE, OR WARRANTIES RELATED TO ITS CONDITION, QUALITY, OR PERFORMANCE.IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL, OR CONSEQUENTIAL LOSS, DAMAGE, COST, OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE INFORMATION OR ITS USE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THE INFORMATION OR ITS USE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THE INFORMATION.Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights unless otherwise stated.TrademarksThe Microchip name and logo, the Microchip logo, Adaptec, AnyRate, AVR, AVR logo, AVR Freaks, BesTime, BitCloud, CryptoMemory, CryptoRF, dsPIC, flexPWR, HELDO, IGLOO, JukeBlox, KeeLoq, Kleer, LANCheck, LinkMD, maXStylus, maXTouch, MediaLB, megaAVR, Microsemi, Microsemi logo, MOST, MOST logo, MPLAB, OptoLyzer, PIC, picoPower, PICSTART, PIC32 logo, PolarFire, Prochip Designer, QTouch, SAM-BA, SenGenuity, SpyNIC, SST, SST Logo, SuperFlash, Symmetricom, SyncServer, Tachyon, TimeSource, tinyAVR, UNI/O, Vectron, and XMEGA are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AgileSwitch, APT, ClockWorks, The Embedded Control Solutions Company, EtherSynch, Flashtec, Hyper Speed Control, HyperLight Load, IntelliMOS, Libero, motorBench, mTouch, Powermite 3, Precision Edge, ProASIC, ProASIC Plus, ProASIC Plus logo, Quiet- Wire, SmartFusion, SyncWorld, Temux, TimeCesium, TimeHub, TimePictra, TimeProvider, TrueTime, WinPath, and ZL are registered trademarks of Microchip Technology Incorporated in the U.S.A.Adjacent Key Suppression, AKS, Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, Augmented Switching, BlueSky, BodyCom, CodeGuard, CryptoAuthentication, CryptoAutomotive, CryptoCompanion, CryptoController, dsPICDEM, , Dynamic Average Matching, DAM, ECAN, Espresso T1S, EtherGREEN, GridTime, IdealBridge, In-Circuit Serial Programming, ICSP, INICnet, Intelligent Paralleling, Inter-Chip Connectivity, JitterBlocker, Knob-on-Display, maxCrypto, maxView, memBrain, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach, NVM Express, NVMe, Omniscient Code Generation, PICDEM, , PICkit, PICtail, PowerSmart, PureSilicon, QMatrix, REAL ICE, Ripple Blocker, RTAX, RTG4, SAM-ICE, Serial Quad I/O, simpleMAP, SimpliPHY, SmartBuffer, SmartHLS, SMART-I.S., storClad, SQI, SuperSwitcher, SuperSwitcher II, Switchtec, SynchroPHY, Total Endurance, TSHARC, USBCheck, VariSense, VectorBlox, VeriPHY, ViewSpan, WiperLock, XpressConnect, and ZENA are trademarks of Microchip Technology Incorporated in theU.S.A. and other countries.SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.The Adaptec logo, Frequency on Demand, Silicon Storage Technology, Symmcom, and Trusted Time are registered trademarks of Microchip Technology Inc. in other countries.GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.All other trademarks mentioned herein are property of their respective companies.© 2022, Microchip Technology Incorporated and its subsidiaries. All Rights Reserved.ISBN: 978-1-5224-9978-7Quality Management SystemFor information regarding Microchip’s Quality Management Systems, please visit /quality.Worldwide Sales and Service。
目录1. 远程控制概述 (1)1.1 如何远程控制 (1)1.2 通信协议 (3)1.3 远程控制功能 (5)2. SCPI简介 (10)2.1 命令格式 (10)2.2 符号说明 (10)2.3 参数类型 (11)2.4 命令缩写 (12)3. 模式共用命令 (13)3.1 IEEE公用命令子系统 (13)3.2 系统命令 (15)3.3 存储命令 (20)3.4 显示控制 (21)3.5 模式命令 (22)3.6 扫描命令 (22)4. 频谱分析模式 (24)4.1 仪器模式命令 (24)4.2 Initiate命令子系统 (24)4.3 Sense命令子系统 (25)4.4 Calculate命令系统 (43)4.5 Measurement命令系统 (58)4.6 触发 (72)4.7 TG (73)4.8 调制解调 (75)5. 矢量网络分析模式 (77)5.1 频率控制 (77)5.2 幅度控制 (78)5.3 带宽控制 (80)5.4 扫描控制 (80)5.5 TG (81)5.6 迹线 (81)5.7 光标 (85)6. 故障定点分析模式 (98)6.1 频率控制 (98)6.2 幅度控制 (99)6.3 扫描控制 (100)6.4 迹线 (101)6.5 光标 (102)6.6 测量 (105)7. 调制分析模式 (110)7.1 频率控制 (110)7.2 幅度控制 (111)7.3 带宽控制 (112)7.4 扫描控制 (113)7.5 迹线 (114)7.6 光标 (117)7.7 测量 (119)7.8 触发 (124)8. 实时频谱分析模式 (126)8.1 频率控制 (126)8.2 幅度控制 (129)8.3 带宽控制 (131)8.4 扫描控制 (132)8.5 迹线 (134)8.6 光标 (137)8.7 触发 (139)8.8 测量 (142)9. EMI测量 (145)9.1 频率控制 (145)9.2 幅度控制 (147)9.3 带宽控制 (150)9.4 扫描控制 (151)9.5 迹线 (153)9.6 光标 (155)9.7 限制 (159)10. 编程示例 (168)10.1 使用VISA的编程示例 (168)10.2Sockets/Telnet示例 (182)SIGLENT 1. 远程控制概述分析仪支持通过USB、LAN、GPIB-USB接口与计算机进行通信。
产品特点●修正供电电压监控器2.63V(CBM706P,CBM706R,CBM708R)2.93V(CBM706S,CBM708S)3.08V(CBM706T,CBM708T)●100µA静态电流●200ms复位脉冲宽度●防抖手动复位输入(MR)●独立看门狗定时器● 1.6秒超时(CBM706P,CBM706R,CBM706S,CBM706T)●电源故障或低电量警告的电压监测●VCC=1V时确保复位有效信号●CBM706P/R/S/T,CBM708R/S/T更好的升级能力产品应用●微型处理器系统●计算器●控制器●智能仪器●关键微处理器监控●电源操作系统●便携仪器产品描述CBM706P、CBM706R、CBM706S、CBM706T和CBM708R、CBM708S、CBM708T系列微处理器监控电路适用于3V或3.3V电压监控。
CBM706P、CBM706R、CBM706S、CBM706T系列产品提供有源监控电路,该监控电路能够在电源开启、电源关闭以及电压不足的条件下产生复位输出。
这个复位输出能够在低至1V的供电电源下保持工作。
该系列产品还提供独立看门狗监控电路。
如果看门狗输入能够在1.6秒内没有触发的情况下激活。
此外,还为电源故障警报、低电压检测或附加电源装置提供1.25V的临界值检测器,还包括有效低电平防抖动的手动复位输入。
CBM706R,CBM706S,and CBM706T产品除监视电平的复位阀值外与上述产品功能一致,复位阀值分别为2.63V,2.93V,3.08V。
CBM706P与CBM706R的复位阀值都是2.63V。
唯一不同的是CBM706P 具有自动高复位输出。
CBM708R/CBM708S/CBM708T提供类似CBM706R/CBM706S/CBM706T的功能,唯一不同的是不提供看门狗定时,除提供有效低电平复位输出外还提供有效高电平复位输出代替看门狗定时功能。
所有产品均采用8脚MSOP和8脚SOP封装。
(2016-11-21)本设计包含的函数模块有:1.打开/关闭串口和设置串口参数2.软件退出3.获取串口参数4.发送数据5.接受数据6.清空发送区7.清空接收区8.计数清零9.暂停/开启接收数据10.自动发送11.发送周期设置12.打开文件13.保存数据补充说明:1.设置串口参数里面包括了1)获取串口可用串口。
2)波特率下拉参数设置。
3)校验位下拉参数设置。
4)数据位下拉参数设置。
5)默认设置。
6)2.发送数据前先判断是否为十六进制,是否为自动发送。
是十六进制发送则把数据先转为十六进制格式并获取数据长度,再把数据转到发送缓冲区发送,否则ASCII码文本发送3.接收数据函数在串口运行时一直在判断是否有新数据,并根据不同的接收模式,加显不同格式的数据软件代码详细介绍:(74-92h)可用串口检测及下拉控件。
(96-109h)波特率下拉控件设置。
(113-121h)校验位下拉控件。
(125-131h)数据位下拉控件。
(135-141h)停止位下拉控件。
(145-155h)默认参数设置。
(159-162h)接收数据串口说明与启动。
(168-174h)关闭软件设置。
(176-180h)关闭窗口后先关闭线程再关闭进程。
(182-194h)定义串口各参数。
(197-281h)打开串口按钮回调函数,先判断是否有可用串口,没有则显示“无可用串口,无法打开”然后返回,有则继续判断当前是要打开串口还是关闭串口,若是需要打开串口则尝试设置串口参数并打开串口,打开串口失败会提示无法打开串口,打开串口成功则串口参数下拉控件变灰发送数据按钮点亮,判断自动发送控件如果被选中则打开串口后直接自动发送数据。
如果之前判断按钮回调是关闭串口,则进行关闭串口并配置相关参数。
(282-347h)CRC16查表法校验函数。
(349-357h)发送数据按钮回调及自动发送按钮回调。
(358-369h)发送数据线程配置。
(371-510h)发送数据函数,先判断是否正在发送数据,如不在发送则设置当前正在发送状态,后继续判断是写序列号模式还是串口调试模式,串口调试模式时先定义发送缓冲区和数组,再判断是否为16进制发送后进行对应进制转码,再尝试发送并刷新发送字节数。
说明V1.00VC0706串口调试工具使用说明Version 1.002008.02.29Notes1: The information is subject to change without notice. Before using this document, please confirm that this is the latest version.Notes2: Not all products and/or types are available in every country. Please check with a Vimicrosales representative for availability and additional information.2 of 35 Version 1.002008-3-19 2Important NoticeAll rights about this document belong to Vimicro Corporation (here after, refer as Vimicro). All rights are reserved.Vimicro and its subsidiaries reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. Customers should contact Vimicro’s sales department before purchasing the product described in this document. All products are sold subject to Vimicro’s terms and conditions of sale supplied at the time of order acknowledgment.Vimicro does not warrant or represent that any license, either explicit or implied, is granted under any Vimicro patent right, copyright, mask work right, or other Vimicro intellectual property right relating to any combination, machine, or process in which Vimicro products or services are used. Information published by Vimicro regarding third-party products or services does not constitute a license from Vimicro to use such products or service or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from Vimicro under the patents or other intellectual property of Vimicro.Vimicro semiconductor devices are intended for standard uses (such as office equipment, computers, industrial/communications/measuring equipment, and personal/home equipment). Customers using semiconductor devices for special applications (including aerospace, nuclear, military and medical applications) in which a failure or malfunction might endanger life or limb and which require extremely high reliability must contact our Sales Department first. If damage is caused by such use of our semiconductor devices without first consulting our Sales Department, Vimicro will not assume any responsibility for the loss.The contents of this document must not be reprinted or duplicated without written permission of Vimicro. Information and circuit diagrams in this document are only examples of device application. They are not intended to be used in actual equipment. Vimicro accepts no responsibility for infringement of patents or other rights owned by third parties caused by use of the information and circuit diagrams in this document.Reproduction of information in Vimicro data books or data sheets is permissible only if preproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. Vimicro is not responsible or liable for such altered documentation. Resale of Vimicro products or services with statements different from or beyond the parameters stated by Vimicro for that product or service voids all explicit and any implied warranties for the associated Vimicro product or service and is an unfair and deceptive business practice. Vimicro is not responsible or liable for any such statements.3 of 35 Version 1.002008-3-19 3目录目录 (3)文档说明 (4)功能介绍 (4)程序介绍 (5)按钮说明 (6)菜单说明 (6)串口配置 (7)“CONFIG”按钮说明 (7)“GET VERSION”按钮说明 (9)“R/W DATA”按钮说明 (9)“COLOR CTRL”按钮说明 (10)“MIRROR CTRL”按钮说明 (11)“POWER CTRL”按钮说明 (12)“TIME CTRL”按钮说明 (13)“AE MODE”按钮说明 (14)“SYSTEM RESET”按钮说明 (16)“MOTION CTRL”按钮说明 (16)“OSD CTRL”按钮说明 (20)“IMAGE PROPERTY PAGE”按钮说明 (26)“GAMMA”按钮说明 (27)“SPI FLASHE”菜单说明 (28)“UP/DOWN LOAD”按钮说明 (29)“OTHER CTRL”按钮说明 (31)“FBUF CTRL”按钮说明 (32)“ZOOM CTRL”按钮说明 (34)4 of 35 Version 1.002008-3-19 4文档说明本文档用于介绍VC0706串口工具的使用方法,对VC0706相关的技术细节不作介绍,但会指出如何获得相关的技术参考。
地址地址 功 能长度长度(字节)缺省值缺省值 功 能 描 述述0x0007CommunicationDevice0x010x01用于通讯命令的设备;可以用于通讯命令的设备有MCU 串口、高速串口和SPI 端口;1:表示使用MCU 串口 2:表示使用高速串口 3:表示使用SPI 口 0x0008 MCU UART BPS 0x020x2AF2MCU 串口的波特率;MCU 串口的时钟可以为27M 或者36M。
MCU 串口的时钟为27M 时,波特率与本控制项的关系如下所示:波特率 配置值 9600 0xAEC8 19200 0x56E438400 0x2AF2 (默认值) 57600 0x1C4C115200 0x0DA6 MCU 串口的时钟为36M 时,波特率与本控制项的关系如下所示:波特率 配置值 9600 0xE960 19200 0x7430 38400 0x3998 57600 0x2610 115200 0x1288 0x000A High Speed UART BPS 0x040x0298, 0x000E 高速串口的波特率;前两个字节用于设置高速串口的FRAC 寄存器;后两个字节用于设置高速串口的INTER 寄存器;计算公式如下所示:DIVISOR = CLK / (BAUD x 16)INTER = (Integer)DIVISOR FRAC=(Integer)((DIVISOR - INTER)*1024)其中:CLK 为高速串口模块时钟,取值为27M BAUD 为要设置的波特率INTER 的值写入INTER 寄存器 FRAC 的值写入FRAC 寄存器 Integer 表示取整操作常用波特率的INTER 和FRAC 对照表如下所示:波特率 INTER FRAC 38400 0x002B 0x03C8 57600 0x001D 0x0130 115200 0x000E 0x0298 460800 0x0003 0x02A6 921600 0x0001 0x0353 0x000E SPI BPS 0x040x000D, 0x0200SPI 口的波特率;前两个字节用于设置SPI 口的DIVIDER 寄存器;后两个字节用于设置SPI 口的SS 寄存器; 计算公式如下所示:DIVIDER = CLK/(2*BAUD) -1其中:CLK 为SPI 模块的时钟,取值为27M 或36MBAUD 为要设置的SPI 的波特率DIVIDER 为写入DIVIDER 寄存器的值 写入SS 寄存器的值默认为0x0200 常用波特率的INTER 和FRAC 对照表如下所示:SPI 模块时钟为27M 时:波特率 DIVIDER SS 0.844M 0x000F 0x0200 1.688M 0x0007 0x0200 3.375M 0x0003 0x0200 6.750M 0x0001 0x0200 13.500M 0x0000 0x0200 SPI 模块时钟为36M 时:波特率 DIVIDER SS 1.125M 0x000F 0x0200 2.250M 0x0007 0x0200 4.500M 0x0003 0x0200 9.000M 0x0001 0x0200 18.000M 0x0000 0x0200地址地址功 能长度长度(字节)缺省值缺省值功 能 描 述0x0019 Downsize 0x01 0x00用于设置从LBUF JPE 输出时缩放比例; Bit[1:0]:水平缩放比例:00:1:1,不做缩放01:1:2,缩小为原来的1/2 10:1:4,缩小为原来的1/4 11:预留Bit[3:2]:预留,设置为0 Bit[5:4]:垂直缩放比例;00:1:1,不做缩放01:1:2,缩小为原来的1/210:1:4,缩小为原来的1/411:预留Bit[7:6]:预留,设置为0注意:垂直缩放比例控制位设置的值不能大于水平缩放比例控制位设置的值;0x0016 Mode Gate Control 0x01 0x1E 控制硬件模块的时钟是否打开;这里配置的硬件模块是跟视频的Data Path无关的模块;如果模块的时钟打开了,则该模块工作;如果时钟关闭了,则模块不工作。
Open107V用户手册目录1. 硬件介绍 (2)1.1.资源简介 (2)2. 例程分析 (4)2.1. 8Ios (4)2.2. ADC+DMA (4)2.3. ADC+DMA+KEYPAD (5)2.4. CAN- Normal (5)2.5. DAC (6)2.6. ETH_LwIP (6)2.7. GPIO LED JOYSTICK (7)2.8. I2C (7)2.9. LCD (8)2.10. OneWire (9)2.11. PS2 (9)2.12. RTC (9)2.13. FATFS V0.08A-SD Card (10)2.14. SL811 USB (10)2.15. AT45DB-SPI (11)2.16. TouchPanel (11)2.17. uCOSII2.91+UCGUI3.90A (12)2.18. USART (13)2.19. USB_Host_HID_KBrd_Mouse (13)2.20. USB_ Host_MSC(efsl) (13)2.21. USB_Host_MSC(FATFS) (14)2.22. USB-JoyStickMouse (15)2.23. USB-Mass_Storage-MCU Flash (15)2.24. VS1003B (16)3. 版本修订 (16)1.硬件介绍1.1. 资源简介[ 芯片简介 ]1.STM32F107VCT6STM32功能强大,下面仅列出STM32F107VCT6的核心资源参数:内核:Cortex-M3 32-bit RISC;工作频率:72MHz,1.25 DMIPS/MHz;工作电压:2-3.6V;封装:LQFP100;I/O口:80;存储资源:256kB Flash,64kB RAM;接口资源:3 x SPI,3 x USART,2 x UART,2 x I2S,2 x I2C;1 x Ethernet MAC,1 x USB OTG,2 x CAN;模数转换:2 x AD(12位,1us,分时16通道),[ 其它器件简介 ]3."5V DC"或"USB"供电选择开关切换到上面,选择5V DC供电;切换到下面,选择USB供电。
串口调试助手VC60程序目次:1.建立项目那可能是你在安装VC6时没有把Active某一项选上,重新安装VC6,选上Active某就可以了),//{{AF某_INCLUDES()#include\(这时运行程序,如果有错,那就再从头开始)。
4.在对话框中添加控件向主对话框中添加两个编辑框,一个用于接收显示数据ID为IDC_EDIT_R某DATA,另一个用于输入发送数据,ID为IDC_EDIT_T某DATA,再添加一个按钮,功能是按一次就把发送编辑框中的内容发送一次,将其ID设为IDC_BUTTON_MANUALSEND。
别忘记了将接收编辑框的Propertie->Style中把Miltiline和VerticalScroll属性选上,发送编辑框若你想输入多行文字,也可选上Miltiline。
休息一会吧?我们天天与电脑打交道,要注意保重,我现在在单杠上做引体向上可以来40次,可我都32了,佩服吗?。
好了,再接着来,下面是关键了:{//TODO:AddyourcontrolnotificationhandlercodehereVARIANTvariant_inp;COleSafeArrayafearray_inp;LONGlen,k;BYTEr某data[2048];//设置BYTE数组An8-bitintegerthatinotigned.CStringtrtemp;afearray_inp=variant_inp;//VARIANT型变量转换为ColeSafeArray 型变量len=afearray_inp.GetOneDimSize();//得到有效数据长度for(k=0;kafearray_inp.GetElement(&k,r某data+k);//转换为BYTE型数组for(k=0;kBYTEbt=某(char某)(r某data+k);//字符型trtemp.Format(\将字符送入临时变量trtemp存放m_trR某Data+=trtemp;//加入接收编辑框对应字符串}}UpdateData(FALSE);//更新编辑框内容}到目前为止还不能在接收编辑框中看到数据,因为我们还没有打开串口,但运行程序不应该有任何错误,不然,你肯定哪儿没看仔细,因为我是打开VC6对照着做一步写一行的,运行试试。
VC(MFC)编写串口调试助手1.序确定基本功能:1.自动寻找串口,并自动添加到下拉框中共选择;2.有波特率、数据位、停止位、校验位的选择设置;3.串口打开控制按钮;4.发送、清除按钮;5.接收是自动实现的;6.有定时自动发送功能;7.有传送文件功能;8.有状态栏显示,指示串口状态,设置参数和发送接收显示。
下面就一步步实现,本人纯业余,只是记录下来这个学习过程,请勿拍砖。
开发平台Visual C++6.0英文版,电脑是i7-2670Q四核8G内存1G独显的笔记本,装的win7 64位旗舰版,因此VC6兼容不是太好,有些小毛病,不过不影响编写。
2.创建MFC项目File -> New -> Projects选择MFC AppWizard(exe),项目名称commassist选择OK选中Dialog based,点击Next> 。
默认选项,点击Next> ,继续默认选项,点击Next> ,如果选中As a statically linked library,生产的EXE可直接在没装VC的机器上运行。
可以在项目中进行更改。
选择第二个CCommassistDlg,点击Finish点击OK。
项目创建完毕,进入项目。
删除界面上确定和取消按钮以及静态文字。
3.创建界面保存后便可以开始创建界面了。
参考界面仿照设计的界面,具体添加按钮或编辑框等的布局步骤就不用细说了。
4.图标修改在资源视图中选择Icon右键InsertIcon加入打开和关闭的Icon图标或自行绘制,如下图IDR_MAINFRAME原为MFC提供的图标,这里我直接改成自己的,生成EXE后将会显示这个图标。
下面将帮助页面图标也改为自绘图标。
在打开按钮旁边加入自绘的打开和关闭图标:先加入工具条中的Picture,然后选中右键看属性,并如图将Image选为默认的IDI_ICON_CLOSE。
如下图5.基本设置下面对各个按钮及编辑框设置进行描述右键串口对应的Combo Box,ID设置为IDC_COMLIST,Type设置为Drop List,Sort不选择(我系统是WIN7 64位,不选中反而自动排序,至于XP得试试看了,以下的选择相同)。
OpenCNC_PLC發展工具操作手冊匯出日期:2023-05-10修改日期:2020-08-30英文文件 English Document: PLC Editor Operation Manual.Ladder-Editor 軟體操作介紹Ladder編寫開發PLC元件介紹操作手冊下載文件履歷1.2.•••• a.i.1 PLC 編輯器介紹1.1 軟體下載進入新代網站 ,完成線上注冊手續并確定權限開通。
至『下載中心』 => 『04.應用工具』 => 『Ladder Editor 』下載PLC 編輯器。
1.2 軟體安裝2.26.3(含)以前為安裝版執行LadEdit_vx.xx.x.msi 并依畫面指示,即可完成安裝程序。
安裝完成後,依序點選『開始』 => 『程式集』 => 『OpenCNC 』 => 『MLCEdit.exe 』,即可開啟PLC 編輯器。
2.29.0(含)以後為免安裝版第一次執行時:下載完LadEditor_x.xx.x.zip ,解壓縮後右鍵點擊『Install.bat 』,選擇『以系統管理員身分執行』,將.lad 檔的預設開啟程式設定為PLC 編輯器ii.b.c.i.ii.•••••••執行『MLCEdit.exe』開啟PLC編輯器第二次之後執行:執行『MLCEdit.exe』,或直接雙擊.lad檔,皆可開啟PLC編輯器注意事項:搬移免安裝包位置時,請再次執行免安裝包內的『Install.bat』,否則會無法正常開啟.lad檔。
下載新版本PLC編輯器時,請執行新版本免安裝包內的『Install.bat』,否則仍會以舊版PLC編輯器開檔。
1.3 介面操作PLC編輯器介面共有七個區域,如下圖所示:下拉式功能區指令按鈕功能區指令區程式管理區指令編輯區元件注解區元件索引區下拉式功能區指令按鈕功能區指令區指令區提供各種元件讓使用者選取、應用,詳細說明請參閱後續章節。
Ashcroft Inc. 250 East Main Street, Stratford, CT 06614 USA Tel: 203-378-8281, Fax: 203-385-0402 Installation and Maintenance Instructions for Serial Communication AdaptersDisclaimerThe information contained in this document issubject to change without notice. Ashcroft makes no representations or warranties with respect tothe contents hereof, and specifically disclaimsany implied warranties of merchantability orfitness for a particular purpose. See WarrantyInformation and Terms & Conditions on for complete details.•Read complete instructions prior to installation and operation of the meter.•Risk of electric shock or personal injury.•These products are not recommended for life support applications or applications wheremalfunctioning could result in personal injury orproperty loss. Anyone using these products forsuch applications does so at his/her own risk.Ashcroft, Inc. shall not be held liable for damagesresulting from such improper use.WARNINGCancer and Reproductive Harm - Limited WarrantyAshcroft, Inc. warrants these products againstdefects in material or workmanship for the specified period under “Specifications” from the date ofshipment from the factory. Ashcroft’s liability under this limited warranty shall not exceed the purchase value, repair, or replacement of the defective unit.See Warranty Information and Terms & Conditions on for complete details.Registered TrademarksAll trademarks mentioned in this document are the property of their respective owners.© 2020 Ashcroft, Inc.All rights reserved. IntroductionAshcroft provides an assortment of serial communications adapters and converters to enhance the utility of its products. These external devices connect to the RJ11 / RJ45 header at the back of the instrument and allow the meter to communicate over RS-232, RS-485 or USB.Table of ContentsIntroduction (2)Ordering Information (2)Specifications (4)General (All) (4)101B224-06 RS-232 Adapter (4)101B224-07 RS-485 Adapter (4)101B224-08 USB Adapter (4)101B224-09 USB to RS-232 Converter (4)USB Drivers for Serial Communications Adapters (4)DIN Rail Mounting Instructions (5)Serial Communications Overview (6)101B224-06 RS-232 Serial Adapter (7)Description (7)Installation (7)Connections (7)101B224-07 RS-485 Serial Adapter (8)Description (8)Installation (8)Connections (8)101B224-08 USB Serial Adapter (9)Description (9)Installation (9)101B224-09 USB to RS-232 Converter (9)Description (9)Installation (9)Troubleshooting (10)Table of FiguresFigure 1. DIN Rail Clips Mounted to Expansion Module (5)Figure 2. Hinge & Latch End of DIN Rail Clip (5)Figure 3. DIN Rail Clips Mounted to Module (5)Figure 4. Examples of Clips Mounted to Modules (5)Figure 5. Mounting the DIN Rail with 2 #10 Pan Head Screws (5)Figure 6. Examples of Modules Mounted to DIN Rail (5)Figure 7. Snapping the Module to the DIN Rail (5)Figure 8. Typical Installation of DIN Rail Mounted Devices (5)Figure 9. General Four-Wire Network Connections (6)Figure 10. General Two-Wire Network Connections (6)Figure 11. RS-232 Adapter Connections (7)Figure 12. RS-422 or RS-485 Wiring (8)Figure 13. RS-485 Two-Wire Multi-Drop Wiring (8)Figure 14. Connections for 101B224-07 to Serial Converter (8)Figure 28. USB Adapter Connections (9)Figure 29. Connections for 101B224-09 to serial device (9)SpecificationsGeneral (All)Warranty 1 year parts & labor. See WarrantyInformation and Terms & Conditions on for complete details.101B224-06 RS-232 Adapter Compatibility EIA-232Connectors PC compatible 9-pin D subminiatureconnector (DB9) and RJ45 (adapter tometer)Cable 6' (1.8 m) standard Cat5e cableprovided with adapterDimension 1.7" x 0.9" x 2.7"(43 mm x 24 mm x 70 mm)(W x H x D)Distance Adapter to:DM61 meter: 6' (1.8 m) max;Computer: 50' (15 m) max;Serial interface cable not provided Power Powered by DM61 meter M-LinkconnectionStatus Indication Separate LEDs for Power (P)Transmit (TX), and Receive (RX).101B224-07 RS-485 Adapter Compatibility EIA-485Connectors Removable screw terminal connectorand RJ11 (adapter to meter)Cable 6' (1.8 m) standard Cat5e cableprovided with adapterDimension 1.7" x 0.9" x 3.0"(43 mm x 24 mm x 76 mm)(W x H x D)Distance Adapter to:DM61 meter: 6' (1.8 m) max;Computer: 3,937' (1,200 m) max Power Powered by DM61meter M-LinkconnectionStatus Indication Separate LEDs for Power (P),Transmit (TX), and Receive (RX) 101B224-08 USB AdapterPurpose Programming (only) DM61 meter whenmeter powered from AC or DC. Compatibility USB 1.1, USB 2.0Connectors RJ45, and USB Type BCable One 6' (1.8 m) standard Cat5e cableand one 3.28' (1.0 m) USB A-B Malecable provided with adapter Dimension 1.7" x 0.8" x 3.3"43 mm x 21 mm x 83 mm)(W x H x D)Distance Adapter to:DM61 meter: 6' (1.8 m) max.USB connection: 10' (3 m) maxDriverCompatibilityWin 98/2000/ME/XP/Vista/7/8/10 Power USB PortStatus Indication Separate LEDs for Power (P),Transmit (TX), and Receive (RX) 101B224-09 USB to RS-232 ConverterCompatibility USB 1.1, USB 2.0, EIA-232 Connectors PC compatible 9-pin D subminiatureconnector (DB9) and USB Type A Dimension 3' (91.44 cm) (Length)Distance USB connection: 10' (3 m) max;RS-232 connection: 50' (15m) max DriverCompatibilityWin 98/2000/ME/XP/Vista/7/8/10 Power USB portUSB Drivers for Serial Communications AdaptersUSB Drivers for serial communications adapters are available for download from the Documentation CD provided with every product.DIN Rail Mounting InstructionsThe following instructions for expansion modules may be used for mounting the converters and adapters to DIN rails.Step 1: Mounting the DIN Rail Clips to ModulePlace the expansion module on a flat surface with the bottom surface facing up. The bottom surface can be identified as the surface closest to the locking tab slot on the modular connector as shown in Figure 1.Figure 1. DIN Rail Clips Mounted to Expansion Module Peel the protective layer off the adhesive tape on the bottom of one of the mounting clips. With the hinge end of the clip, as shown in Figure 2, facing the end of the module with thecommunications connector, align the clip along the long (side) edge of the module and centered lengthwise within the flat surface of the module as shown in Figure 3.Figure 2. Hinge & Latch End of DIN Rail ClipFigure 3. DIN Rail Clips Mounted to ModuleFirmly press down on the clip for 10 seconds. Repeat this procedure on the opposite side. Once the clips are properly installed, the modules with clips mounted should look similar to one or both of the modules pictured in Figure 4. While the adhesive is initially quite strong, this strength improves significantly over a period of approximately 12 hours.Figure 4. Examples of Clips Mounted to ModulesStep 2: Mounting the DIN Rail to a SurfaceThe expansion modules, serial adapters and serial converters weigh approximately 1.5 oz (42 grams) each so the mounting hardware does not need to be overly strong. We recommend two #10 pan head screws as shown in Figure 5, but onlybecause they best accommodate the slots in the DIN rail. The amount of strain the wiring might place on the modulemounting needs to be considered also. In many cases, DIN rail with double-sided tape might be acceptable, although notrecommended in areas of high vibration or extreme hot or cold temperatures.Figure 5. Mounting the DIN Rail with 2 #10 Pan Head Screws When choosing a location to mount the DIN rail, keep in mind that wires will be entering both ends of the modules as shown in Figure 6. Leave enough room on either end of module to allow for wire routing to prevent undue stress placed on the module’s connectors and mounting clips. The DIN rail may be mounted on any vertical or horizontal mounting surface.Figure 6. Examples of Modules Mounted toDIN RailStep 3: Mounting Modules to the DIN RailTo mount modules to a DIN rail, first locate the approximate desired position to place the module on the DIN rail, then hook the hinge end of the mounting clip to the edge of the DIN rail as shown in Figure 7. Next lower the opposite “latch end” of the clip onto the rail. Press down on the module until the latch end snaps in place.Figure 7. Snapping the Module to the DIN RailA typical installation will look like Figure 8 once modules are mounted to the DIN rail.Figure 8. Typical Installation of DIN Rail Mounted DevicesStep 4: ConnectionsAfter mounting the device(s), refer to the Instruction Manual foreach module for proper connections and operation.Hinge EndLatch EndSerial Communications OverviewRS-232 and RS-485 are standard interfaces approved by the Electronic Industries Alliance (EIA) for connecting serial devices. In EIA terms, the device (e.g. meter) that connects to the interface is called a Data Communications Equipment (DCE) and the device to which it connects (e.g. the computer) is called a Data Terminal Equipment (DTE).The RS-422 standard was designed to replace the older RS-232 standard because it supports higher data rates and greater immunity to electrical interference. RS-485 is similar to RS-422 but can support multi-point connections per line because it uses lower-impedance drivers and receivers.Line drivers and receivers are used to exchange data between two or more points (nodes) on a serial communications network. Reliable data communications can be difficult in the presence of induced noise, ground level differences, and other hazards associated with installation of a network. When communicating at high data rates, or over long distances in real world environments, RS-232 is often inadequate. The differential data transmission of RS-422 and RS-485 offers superior performance in most applications. Differential signals can help nullify the effects of ground shifts and induced noise signals that can appear as common mode voltages on a network. RS-422 was designed for greater distances and higher baud rates than RS-232. In its simplest form, a pair of converters from RS-232 to RS-422 (and back again) can be used to form an “RS-232 extension cord”. Data rates of up to 100 kbits/second and distances of 3,937' (1,200 m) can be accommodated with RS-422.RS-422 devices however cannot be used to construct a true multi-point network. A multi-point network consists of multiple drivers and receivers connected on a single bus, where any point (node) can transmit and/or receive data. RS-485 is an enhanced version of the RS-422 standard, which allows multiple drivers and receivers on the same two-wire or four-wire system. The RS-485 standard specifies up to 32 drivers and 32 receivers on a single bus, but with the introduction of “automatic”repeaters and high-impedance drivers/receivers, this number can be extended to hundreds of points (nodes) on a network.The cabling used for an RS-422 or RS-485 serial communications network should always be a high-quality cable such as Belden 8162 or Alpha 6203C.A two-wire system requires two twisted pairs, and a four-wire system requires three twisted pairs (the extra twisted pair is needed for the signal ground). Figure 9 illustrates how to connect a general four-wire network (a four-wire network actually contains 5 wires).Figure 9. General Four-Wire Network Connections Figure 10 illustrates how to connect a general two-wire network (a two-wire network actually contains 3 wires).Figure 10. General Two-Wire Network Connections101B224-06 RS-232 Serial AdapterDescriptionThe 101B224-06 converts the serial output of the DM61 meter to an unbalanced, full-duplex RS-232 signal.The RS-232 port has a female DB9 connector with pins 2 (RX output), 3 (TX input), and 5 (Signal Ground). Pins 7 (RTS) and 8 (CTS) are tied together, and pins 1 (CD), 4 (DTR), and 6 (DSR) are tied together. The adapter is powered by the DM61 meter M-Link connection.Baud rates are adjustable and handled by the DM61 (see the DM61 Instruction Manual for more details). The 101B224-06 has three diagnostic LEDs: a Power (P) LED to show when the adapter is powered properly, a Transmit Data (TX) LED to show when the adapter is sending data out from the PC side, and a Receive Data (RX) LED to show when the adapter is receiving data from the DM61 meter. InstallationFigure 11 shows the connection of a DM61 meter to a PC using the 101B224-06 serial adapter. The 101B224-06 has an RJ45 connector to connect the Cat5e cable and a PC compatible 9-pin D subminiature connector (DB9). The DB9 can be connected directly to the PC or by using a standard serial extension cable.Figure 11. RS-232 Adapter Connections ConnectionsA Cat5e cable is provided to connect the DM61 meter to the 101B224-06 serial adapter.101B224-07 RS-485 Serial AdapterDescriptionThe 101B224-07 converts the serial output of the DM61 meter to balanced, full or half-duplex RS-485 signals. The 101B224-07 has a removable screw terminal connector for the RS-485 terminals which includes Transmit Data (DO) and (/DO), Receive Data (DI) and (/DI), and Signal Ground. The adapter is provided by the DM61 meter M-Link connection.Baud rates are adjustable and handled by the DM61 (see the DM61 Instruction Manual for more details). The 101B224-07 has three diagnostic LEDs: a Power (P) LED to show when the adapter is powered properly, a Transmit Data (TX) LED to show when the adapter is sending data out from the PC side, and a Receive Data (RX) LED to show when the adapter is receiving data from the DM61 meter.InstallationFigure 12 shows the connection of a DM61 meter to a PC using the 101B224-07 serial adapter and an RS-232 to RS-485 converter in an RS-422 network. The101B224-07 has an RJ45 connector to connect theCat5e cable and a screw terminal connector to connect to the RS-422 network.Figure 13 shows the connection of DM61 meters with 101B224-07 serial adapters to a PC using anRS-232 to RS-485 converter in an RS-485 network.Figure 12. RS-422 or RS-485 Wiring Notes:1. Termination resistors are optional and valuesdepend on the cable length and characteristicimpedance. Consult the cable manufacturer forrecommendations.2. Use shielded cable, twisted-pairs plus ground.Connect ground shield only at one location.Figure 13. RS-485 Two-Wire Multi-Drop Wiring Notes:1. Termination resistors are optional and valuesdepend on the cable length and characteristicimpedance. Consult the cable manufacturer forrecommendations.2. Use shielded cable, twisted-pair plus ground.Connect ground shield only at one location. ConnectionsA Cat5e cable is provided to connect the DM61 meter to the 101B224-07 adapter.Figure 14 details the wiring connections from the101B224-07 to an RS-485 serial converter for a four-wire network.If the serial converter is configured for a two-wire network, then the requirement to externally wire the DO to the DI and the /DO to the /DI on the 101B224-07 screw terminal connector is needed.101B224-08 USB Serial AdapterDescriptionThe 101B224-08 USB Serial Adapter allows for direct connection of a DM61 Series meter to the USB port of a PC. It is intended only for programming the meter when the meter is powered from AC or DC. Otherwise the USB cable provided with the meter can be used.InstallationFigure 15 shows the connection of a DM61 meter to a PC using a 101B224-08 USB Serial Adapter.Driver DownloadUSB Drivers are available for download from the Documentation CD provided with every product.101B224-09 USB to RS-232 ConverterDescriptionThe 101B224-09 USB to RS-232 Converter allows for direct connection of a serial device to the USB port of a PC.InstallationFigure 16 shows the connection of a DM61 meter to a PC using a 101B224-09 USB to RS-232 Converter, 101B224-06 RS-232 adapter, and the included Cat5e Cable.Figure 16. Connections for 101B224-09 to serial deviceDriver DownloadUSB Drivers are available for download from the Documentation CD provided with every product.TroubleshootingAshcroft Inc. 250 East Main Street, Stratford, CT 06614 USA Tel: 203-378-8281, Fax: 203-385-0402 All sales subject to standard terms and conditions of sale.© 2021 Ashcroft Inc. 2021 I&M – 10/21LIM7232DI_B10/21。
纯业余者用V C(M F C)编写串口调试助手序毕业到现在,转眼就做射频开发10年了,一直从事直放站、干放等通信边缘行业,从低噪放、锁相源、选频、功放到整机,射频就那么点东西,而且越来越集成化,软件无线电是必然趋势。
做射频从业面会越来越窄,我知道所有人都会说,当你成为专家的时候,一切就都不是问题,可有几个真正的专家,再者说,射频需要经验的积累,只有实际项目做的越多越广,经验也就积累得越多,并不是一朝一夕能达到的。
前不久突然觉得,我的射频模块控制要是也是自己来编程控制多好啊!那就得学单片机编程,学习上位机编程了,可我都不会啊,要不就先来整整上位机,windows方面的。
大学唯一学的编程语言是C语言,可根本不能理解用C做什么,还都还给老师10多年了,这怎么办?从BASIC,C/C++,JAVA,PASCAL 搜索了一圈,还是选C++吧,毕竟是C语言发展而来,用VC环境,身边有可以请教的人。
在网上转悠了很久,发现《windows程序设计》是必看,《MFCWindows程序设计》是学MFC最经典的书籍。
OMG,这些书啊,都是上千页的,白天都在上班,哪有时间看哦,只有先下载下来作为参考资料了。
扯远了啊。
这也不行那也不行,怎么办呢?干脆硬着头皮上吧,找几个实例照搬,再修修改改加深理解吧。
第一个目标,自己编写个串口调试助手,掌握串口通信编程,这样上位机的编写就有希望了。
好了,目标定下来了。
网上下载了个串口调试助手,确定基本功能:1.自动寻找串口,并自动添加到下拉框中共选择;2.有波特率、数据位、停止位、校验位的选择设置;3.串口打开控制按钮;4.发送、清除按钮;5.接收是自动实现的;6.有定时自动发送功能;7.有传送文件功能;8.有状态栏显示,指示串口状态,设置参数和发送接收显示。
下面就一步步实现,本人纯业余,只是记录下来这个学习过程,请勿拍砖。
?开发平台VisualC++6.0英文版,电脑是i7-2670Q四核8G内存1G独显的笔记本,装的win764位旗舰版,因此VC6兼容不是太好,有些小毛病,不过不影响编写。
Rev. 0.3 5/14Copyright © 2014 by Silicon LaboratoriesC8051F326/7EVELOPMENT IT SER S UIDE1. Kit ContentsThe C8051F326/7 Development Kit contains the following items:•C8051F326 Target Board•C8051Fxxx Development Kit Quick-Start Guide •USB Cable•AC to DC Power Adapter•USB Debug Adapter (USB to Debug Interface)•USB Cable2. Hardware Setup using a USB Debug AdapterThe target board is connected to a PC running the Silicon Laboratories IDE via the USB Debug Adapter as shown in Figure 1.1.Connect the USB Debug Adapter to the DEBUG connector on the target board with the 10-pin ribbon cable.2.Connect one end of the USB cable to the USB connector on the USB Debug Adapter.3.Connect the other end of the USB cable to a USB Port on the PC.4.Connect the ac/dc power adapter to power jack P1 on the target board.Notes:•Use the Reset button in the IDE to reset the target when connected using a USB Debug Adapter.•Remove power from the target board and the USB Debug Adapter before connecting or disconnecting the ribbon cable from the target board. Connecting or disconnecting the cable when the devices have power can damage the device and/or the USB Debug Adapter.Figure 1.Hardware Setup using a USB Debug AdapterPWRP1.6C8051F326/73. Software SetupSimplicity Studio greatly reduces development time and complexity with Silicon Labs EFM32 and 8051 MCU products by providing a high-powered IDE, tools for hardware configuration, and links to helpful resources, all in one place.Once Simplicity Studio is installed, the application itself can be used to install additional software and documentation components to aid in the development and evaluation process.Figure 2.Simplicity StudioThe following Simplicity Studio components are required for the C8051F326 Development Kit:⏹ 8051 Products Part Support ⏹ Simplicity Developer PlatformDownload and install Simplicity Studio from /8bit-software or /simplicity-studio .Once installed, run Simplicity Studio by selecting Start →Silicon Labs →Simplicity Studio →Simplicity Studio from the start menu or clicking the Simplicity Studio shortcut on the desktop. Follow the instructions to install the software and click Simplicity IDE to launch the IDE.The first time the project creation wizard runs, the Setup Environment wizard will guide the user through the process of configuring the build tools and SDK selection.In the Part Selection step of the wizard, select from the list of installed parts only the parts to use during development. Choosing parts and families in this step affects the displayed or filtered parts in the later device selection menus. Choose the C8051F326/7 family by checking the C8051F32x check box. Modify the part selection at any time by accessing thePart Management dialog from the Window →Preferences →Simplicity Studio →Part Management menu item.Simplicity Studio can detect if certain toolchains are not activated. If the Licensing Helper is displayed after completing the Setup Environment wizard, follow the instructions to activate the toolchain.C8051F326/73.1. Running BlinkyEach project has its own source files, target configuration, SDK configuration, and build configurations such as the Debug and Release build configurations. The IDE can be used to manage multiple projects in a collection called a workspace. Workspace settings are applied globally to all projects within the workspace. This can include settings such as key bindings, window preferences, and code style and formatting options. Project actions, such as build and debug are context sensitive. For example, the user must select a project in the Project Explorer view in order to build that project.To create a project based on the Blinky example:1. Click the Software Examples tile from the Simplicity Studio home screen.2. In the Kit drop-down, select C8051F326 Development Kit , in the Part drop-down, select C8051F326, and in the SDK drop-down, select the desired SDK. Click Next .3. Select Example and click Next .4. Under C8051F326 Development Kit in the Blinky folder, select F326-7 BlinkyC and click Next , then Finish .5. Click on the project in the Project Explorer and click Build , the hammer icon in the top bar. Alternatively, go to Project →Build Project .6. Click Debug to download the project to the hardware and start a debug session.7. Press the Resume button to start the code running. The LED should blink.8. Press the Suspend button to stop the code.9. Press the Reset the devicebutton to reset the target MCU.10. Press the Disconnect button to return to the development perspective.3.2. Simplicity Studio HelpSimplicity Studio includes detailed help information and device documentation within the tool. The help containsdescriptions for each dialog window. To view the documentation for a dialog, click the question mark icon in the window:This will open a pane specific to the dialog with additional details.The documentation within the tool can also be viewed by going to Help →Help Contents or Help →Search .C8051F326/74. Target BoardThe C8051F326/7 Development Kit includes a target board with a C8051F326 device pre-installed for evaluation and preliminary software development. Numerous input/output (I/O) connections are provided to facilitate prototyp-ing using the target board. Refer to Figure3 for the locations of the various I/O connectors.P1Power connector (accepts input from 7 to 15 VDC unregulated power adapter)J122-pin Expansion I/O connectorJ2Power Target Board from power adapter at P1J3Port I/O Configuration connectorJ4DEBUG connector for Debug Adapter interfaceJ5DB-9 connector for UART0 RS232 interfaceJ7VIO to VDD connectorJ8USB Debug Adapter target board power connectorJ9USB connector for USB interfaceJ10External CMOS oscillator connectorJ11Power Target Board from USB at J9Figure3.C8051F326 Target BoardC8051F326/74.1. System Clock SourcesThe C8051F326 device installed on the target board features a calibrated programmable internal oscillator which is enabled as the system clock source on reset. After reset, the internal oscillator operates at a frequency of 1.5MHz (±1.5%) by default but may be configured by software to operate at other frequencies. Therefore, in many applica-tions an external oscillator is not required. However, if you wish to operate the C8051F326 device at a frequency not available with the internal oscillator, an external CMOS oscillator may be used. Refer to the C8051F326/7 datasheet for more information on configuring the system clock source.The target board is designed to facilitate the installation of an external CMOS oscillator. Remove shorting block at header J10 and connect the oscillator output to the header. Refer to the C8051F326/7 datasheet for more informa-tion on the use of external oscillators.4.2. Switches and LEDsThree switches are provided on the target board. Switch S1 is connected to the /RST pin of the C8051F326. Press-ing S1 puts the device into its hardware-reset state. Switches S2 and S3 are connected to the C8051F326’s gen-eral purpose I/O (GPIO) pins through headers. Pressing S2 or S3 generates a logic low signal on the port pin. Remove the shorting blocks from the header to disconnect S2 and S3 from the port pins. The port pin signals are also routed to pins on the J1 I/O connector. See Table1 for the port pins and headers corresponding to each switch.Three LEDs are also provided on the target board. The red LED labeled PWR LED is used to indicate a power con-nection to the target board. The green surface mount LEDs labeled with port pin names are connected to the C8051F326’s GPIO pins through headers. Remove the shorting blocks from the header to disconnect the LEDs from the port pin. The port pin signals are also routed to pins on the J1 I/O connector. See Table1 for the port pins and headers corresponding to each LED.Table 1. Target Board I/O DescriptionsDescription I/O HeaderS1Reset noneS2P2.0J3[1–2]S3P2.1J3[3–4]Green LED (D4)P2.2J3[5–6]Green LED (D2)P2.3J3[7–8]Red LED PWR none4.3. Universal Serial Bus (USB) Interface (J9)A Universal Serial Bus (USB) connector (J9) is provided to facilitate connections to the USB interface on the C8051F326. Table2 shows the J9 pin definitions.Table 2. J9 USB Connector Pin DescriptionsPin #Description1VBUS2D–3D+4GND (Ground)C8051F326/74.4. Expansion I/O Connector (J1)The 22-pin Expansion I/O connector J1 provides access to all signal pins of the C8051F326 device. Pins for +3V, and digital ground are also available. A through-hole prototyping area is also provided. Each connection point is labeled indicating the signal available at the connection point. See Table3 for a list of pin descriptions for J1.Table 3. J1 Pin DescriptionsPin #Description Pin #Description1P0.012P2.32P0.113P2.43P0.214P2.54P0.315P3.05P0.416C2CK/RST6P0.517VREGIN7P0.618VIO8P0.719VBUS9P2.020VDD10P2.121+3VD11P2.222GND4.5. USB Self-powered ConfigurationThe C8051F326 target board can be powered from three different sources. The sources are the ac/dc adapter (P1), USB connection (J9), and the USB Debug adapter (J4). Only one power source should be enabled at any time. See Section 4.8. for infomation on using the USB Debug Adapter as a power source for the board.The C8051F326 target board can be configured as a self-powered USB device to take power from the USB cable at J9 instead of the ac/dc adapter connected at P1. To configure the target boards as a self-powered USB device, remove the shorting block from J2 and install on J11. (A shorting block should only be installed on J2 or J11, never both at the same time.) Install shorting blocks in the following manner:J2(ON) & J11(OFF) →Target Board is powered from the ac/dc Adapter (P1).J2(OFF) & J11(ON) →Target Board is powered from the USB connection (J9)Notes:•When the C8051F326 target board is self-powered from the USB connection (J9), the EC2 Serial Adapter is not powered from the target board. The EC2 Serial Adapter must be powered directly by connecting the ac/ dc adapter to the Serial Adapter’s dc power jack.•The RS232 Serial Interface (J5) cannot be used when powering the target board from the USB connection (J9).C8051F326/74.6. Target Board DEBUG Interface (J4)The DEBUG connector (J4) provides access to the DEBUG (C2) pins of the C8051F326. It is used to connect the Serial Adapter or the USB Debug Adapter to the target board for in-circuit debugging and Flash programming. Table4 shows the DEBUG pin definitions.Table 4. DEBUG Connector Pin DescriptionsPin #Description1+3VD(+3.3VDC)2, 3, 9GND (Ground)4C2D5/RST(Reset)6P3.07C2CK8Not Connected10USB Power4.7. Serial Interface (J5)A RS232 transceiver circuit and DB-9 (J5) connector are provided on the target board to facilitate serial connec-tions to UART0 of the C8051F326. The TX, RX, RTS and CTS signals of UART0 may be connected to the DB-9 connector and transceiver by installing shorting blocks on header J3.J3[9–10]- Install shorting block to connect UART0 TX (P0.4) to the transceiver.J3[11–12]- Install shorting block to connect UART0 RX (P0.5) to the transceiver.J3[13–14]- Install shorting block to connect UART0 RTS (P2.4) to the transceiver.J3[15–16]- Install shorting block to connect UART0 CTS (P2.5) to the transceiver.4.8. USB Debug Adapter Target Board Power Connector (J8)The USB Debug Adapter includes a connection to provide power to the target board. This connection is routed from J4[10] to J8[1]. Place a shorting block at header J8[2-3] to power the board directly from an ac/dc power adapter. Place a shorting block at header J8[1–2] to power the board from the USB Debug Adapter. Please note that the second option is not supported with either the EC1 or EC2 Serial Adapters.C8051F326/7C8051F326/7C8051F326/7D OCUMENT C HANGE L ISTRevision 0.1 to Revision 0.2⏹ Removed EC2 Serial Adapter from Kit Contents.⏹ Removed Section 2. Hardware Setup using an EC2 Serial Adapter. See RS232 Serial Adapter (EC2)User's Guide.⏹ Removed Section 8. EC2 Serial Adapter. See RS232 Serial Adapter (EC2) User's Guide.⏹ Removed Section 9. USB Debug Adapter. See USB Debug Adapter User's Guide.Revision 0.2 to Revision 0.3⏹ Updated "Software Setup‚" on page 2.DisclaimerSilicon Laboratories intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Laboratories products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Laboratories reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Laboratories shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products must not be used within any Life Support System without the specific written consent of Silicon Laboratories. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Laboratories products are generally not intended for military applications. Silicon Laboratories products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons.Trademark InformationSilicon Laboratories Inc., Silicon Laboratories, Silicon Labs, SiLabs and the Silicon Labs logo, CMEMS®, EFM, EFM32, EFR, Energy Micro, Energy Micro logo and combinations thereof, "the world’s most energy friendly microcontrollers", Ember®, EZLink®, EZMac®, EZRadio®, EZRadioPRO®, DSPLL®, ISOmodem ®, Precision32®, ProSLIC®, SiPHY®, USBXpress® and others are trademarks or registered trademarks of Silicon Laboratories Inc. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders. Silicon Laboratories Inc.400 West Cesar ChavezAustin, TX 78701USAIoT Portfolio/IoT SW/HW /simplicity Quality /quality Support and Community 。
USR-G760c 3G DTU说明书目录USR-G760c说明书 (1)1. 快速入门 (3)1.1. 模块测试硬件环境 (3)1.2. 数据传输测试 (3)2. 产品概述 (5)2.1. 产品简介 (5)2.2. 产品特点 (5)2.3. 模块基本参数 (5)2.4. 硬件描述 (6)2.5. 尺寸描述 (6)2.6. 订货信息 (7)3. 产品功能 (7)3.1. 基本参数设置 (8)3.2. 工作模式 (9)3.2.1. 短信透传模式 (9)3.2.2. 网络透传模式 (9)3.2.3. HTTPD Client模式 (9)3.3. UART成帧机制 (10)3.3.1. 时间触发模式 (10)3.3.2. 长度触发模式 (10)3.4. 特色功能 (11)3.4.1. 注册包功能 (11)3.4.2. 同步串口波特率功能 (11)3.4.3. 心跳包功能 (11)3.4.4. 状态指示灯 (11)3.4.5. 硬件恢复出厂设置 (11)4. AT指令 (12)4.1. 切换指令模式 (12)4.2. 指令格式 (13)4.3. AT指令集 (15)5. 免责声明 (16)6. 更新历史 (16)1. 快速入门本章是针对USR-G760c系列产品的快速入门介绍,建议用户系统的阅读本章并按照指示操作一遍,将会对模块产品有一个系统的认识,用户也可以根据需要选择你感兴趣的章节阅读。
针对特定的细节和说明,请参考后续章节。
也可以将问题提交到我们的客户支持中心:1.1. 模块测试硬件环境1.2. 数据传输测试1. 使用电源适配器给DTU供电,将DTU参数恢复至默认值。
恢复方法请参考3.4.5章节。
2. 打开有人的USR-G760设置软件,设置正确的串口参数,并启动串口。
3. 在软件左侧即“串口操作测”的发送框内输入,点击发送按钮,然后会在串口数据接收框内接收到。
说明:在默认参数中socket A被设置为TCP Client,目标地址为,目标端口为2317。
深入浅出VC++串口编程在PC机的主板上,有一种类型的接口可能为我们所忽视,那就是RS-232C串行接口,在微软的Windows系统中称其为COM。
我们可以通过设备管理器来查看COM的硬件参数设置,如图1。
图1 在Windows上查看PC串口设置迄今为止,几乎每一台PC都包含COM。
本质而言,COM是PC为和外界通信所提供的一种串行数据传输的接口。
作为一种物理通信的途径和设备,它和目前风靡的另一种串行接口――USB所提供的功能是一致的。
不过RS-232C显然已经开始被后起之秀USB赶超,因为USB的传输速率已经远远超过了RS-232C。
尽管如此,RS-232C仍然具有非常广泛的应用,在相对长的一段时间里,难以被USB 等接口取代。
RS-232C接口(又称EIA RS-232C),1970年由美国电子工业协会(EIA)联合贝尔系统、调制解调器厂家及计算机终端生产厂家共同制定,全名是"数据终端设备(DTE)和数据通讯设备(DCE)之间串行二进制数据交换接口技术标准"。
本文将对这一接口进行硬件原理的介绍,随后我们将逐章学习DOS平台的串口编程,及Windows平台下基于API、控件和第三方类的串口编程,最后本文将给出一个综合实例。
硬件原理众所周知,CPU与存储芯片和I/O芯片的通信是并行的(并行传输的最大位数依赖于CPU的字长、数据总线的宽度),一种叫做UART(通用异步收发器,Universal Asynchronous Receiver/Transmitter)的芯片提供了并行数据传输和RS-232C串行数据传输方式的转换。
这样的设备通常有如图2所示的管脚分布,当其向外传输数据时,CPU并行的将数据写入这类芯片的寄存器,UART再将寄存器中的数据一位一位地移动并向外传输;当外界向其传输数据时,UART一位一位地接收数据,并将其移位组合为并行数据,CPU再并行地读取这些数据。
实际上,由于UART芯片一般以TTL/CMOS电平工作,在UART连接接口之前,还要经过一个TTL/CMOS和RS-232C电平的转换。
一、原理简介51 单片机内部有一个全双工串行接口。
什么叫全双工串口呢?一般来说,只能接受或只能发送的称为单工串行;既可接收又可发送,但不能同时进行的称为半双工;能同时接收和发送的串行口称为全双工串行口。
串行通信是指数据一位一位地按顺序传送的通信方式,其突出优点是只需一根传输线,可大大降低硬件成本,适合远距离通信。
其缺点是传输速度较低。
与之前一样,首先我们来了解单片机串口相关的寄存器。
SBUF 寄存器:它是两个在物理上独立的接收、发送缓冲器,可同时发送、接收数据,可通过指令对SBUF 的读写来区别是对接收缓冲器的操作还是对发送缓冲器的操作。
从而控制外部两条独立的收发信号线RXD(P3.0)、TXD(P3.1),同时发送、接收数据,实现全双工。
串行口控制寄存器SCON(见表1)。
表1 SCON寄存器表中各位(从左至右为从高位到低位)含义如下。
SM0 和SM1 :串行口工作方式控制位,其定义如表2 所示。
表2 串行口工作方式控制位其中,fOSC 为单片机的时钟频率;波特率指串行口每秒钟发送(或接收)的位数。
SM2 :多机通信控制位。
该仅用于方式2 和方式3 的多机通信。
其中发送机SM2 =1(需要程序控制设置)。
接收机的串行口工作于方式2 或3,SM2=1 时,只有当接收到第9 位数据(RB8)为1 时,才把接收到的前8 位数据送入SBUF,且置位RI 发出中断申请引发串行接收中断,否则会将接受到的数据放弃。
当SM2=0 时,就不管第位数据是0 还是1,都将数据送入SBUF,并置位RI 发出中断申请。
工作于方式0 时,SM2 必须为0。
REN :串行接收允许位:REN =0 时,禁止接收;REN =1 时,允许接收。
TB8 :在方式2、3 中,TB8 是发送机要发送的第9 位数据。
在多机通信中它代表传输的地址或数据,TB8=0 为数据,TB8=1 时为地址。
RB8 :在方式2、3 中,RB8 是接收机接收到的第9 位数据,该数据正好来自发送机的TB8,从而识别接收到的数据特征。
说明V1.00VC0706串口调试工具使用说明Version 1.002008.02.29Notes1: The information is subject to change without notice. Before using this document, please confirm that this is the latest version.Notes2: Not all products and/or types are available in every country. Please check with a Vimicrosales representative for availability and additional information.2 of 35 Version 1.002008-3-19 2Important NoticeAll rights about this document belong to Vimicro Corporation (here after, refer as Vimicro). All rights are reserved.Vimicro and its subsidiaries reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. Customers should contact Vimicro’s sales department before purchasing the product described in this document. All products are sold subject to Vimicro’s terms and conditions of sale supplied at the time of order acknowledgment.Vimicro does not warrant or represent that any license, either explicit or implied, is granted under any Vimicro patent right, copyright, mask work right, or other Vimicro intellectual property right relating to any combination, machine, or process in which Vimicro products or services are used. Information published by Vimicro regarding third-party products or services does not constitute a license from Vimicro to use such products or service or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from Vimicro under the patents or other intellectual property of Vimicro.Vimicro semiconductor devices are intended for standard uses (such as office equipment, computers, industrial/communications/measuring equipment, and personal/home equipment). Customers using semiconductor devices for special applications (including aerospace, nuclear, military and medical applications) in which a failure or malfunction might endanger life or limb and which require extremely high reliability must contact our Sales Department first. If damage is caused by such use of our semiconductor devices without first consulting our Sales Department, Vimicro will not assume any responsibility for the loss.The contents of this document must not be reprinted or duplicated without written permission of Vimicro. Information and circuit diagrams in this document are only examples of device application. They are not intended to be used in actual equipment. Vimicro accepts no responsibility for infringement of patents or other rights owned by third parties caused by use of the information and circuit diagrams in this document.Reproduction of information in Vimicro data books or data sheets is permissible only if preproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. Vimicro is not responsible or liable for such altered documentation. Resale of Vimicro products or services with statements different from or beyond the parameters stated by Vimicro for that product or service voids all explicit and any implied warranties for the associated Vimicro product or service and is an unfair and deceptive business practice. Vimicro is not responsible or liable for any such statements.3 of 35 Version 1.002008-3-19 3目录目录 (3)文档说明 (4)功能介绍 (4)程序介绍 (5)按钮说明 (6)菜单说明 (6)串口配置 (7)“CONFIG”按钮说明 (7)“GET VERSION”按钮说明 (9)“R/W DATA”按钮说明 (9)“COLOR CTRL”按钮说明 (10)“MIRROR CTRL”按钮说明 (11)“POWER CTRL”按钮说明 (12)“TIME CTRL”按钮说明 (13)“AE MODE”按钮说明 (14)“SYSTEM RESET”按钮说明 (16)“MOTION CTRL”按钮说明 (16)“OSD CTRL”按钮说明 (20)“IMAGE PROPERTY PAGE”按钮说明 (26)“GAMMA”按钮说明 (27)“SPI FLASHE”菜单说明 (28)“UP/DOWN LOAD”按钮说明 (29)“OTHER CTRL”按钮说明 (31)“FBUF CTRL”按钮说明 (32)“ZOOM CTRL”按钮说明 (34)4 of 35 Version 1.002008-3-19 4文档说明本文档用于介绍VC0706串口工具的使用方法,对VC0706相关的技术细节不作介绍,但会指出如何获得相关的技术参考。
重要内容为了醒目会用加粗表示;对于相关的技术参考文档会用加粗加斜表示;对于程序的按钮、列表等上面的文字会用蓝色表示;对于特别提示会用红色“注意”来提示;功能介绍该程序用于与VC0706串口进行通讯,向VC0706发送各种命令,并且接收VC0706发送的数据,以达到对VC0706的控制目的。
可以实现的功能有:z通讯端口配置:设置各个串口的波特率z获取版本号z寄存器读写:可以读写各个模块的寄存器z序列号的设置:z颜色控制:设置颜色自动黑白彩色切换,以及手动黑白彩色设置z Mirror控制:控制Sensor的水平Mirror显示。
z节能模式控制:控制进入和退出节能模式,以及参数配置z RTC时间控制:读取和修改时间。