跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
Mcuzone Wiki
搜索
搜索
登录
个人工具
登录
查看“0012 MPUUART/MP4232 EN”的源代码
页面
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
←
0012 MPUUART/MP4232 EN
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[0012 MPUUART MP4232|切换语言为中文]] == '''Keywords''' == Raspberry Pi 5, PCIe, Switch, VL805, TTL, RS232, RS485, Serial == '''I. Introduction''' == The Raspberry Pi 5 features a 16-pin PCIe interface, which can be utilized for the expansion of various peripherals. We can expand into four USB interfaces through the PCIe interface paired with a PCIe to USB chip, and then achieve four serial ports using the CH344Q chip. This expansion board comes in two versions: one is the MP4232 expansion board, which provides an expansion of 4 RS232 ports. This expansion board does not require any drivers under Raspberry Pi OS or Ubuntu OS and will be automatically recognized as four RS232 serial ports (ttyACM0, ttyACM1, ttyACM2, ttyACM3) once powered on. The other version is the MPUUART expansion board, which provides an expansion for dual RS232 and dual RS485 ports. This expansion board does not require any drivers under Raspberry Pi or Ubuntu systems and will be automatically recognized as ttyACM0, ttyACM1, ttyACM2, and ttyACM3 upon powered on. Among these, ttyACM0 and ttyACM3 are RS232 serial ports, while ttyACM1 and ttyACM2 are RS485 serial ports. The baud rate for RS232 can reach over 230 Kbps (with a tested speed of up to 1.2 Mbps when two adjacent RS232 ports are connected), while the baud rate for TTL/CMOS UART can reach up to 6 Mbps. The expansion board also has three USB 2.0 ports reserved, which can be used to extend a 4G LTE module. The 4G module provided by our company is driver-free and dial-up-free on both the Raspberry Pi system and Ubuntu OS. The system automatically recognizes it, allowing for plug-and-play functionality without the need to install additional drivers. == '''II. Hardware Spec''' == 1. One PCIe interface, 0.5mm 16P FPC for communication with Raspberry Pi 5, adopting a design of PCIe to four high-speed USB2.0. 2. Three-way HS USB2.0, 1.25mm-4P interface, expandable CM4 4G Mini module. 3. The MPUUART expansion board converts four serial ports via a USB 2.0 high-speed interface, featuring two RS232 ports and two RS485 ports with power isolation design. The RS232 ports can be modified to a TTL/CMOS level UART and is led out through a 3.81-3Pin connector. 4. The MP4232 expansion board converts four serial ports via a USB 2.0 high-speed interface, implementing a four-channel RS232 design with 3.81-3p terminals. 5. Four LEDs are included: a PWR LED that is powered via the Raspberry Pi 5's PCIe interface, an ACT LED for the USB-to-serial chip, and two transmit/receive LEDs. 6. Size: 56x85mm, Four M2.5 mounting holes, consistent with those on the Raspberry Pi 5; 7. The expansion board provides mounting holes for a 4G module and supports stacking of 1-3 4G modules. 8. Aluminum alloy enclosure(OPT). 9. Customizable interface levels are available, such as configuring four TTL/CMOS serial ports, or four RS485 serial ports. 10. The MPUUART circuit board uses gold immersion process, lead-free production, and the material has passed UL and ROHS certifications with a flame retardant rating of 94V-0. http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_71.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_72.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_73.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_74.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_75.jpg == '''III. Work with Raspberry Pi OS''' == Since the expansion board utilizes the PCIe interface of the Raspberry Pi 5, the system can only be booted from an SD card (TF card). Please refer to the following link for instructions on how to burn the system image to a TF card: [[0005 MPS2242 2280 2280P EN#3.2 Boot from TF card|Flash the system using a TF card]] The version of the Raspberry Pi OS is: 2024-07-04-raspios-bookworm-arm64.img.xz You can download the Raspberry Pi OS in: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit === 3.1 安装串口软件CuteCom === 串口软件CuteCom的安装命令为: <code>sudo apt install cutecom</code> 安装完毕后,点击桌面左上角的树莓派图标,在“System Tools”有CuteCom的快捷方式: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_01.jpg === 3.2 测试MP4232 === MP4232扩展板的4个串口名称从上到下依次如下: ttyACM3、ttyACM0、ttyACM1、ttyACM2 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_55.jpg 两个RS232串口之间的连接对应关系为: R - T G - G T - R 在树莓派终端中输入<code>lsusb</code>,我们可以看到VL805和CH344Q: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_03.jpg 输入<code>ls /dev</code>,我们可以看到4个串口ttyACM0、ttyACM1、ttyACM2、ttyACM3: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_31.jpg 我们用串口连接线连接任意两个串口,使用CuteCom进行数据收发测试,经测试,树莓派系统下波特率最高可达到1.21M(以传输数据不发生乱码为准): http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_02.jpg === 3.3 测试MPUUART === MPUUART扩展板的4个串口,靠上的两个为RS232串口(ttyACM0、ttyACM3),靠下的两个为RS485串口(ttyACM1、ttyACM2)。 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_56.jpg 两个RS485串口之间的连接对应关系为: G - G A - A B - B 在树莓派终端中输入<code>lsusb</code>,我们可以看到VL805和CH344Q: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_10.jpg 输入<code>ls /dev</code>,我们可以看到4个串口ttyACM0、ttyACM1、ttyACM2、ttyACM3: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_32.jpg 我们用串口连接线连接两个RS232串口,使用CuteCom进行数据收发测试,经测试,树莓派系统下波特率最高可达到1.22M(以传输数据不发生乱码为准): http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_12.jpg 我们用串口连接线连接两个RS485串口,使用CuteCom进行数据收发测试,经测试,树莓派系统下波特率最高可达到2.02M(以传输数据不发生乱码为准): http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_13.jpg === 3.4 测试4G模块 === 我司配套的CM4 4Gmini模块,在树莓派系统下均为免驱免拨号,自动识别,即插即用。4G型号分CM4 4G mini(CAT4 4G),高通4G,高通4G-GPS。 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_64.jpg CAT4 4G版本在系统里识别成eth设备,高通4G在系统里识别成usb0设备。 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_39.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_40.jpg ==== 3.4.1 模块连接 ==== 系统上电启动运行树莓派官方os后,在树莓派终端中执行命令<code>lsusb</code>,如下图所示: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_41.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_42.jpg 在树莓派终端中执行<code>ifconfig -a</code>,我们可以看到4G模块(eth1或usb0)已经正确获得了IP地址: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_39.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_40.jpg 如果此时看不到4G模块(eth1),请检查连线是否正确,以及使用<code>lsusb</code>命令查看模块是否被系统识别。 Statu LED灯状态如下: '''CAT4 4G:''' 闪烁状态为1.8秒亮0.2秒灭(也可以通过亮的时间比灭的时间长来判断)表示4G模组已经联网。 闪烁状态是1.8秒灭0.2秒亮,说明SIM卡或者网络有问题,请检查SIM卡和天线。 '''高通4G:''' 闪烁状态为慢闪,中间有短暂快闪,表示4G模组已经联网;否则说明SIM卡或者网络有问题,请检查SIM卡和天线。 4G模组正确获得ip地址后,我们可以ping外网地址,如: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_43.jpg 也可以通过4G模块连接外网,访问[https://www.speedtest.cn/ 测速网站]测速,结果如下: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_44.jpg '''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。''''' ==== 3.4.2 使用AT命令 ==== 以CAT4 4G为例,在树莓派终端中执行命令<code>lsusb</code>,如下图所示: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_41.jpg 本模块的id为05c6 90b6,记录下这个值。 使用下列命令打开ttyUSB串口,其中echo后面的值就是之前记录的ID值: <code>sudo modprobe option</code> <code>sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> 执行以上两条命令后系统应该会多出ttyUSB0-3三个设备,输入<code>ls /dev/ttyUSB*</code>可以查看: http://www.mcuzone.com/wiki/5002_CM5_Basic/5002_CM5_Basic_60.jpg 安装minicom工具: <code>sudo apt-get install minicom</code> 通过minicom打开AT命令串口: <code>sudo minicom -D /dev/ttyUSB1</code> (注意:使用哪个串口,应以在进入此串口后,可输入运行AT命令,显示不乱码,不乱跳结果为准) 如果需要查看回显,请键入命令:<code>ate1</code>,然后回车,继续键入其它命令,回车可以看到结果。 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_45.jpg 常用AT命令: 1. 检查SIM卡是否识别到: <code>at+cpin?</code> 返回ready表示卡已识别,返回error要检查硬件 2. 检查天线信号质量: <code>at+csq</code> 返回值在26-31表示信号OK,信号满格31;返回值在20-25表示信号勉勉强强;返回值在20以下表示信号比较糟糕或者天线没接 3. 检查注网情况: <code>at+cops?</code> 正常应该返回运营商代码和7,7代表4G。 注意,以上命令只有<code>at+csq</code>不要加问号,另外两条命令需要加问号。 4. 查看4G模块的IMEI码: <code>at+cgsn</code> 5. 重启4G模块(有时候如果重插SIM卡,热插拔不一定管用,可以用这个reset命令来复位模块): <code>at+reset</code> 6. 关闭射频: <code>at+cfun=0</code> 开启射频: <code>at+cfun=1</code> 上述两条命令成对使用,可以在不重启4G模组的情况下让模组重新注网。 ==== 3.4.3 修改4G模组的IP地址 ==== 如果出厂默认的4G IP地址和用户使用的IP地址有冲突,或有修改IP地址的需求,可按照下列步骤进行修改: '''CAT4 4G模块:''' 执行AT命令: <code>AT+ROUTEIP=<newip></code> 注意,只支持192.168.x.1这样格式的地址,如果设置了<code>AT+ROUTEIP=192.168.3.1</code>,最终获得的IP为192.168.3.100,修改完后需断电重启系统。 查询当前IP:<code>AT+ROUTEIP?</code>,返回两个值,前一个为旧IP,后一个为新IP。 测试命令:<code>AT+ROUTEIP=?</code> '''高通 4G模块:''' 将4G模块的IP改为直接获取公网IP即可,请执行AT命令: 设置IP为公网:<code>AT+GTIPPASS=1</code> 设置IP为内网:<code>AT+GTIPPASS=0</code> 查询当前IP为公网还是内网:<code>AT+GTIPPASS?</code> 修改IP完毕后需要断电重启才能生效。 ==== 3.4.4 GPS测试(适用于高通4G-GPS版本) ==== 如果你选择的是高通4G-GPS版本,则此4G附带GPS功能,需要接GPS无源天线,且确保GPS天线甩出户外。 Execute the command <code>lsusb</code>, as shown in the figure below: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_04.jpg Note down the ID of the 4G module: 05c6 90b6. Use the following command to open the ttyUSB serial port, where the value following echo is the ID value recorded above: <code>sudo modprobe option</code> <code>sudo sh -c 'echo 05c6 90b6 > /sys/bus/usb-serial/drivers/option1/new_id'</code> After executing the two commands above, the system should have three additional devices: ttyUSB0/1/2. You can check them by executing <code>ls /dev</code>: http://www.mcuzone.com/wiki/0024_MP4GUSB/0024_MP4GUSB_06.jpg Execute minicom and open the ttyUSB0 serial port: <code>sudo minicom -D /dev/ttyUSB0</code> Then execute: <code>at+gtgpsepo=1</code> //Enable AGPS <code>at+gtgpspower=1</code> //Enable GPS Wait a moment for the positioning to succeed, then execute: <code>at+gtgps?</code> //View NMEA information You can then see that the serial port outputs GPS information: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_70.jpg == '''四、Ubuntu系统的使用''' == 我们测试用的Ubuntu系统版本为ubuntu-24.04-preinstalled-desktop-arm64+raspi.img.xz, Ubuntu OS下载地址: https://ubuntu.com/download/raspberry-pi === 4.1 安装串口软件CuteCom === 串口软件CuteCom的安装命令为: <code>sudo apt install cutecom</code> 安装完毕后,点击桌面左下角的“Show Apps”图标,有CuteCom的快捷方式: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_05.jpg 但是如果在此直接打开CuteCom,有可能会出现Input框无法输入字符的问题,这是由于权限不足造成的,所以需要打开Ubuntu终端,输入: <code>sudo cutecom</code> http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_06.jpg 来打开CuteCom,如果需要打开第二个CuteCom,则需要再开一个Ubuntu终端,输入打开CuteCom的命令。 === 4.2 测试MP4232 === MP4232扩展板的4个232串口名称从上到下依次如下: ttyACM3、ttyACM0、ttyACM1、ttyACM2 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_55.jpg 两个RS232串口之间的连接对应关系为: R - T G - G T - R 在Ubuntu终端中输入<code>lsusb</code>,我们可以看到VL805和CH344Q: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_07.jpg 输入<code>ls /dev</code>,我们可以看到4个串口ttyACM0、ttyACM1、ttyACM2、ttyACM3: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_33.jpg 我们用串口连接线连接任意两个串口,使用CuteCom进行数据收发测试,经测试,Ubuntu系统下波特率最高可达到1.15M(以传输数据不发生乱码为准): http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_09.jpg === 4.3 测试MPUUART === MPUUART扩展板的4个串口,靠上的两个为RS232串口(ttyACM0、ttyACM3),靠下的两个为RS485串口(ttyACM1、ttyACM2)。 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_56.jpg 两个RS485串口之间的连接对应关系为: G - G A - A B - B 在Ubuntu终端中输入<code>lsusb</code>,我们可以看到VL805和CH344Q: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_14.jpg 输入<code>ls /dev</code>,我们可以看到4个串口ttyACM0、ttyACM1、ttyACM2、ttyACM3: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_34.jpg 我们用串口连接线连接两个RS232串口,使用CuteCom进行数据收发测试,经测试,树莓派系统下波特率最高可达到1.26M(以传输数据不发生乱码为准): http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_16.jpg 我们用串口连接线连接两个RS485串口,使用CuteCom进行数据收发测试,经测试,树莓派系统下波特率最高可达到1.98M(以传输数据不发生乱码为准): http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_17.jpg === 4.4 测试4G模块 === 我司配套的CM4 4Gmini模块,在Ubuntu系统下均为免驱免拨号,自动识别,即插即用,插手机SIM卡(4G以上),接天线。4G型号分CM4 4G mini(CAT4 4G),高通4G,高通4G-GPS。 http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_63.jpg 4G模块在Ubuntu系统里识别成以enx开头的设备。4G的其他操作,比如使用AT命令,修改IP地址或者GPS的使用等,均和树莓派系统一样。此处不再重复。 系统上电启动运行Ubuntu系统后,在树莓派终端中执行命令<code>lsusb</code>,如下图所示: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_65.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_66.jpg 在Ubuntu终端中执行<code>ifconfig -a</code>,我们可以看到4G模块(enx开头的网卡)已经正确获得了IP地址: http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_67.jpg http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_68.jpg Statu LED灯状态如下: '''CAT4 4G:''' 闪烁状态为1.8秒亮0.2秒灭(也可以通过亮的时间比灭的时间长来判断)表示4G模组已经联网。 闪烁状态是1.8秒灭0.2秒亮,说明SIM卡或者网络有问题,请检查SIM卡和天线。 '''高通4G:''' 闪烁状态为慢闪,中间有短暂快闪,表示4G模组已经联网;否则说明SIM卡或者网络有问题,请检查SIM卡和天线。 4G模组正确获得ip地址后,我们可以ping外网地址,如: <code>ping www.mcuzone.com</code> http://www.mcuzone.com/wiki/0012_MPUUART_MP4232/0012_MPUUART_MP4232_69.jpg 也可以通过4G模块连接外网,访问[https://www.speedtest.cn/ 测速网站]测速,结果如下: http://www.mcuzone.com/wiki/3101_Domestic_4G/3101_Domestic_4G_31.jpg '''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。'''''{{联系我们_图标}} [http://wiki.mcuzone.com/index.php?title=0012_MPUUART_MP4232%EF%BC%88%E5%A4%9A%E8%B7%AF%E4%B8%B2%E5%8F%A3%E6%89%A9%E5%B1%95%E6%9D%BF%EF%BC%89&veaction=edit T]
本页使用的模板:
模板:Contact Us icon
(
查看源代码
)
返回
0012 MPUUART/MP4232 EN
。
开关有限宽度模式