G-CAMS-DATU/README.md
2024-05-13 16:08:47 +08:00

126 lines
3.8 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## CAMS DATU CAMS计算机辅助缝纫管理系统采集模块
#### 说明
- 待完成
RS232协议未指定
发送数据信息(未指定格式)
- 已完成
1.IO输入输出
2.flash读写保存数据
3.USB串口动态配置信息MQTT、Modbus等
4.屏幕多级菜单显示IO数据、配置信息等
5.Modbus/485读写
7.ADC采集0-10V、3.3V、4-20ma可配合硬件修改
8.4G联网、MQTT连接
9.命令输出指定log用于调试
#### 开发环境
RT-Thread 软件打开 [点击下载](https://www.rt-thread.org/download.html#download-rt-thread-studio "点击下载"),版本: 2.2.7、C 语言
安装完成,**SDK下载RT-Thread 5.0.2与STM32F1固件库**,导入工程即可
---
#### 使用说明
| 目录 | 说明 |
| ----------- | ---------------- |
| driver | RT-Thread 的驱动 |
| libraries | rtt 内核 |
| linkscripts | 空间链接脚本 |
| packages | 第三方功能包 |
| rt-thread | rtt 内核 |
主要关心 application 目录下文件夹功能:
| 目录名 | 作用 |
| ------ | -------------------------------- |
| config | 用户配置功能 |
| fram | 读写flash用以保存读取配置 |
| IO | 端口电平等 |
| OLED | 屏幕 |
| modbus | modbus 功能 |
| thread | 线程管理 |
| LTE | 网络配置 |
| ADC | ADC读值转换0-10V、3.3V、4-20ma等 |
| AIR820 | 4G模组与MQTT代码 |
| RS232 | 暂未定协议 |
由main函数为起始阅读点读取配置后做初始化启动线程开始工作
main.c-> 读配置 ->thread.c -> IO
               -> fram
               -> modbus
          -> .......
---
#### 空间与引脚分配
- MB85RS64储存分布说明8192 字节
| 字符 | 占用 |
| ------------ | ---- |
| 预留标志位 | 8 |
| MQTT | 80 |
| modbus | 9 |
| ADC | 4 |
| 下一写入位置 | 101 |
| 运行数据 | ... |
-
- 引脚分配表
- 输入输出
| 引脚名称 | 功能 | | 引脚名称 | 功能 |
| -------- | ------ | ---- | -------- | ------- |
| PC2 | INPUT1 | | PB12 | OUTPUT1 |
| PC3 | INPUT2 | | PB13 | OUTPUT2 |
| PC4 | INPUT3 | | PB14 | OUTPUT3 |
| PA5 | INPUT4 | | PB15 | OUTPUT4 |
| PA6 | INPUT5 | | PC6 | OUTPUT5 |
| PA7 | INPUT6 | | PC7 | OUTPUT6 |
| PA8 | INPUT7 | | PC8 | OUTPUT7 |
| PC9 | INPUT8 | | PA11 | OUTPUT8 |
- 通信接口
| 引脚 | 功能 | | 引脚 | 功能 |
| ---- | ------------- | ---- | ---- | -------------- |
| PA9 | UART1_console | | PB3 | SPI_SCK_flash |
| PA10 | UART1_console | | PB4 | SPI_MISO_flash |
| | | | PB5 | SPI_MOSI_flash |
| PC10 | UART4_232_TX | | PA15 | NSS_CS |
| PC11 | UART4_232_RX | | | |
| PC12 | UART5_232_TX | | PB6 | oled_SCL |
| PD2 | UART5_232_RX | | PB7 | oled_SDA |
| | | | PB8 | Key_4 |
| PA1 | EN_485 | | PB9 | Key_3 |
| PA2 | UART2_485_TX | | PC13 | key_2 |
| PA3 | UART2_485_RX | | PC14 | key_1 |
| | | | | |
| PB10 | UART3_TX_4G | | PA0 | ADC1_0 |
| PB11 | UART3_RX_4G | | PA4 | ADC2_4 |
| PB1 | WAK | | PC0 | ADC3_10 |
| PB0 | GPS | | PC1 | ADC3_11 |
| PC5 | RST | | | |
-