|
|
@ -61,11 +61,11 @@ |
|
|
|
//STEP 2 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>TYPE_UASER_BOARD CONFIG
|
|
|
|
#if(TYPE_UASER_BOARD == TYPE_BOARD_WEIGH_0B) |
|
|
|
#include <intrins.h> |
|
|
|
#include "../cpu/stc_stc8hxx.h" |
|
|
|
#include "../cpu/stc_stc8f.h" |
|
|
|
#include "../cpu/stc_macro.h" |
|
|
|
|
|
|
|
//基本配置(工作频率、时钟、看门狗、字节序)
|
|
|
|
#define TYPE_MCU TYPE_MCU_STC_8H |
|
|
|
#define TYPE_MCU TYPE_MCU_STC_8F |
|
|
|
#define TYPE_IDE TYPE_IDE_KEIL |
|
|
|
#define D_CPUfamily_type D_CPUfamily_8bits |
|
|
|
#define D_sys_MainFre MainFre_22M |
|
|
@ -75,7 +75,7 @@ |
|
|
|
#define D_CODE_ENCRYPTION_TYPE TYPE_ENCRYPTION_ENABLE //是否代码加密
|
|
|
|
|
|
|
|
|
|
|
|
#define D_MCU_NAME "STC8H3K48S4" |
|
|
|
#define D_MCU_NAME "STC8F2K16S2" |
|
|
|
//存储器特殊参数地址配置
|
|
|
|
#define D_MCU_SPEC_PARAM_CHIPID 0xBFF9 |
|
|
|
//...其他参数
|
|
|
@ -85,15 +85,17 @@ |
|
|
|
#define D_uart0_SBIT SBIT_1 |
|
|
|
#define D_PIN_UART0 PIN_UART0_Rxd_30_Txd_31 |
|
|
|
#define D_uart2_BRT BRT_115200 |
|
|
|
#define D_uart2_SBIT SBIT_1 |
|
|
|
#define D_PIN_UART2 PIN_UART2_Rxd_10_Txd_11 |
|
|
|
#define D_uart3_BRT BRT_115200 |
|
|
|
#define D_uart4_BRT BRT_115200 |
|
|
|
|
|
|
|
//485配置
|
|
|
|
#define D_UART0_485_TYPE TYPE_485_SLAVER //UART0启用485
|
|
|
|
#define D_UART0_485_TYPE TYPE_485_NONE //UART0启用485
|
|
|
|
#define D_UART0_485_SLAVER_ID_BROADCAST 0xFF //485从机总是响应0xFF消息
|
|
|
|
#define D_UART0_485_SLAVER_ID 0x01 //板卡作为485从机 slaverId
|
|
|
|
#define D_UART0_485_TX() P55 = 1; |
|
|
|
#define D_UART0_485_RX() P55 = 0; |
|
|
|
#define D_UART0_485_TX() P32 = 1; |
|
|
|
#define D_UART0_485_RX() P32 = 0; |
|
|
|
#define D_UART2_485_TYPE TYPE_485_NONE //UART2不启用485
|
|
|
|
#define D_UART3_485_TYPE TYPE_485_NONE //UART2不启用485
|
|
|
|
#define D_UART4_485_TYPE TYPE_485_NONE //UART2不启用485
|
|
|
@ -104,9 +106,12 @@ |
|
|
|
#define D_MODBUS_REG_MAX_NUM 32 //每次最多读取/写入的寄存器数量,此处的数量要注意和 D_tp_handle_x_len 对应
|
|
|
|
|
|
|
|
//外设定义
|
|
|
|
#define LED0 P17 //D4
|
|
|
|
#define LED1 P54 //D4
|
|
|
|
|
|
|
|
#define LED0 P55 //D1
|
|
|
|
//868配置
|
|
|
|
#define M0 P13 |
|
|
|
#define M1 P14 |
|
|
|
#define M2 P12 |
|
|
|
//EEP存储地址定义
|
|
|
|
#define D_EEP_SECTOR_SIZE 0x200 //每个扇区0x200==512bytes
|
|
|
|
#define D_EEP_SECTOR_BLOCK_SIZE 0x40 //扇区中每个数据块0x40==64bytes,可选值[32,64,128]等
|
|
|
@ -152,7 +157,6 @@ |
|
|
|
#define D_SERVE_INT4 interrupt 16 |
|
|
|
#define D_SERVE_UART3 interrupt 17 |
|
|
|
#define D_SERVE_UART4 interrupt 18 |
|
|
|
|
|
|
|
#define D_SERVE_TIMER3 interrupt 19 |
|
|
|
#define D_SERVE_TIMER4 interrupt 20 |
|
|
|
#define D_SERVE_CMP interrupt 21 |
|
|
@ -198,7 +202,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
//STEP 5 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Uart CONFIG
|
|
|
|
#define SERIAL_MAX_NUM 1 |
|
|
|
#define SERIAL_MAX_NUM 2 |
|
|
|
////fixme:和cpu的程序容量息息相关
|
|
|
|
#define D_UART_send_buf_max 16 /// 9600bps = 10000bps = 1000 Bps = 1Byte/ms
|
|
|
|
/// 19200bps = 20000bps = 2000Bps = 2Byte/ms = 1Byte/0.5ms
|
|
|
|