Uart串口读写实验Cyclone10 FPGA实验Verilog源码Quartus17.1工程文件+文档资料, FPGA为CYCLONE10LP系列中的10CL025YU256C8. 完整的Quartus工程文件,可以做为你的学习设计参考。 module uart_test( input clk, input rst_n, input uart_rx, output uart_tx ); parameter CLK_FRE = 50;//Mhz localparam IDLE = 0; localparam SEND = 1; //send HELLO ALINX\r\n localparam WAIT = 2; //wait 1 second and send uart received data reg[7:0] tx_data; reg[7:0] tx_str; reg tx_data_valid; wire tx_data_ready; reg[7:0] tx_cnt; wire[7:0] rx_data; wire rx_data_valid; wire rx_data_ready; reg[31:0] wait_cnt; reg[3:0] state; assign rx_data_ready = 1'b1;//always can receive data, //if HELLO ALINX\r\n is being sent, the received data is discarded always@(posedge clk or negedge rst_n) begin if(rst_n == 1'b0) begin wait_cnt <= 32'd0; tx_data <= 8'd0; state <= IDLE; tx_cnt <= 8'd0; tx_data_valid <= 1'b0; end else case(state) IDLE: state <= SEND; SEND: begin wait_cnt <= 32'd0; tx_data <= tx_str; if(tx_data_valid == 1'b1 && tx_data_ready == 1'b1 && tx_cnt < 8'd12)//Send 12 bytes data begin tx_cnt <= tx_cnt + 8'd1; //Send data counter end else if(tx_data_valid && tx_data_ready)//last byte sent is complete begin tx_cnt <= 8'd0; tx_data_valid <= 1'b0; state <= WAIT; end else if(~tx_data_valid) begin tx_data_valid <= 1'b1; end end WAIT: begin wait_cnt <= wait_cnt + 32'd1; if(rx_data_valid == 1'b1) begin tx_data_valid <= 1'b1; tx_data <= rx_data; // send uart received data end else if(tx_data_valid && tx_da
delphi串口读写台达plc PLC台达DELPHI通讯MODBUS procedure TfrmMain.btnReadMClick(Sender: TObject); var sStr:String; i:Integer; begin for i:= 0 to 1279 do Begin kmtPLC.SendData('0102'+IntToHex(i+$800,4)+'0001'); //取输出状态 sStr:=kmtPLC.ReadResFromPort(); if sStr'' then Begin memo1.Lines.Add('M'+IntToHex(i,4)+'-'+FormatFloat('0000',i)+'-'+Copy(sStr,1,Length(sStr)-2)); End; End; end; procedure TfrmMain.SpeedButton4Click(Sender: TObject); var sStr:String; begin kmtPLC.SendData('0103'+IntToHex(StrToInt(edtDAddr.Text)+$1000,4)+'0001'); sStr:=kmtPLC.ReadResFromPort(); if sStr'' then Begin edtDValue.Text:=sStr; End; end;
2021-11-29 14:27:45 657KB PLC 台达 DELPHI 通讯
1
android RS232串口读写程序,内含jni程序代码,使用android studio打开编译
2021-11-25 15:59:58 1.41MB android RS232 串口
1
在Windows下读写串口的C++类
2021-11-16 09:04:46 2KB C++ 串口通信 串口读写 Windows串口
1
visual C#2005下的串口读写程序,非常好用的程序.
2021-10-19 20:54:21 58KB C# 串口 编程
1
写了一个demo,放到源码下面编译,对dev/ttyMT1进行操作,在系统的init.rc里面要把dev/ttyMT1的权限改一下才能读写。
2021-10-16 14:57:16 24KB android 串口 读写 安卓
1
基于Android Studio的串口读写中间件demo, 代码下载后,根据需要修改串口设备节点就可以使用
2021-09-24 20:52:49 20.6MB Android jni uart 串口
1
nrComm Lib 9.47 Copyright (C) 1997-2017 Roman Novgorodov, DeepSoftware LLC 1. General information ====================== nrComm Lib provides some tools for performing the serial communications tasks in Delphi/CBuilder development. It has ready solutions for many communication tasks and supports working with different types of devices: * RS232, serial ports (native and virtual), USB2RS232 adapters etc.; * Telephone API (TAPI) devices (data and voice modems); * Text to speech conversion with voice modem output; * direct access to LPT port; * barcode readers; * Bluetooth connections and devices; * GSM (sms send receive, access to phonebook etc.); * ZModem, Kermit file transfer protocol; * HID (Human Interface Devices) devices; * Terminal control with VT100 support; * USB - device detection, WinUSB or lightweight nrUsb.SYS installation, I/O operations; * ready solution for implementation any data packet protocol TnrDataProcessor component * 32bit and 64bit are full support. All needed drivers are signed and can be installed on x64 Windows; * GPS * event logging and other more. After installation nrComm Lib you will find amny demo projects (with sources) and see the context help files and documentation. More information you can read at DeepSoftware home web site (www.deepsoftware.com).
2021-09-15 14:52:40 43.51MB 串口读写 nrcommlib
1
node-serialport 是一个 Node.js 的包,用来对串口数据进行读写操作。基本示例代码:var SerialPort = require("serialport").SerialPort var serialPort = new SerialPort("/dev/tty-usbserial1", {   baudrate: 57600 }, false); // this is the openImmediately flag [default is true] serialPort.open(function (error) {   if ( error ) {     console.log('failed to open: ' error);   } else {     console.log('open');     serialPort.on('data', function(data) {       console.log('data received: '   data);     });     serialPort.write("ls\n", function(err, results) {       console.log('err '   err);       console.log('results '   results);     });   } });罗列所有串口:var serialPort = require("serialport"); serialPort.list(function (err, ports) {   ports.forEach(function(port) {     console.log(port.comName);     console.log(port.pnpId);     console.log(port.manufacturer);   }); });串口配置:baudRatedataBitsstopBitsparityrtsctsxonxoffxanyflowControlbufferSizeparserencodingdataCallbackdisconnectedCallbackplatformOptions - sets platform specific options, see below.目前已有很多项目在使用这个包进行串口处理:Johnny-Five - Firmata based Arduino Framework.Cylon.js - JavaScript Robotics, By Your Command.node-l8smartlight (source) A node library to control the L8 Smartlight via Bluetooth or USB portfirmata Talk natively to Arduino using the firmata protocol.tmpad source - a DIY midi pad using infrared, arduino, and nodejs. Videoduino - A higher level framework for working with Arduinos in node.js.Arduino Drinking Game Extravaganza - AKA "The Russian" a hexidecimal drinking game for geeks by Uxebu presented at JSConf EU 2011.Arduino controlling popcorn.js - Controlling a popcorn.js video with an Arduino kit.Robotic JavaScript - The first live presentation of the node-serialport code set as presented at JSConf EU 2010.devicestack - This module helps you to represent a device and its protocol.reflecta A communication protocol that combines Arduino Libraries and NodeJS into an integrated system.rc4pt-node - Control Popcorntime with an
2021-09-13 10:29:17 178KB 开源项目
1
python串口读写源代码程序+详细注释 简单的python串口读写介绍 ser serial Serial 0 是打开第一个串口 print ser portstr 能看到第一个串口的标识 windows下是COM1 ser write “hello" 就是往串口里面写数据 ser close 就是关闭ser表示的串口 ser open 会打开这个串口
2021-08-07 14:06:13 3KB 串口读写