20211007 开封发货调试 #1

Merged
ccsens_zhangsan merged 1 commits from yangshiwei/stc_ttss_weight:master into master 4 years ago
  1. 10
      keilp/cc_as_stc02_ps5ws.uvprojx
  2. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_sym
  3. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xab
  4. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xad
  5. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xc
  6. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xf
  7. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xm
  8. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xr
  9. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xsb
  10. BIN
      si4/ps5ws.si4project/soft_ps5ws.sip_xsd
  11. BIN
      si4/ps5ws.si4project/soft_ps5ws.siproj
  12. 4
      source/app/app_task_uart0.c
  13. 2
      source/app/common.c
  14. 15
      source/app/main.c
  15. 38
      source/app/main.h
  16. 2
      source/bsp/bsp_485.c
  17. 4
      source/bsp/bsp_485.h
  18. 61
      source/bsp/bsp_config.h
  19. 65
      source/bsp/bsp_cs1232.h
  20. 4
      source/clib/type.h
  21. 384
      source/cpu/stc_macro.H
  22. 640
      source/cpu/stc_stc8hxx.h
  23. 6
      source/msp/UART0.C
  24. 2
      source/msp/iic_sim.h
  25. 58
      source/msp/msp_eeprom.c
  26. 5
      source/msp/msp_eeprom.h
  27. 2
      source/msp/msp_id.c
  28. 4
      source/msp/msp_id.h
  29. 2
      source/msp/time.c
  30. BIN
      sscom5.13.1.exe
  31. 383
      sscom51.ini

10
keilp/cc_as_stc02_ps5ws.uvprojx

@ -380,11 +380,6 @@
<FileType>1</FileType>
<FilePath>..\source\msp\UART0.C</FilePath>
</File>
<File>
<FileName>iic_sim.c</FileName>
<FileType>1</FileType>
<FilePath>..\source\msp\iic_sim.c</FilePath>
</File>
<File>
<FileName>msp_eeprom.c</FileName>
<FileType>1</FileType>
@ -400,11 +395,6 @@
<Group>
<GroupName>bsp</GroupName>
<Files>
<File>
<FileName>bsp_power.c</FileName>
<FileType>1</FileType>
<FilePath>..\source\bsp\bsp_power.c</FilePath>
</File>
<File>
<FileName>bsp_cs1232.c</FileName>
<FileType>1</FileType>

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_sym

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xab

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xad

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xc

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xf

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xm

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xr

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xsb

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.sip_xsd

Binary file not shown.

BIN
si4/ps5ws.si4project/soft_ps5ws.siproj

Binary file not shown.

4
source/app/app_task_uart0.c

@ -14,10 +14,6 @@ void L3_task_uart0_modbus_handler(TS_Handle_PH4 *ph4)
{
L3_ph4_common_handler((TS_PH4_modbus*)(ph4->buf));
}
else
{
L3_ph4_send_error_pkg(MODBUS_ERR_CRC);
}
}
}

2
source/app/common.c

@ -279,7 +279,7 @@ int L3_ph4_common_handler(TS_PH4_modbus *pmodbus)
break;
}
default:
L3_ph4_send_error_pkg(MODBUS_ERR_OPCODE);
//L3_ph4_send_error_pkg(MODBUS_ERR_OPCODE);
break;
}
return handlerStatus;

15
source/app/main.c

@ -90,8 +90,8 @@ stc5ac32s
void L0_main_init(void)
{
Lc_delay_ms(200);
L0_I2C_INIT(1);
L1_app_POWER_init();
//L0_I2C_INIT(1);
//L1_app_POWER_init();
L1_uart0_buf_init();//串口初始化
EA = 1;
Lc_delay_ms(100);
@ -99,7 +99,8 @@ void L0_main_init(void)
L1_tick_init();
L0_timer0_Init();
L0_timer1_Init();
L0_I2C_INIT(1);
L0_board_config()
//L0_I2C_INIT(1);
//L2_task_ALGO_init();
}
@ -124,11 +125,11 @@ void main(void)
//-----------------------------------------------
//系统主循环
//-----------------------------------------------
#if 1 //看门狗
#if 0 //看门狗
if(!L3_mcu_id_ok())
{
P35 = 0;
P10 = 0;
P54 = 0;
P17 = 0;
while(1)
{
if(1 == s_nos_tick.t1s_heatbeart)
@ -146,7 +147,7 @@ void main(void)
if(1 == s_nos_tick.t1s_heatbeart)
{
s_nos_tick.t1s_heatbeart = 0;
P35 ^= 1;
P54 ^= 1;
}
//单路采集

38
source/app/main.h

@ -48,40 +48,16 @@
//#include "../msp/msp_buzz.h"
//#include "../msp/msp_rtc.h"
//#include "../msp/msp_plcd.h"
#include "../msp/iic_sim.h"
//#include "../msp/iic_sim.h"
#include "../msp/msp_eeprom.h"
#include "../msp/msp_id.h"
#include "../clib/Clib.h"
#include "../clib/bit.h"
//#include "../debug/debug_drv.h"
//#include "../uartcom/uprotocol.h"
//#include "../uartcom/Uartcom0.h"
#include "../ctask/task.h"
#include "../ctask/tick.h"
//#include "../bsp/bsp_led.h"
#include "../bsp/bsp_power.h"
//#include "../bsp/Bsp_debug.h"
//#include "app_yeelink.h"
#include "app_flow.h"
//#include "app_Gsensor.h"
//#include "app_io.h"
//#include "../clib/Clib.h"
//#include "../clib/bit.h"
//#include "../ctask/task.h"
//#include "../ctask/tick.h"
#include "../tpc/tpc_uart.h"
#include "stdio.h"
#include "app_paraid.h"
#include "app_algorithm.h"///
//#include "stdio.h"
//#include "app_paraid.h"
#include "../bsp/bsp_cs1232.h"
#include "../bsp/bsp_485.h"
#include "../app/app_task_uart0.h"

2
source/bsp/bsp_485.c

@ -4,5 +4,5 @@ void L2_485_init(void)
{
//485配置强推挽输出 P33 P32
//BITN_0(P3M1,BITN3);BITN_1(P3M0,BITN3);
BITN_0(P3M1,BITN2);BITN_1(P3M0,BITN2);
BITN_0(P5M1,BITN5);BITN_1(P5M0,BITN5);
}

4
source/bsp/bsp_485.h

@ -10,8 +10,8 @@
//485_RE P33
//485_DE P32
#define D_485_TX() P32 = 1;// >750us
#define D_485_RX() P32 = 0;
#define D_485_TX() P55 = 1;// >750us
#define D_485_RX() P55 = 0;
extern void L2_485_init(void);
#endif

61
source/bsp/bsp_config.h

@ -51,6 +51,32 @@
#endif
#define D_SERVE_INT0 interrupt 0
#define D_SERVE_TIMER0 interrupt 1
#define D_SERVE_INT1 interrupt 2
#define D_SERVE_TIMER1 interrupt 3
#define D_SERVE_UART interrupt 4
#define D_SERVE_ADC interrupt 5
#define D_SERVE_LVD interrupt 6
#define D_SERVE_PCA interrupt 7
#define D_SERVE_UART2 interrupt 8
#define D_SERVE_SPI interrupt 9
#define D_SERVE_INT2 interrupt 10
#define D_SERVE_INT3 interrupt 11
#define D_SERVE_TIMER2 interrupt 12
#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
#define D_SERVE_PWM interrupt 22
#define D_SERVE_PWMFD interrupt 23
#define D_SERVE_I2C interrupt 24
#if 0
#define D_debug_sim
#endif
@ -81,7 +107,11 @@
#include <string.h>
#include <intrins.h>
#include "../cpu/STC_stc8a8k.h"
//#include "../cpu/STC_stc8a8k.h"
#include "../cpu/stc_stc8hxx.h"
#include "../cpu/stc_macro.h"
#define D_MCU_SPEC_PARAM_CHIPID 0xBFF9
#if 0//// 烧写配置
. IRC振荡器的频率: 22.128MHz
@ -120,7 +150,6 @@
SPI IIC T0-T4 5 tssop20 1.2
#endif
#include "../cpu/c51_macro.h"
#define D_MCLKO_DIV2 2
#define D_MCLKO_DIV4 4
#define D_MCLKO_DIV8 6
@ -244,18 +273,18 @@ L1_tick_tick
///<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<****/
#define D_IO_LED1_OFF() D_P35_OFF()
#define D_IO_LED2_OFF() D_P34_OFF()
#define D_IO_485_RE_OFF() D_P33_OFF()
#define D_IO_485_DE_OFF() D_P32_OFF()
#define D_IO_LED1_OFF() D_P17_OFF()
#define D_IO_LED2_OFF() D_P54_OFF()
#define D_IO_485_RE_OFF() D_P55_OFF()
#define D_IO_485_DE_OFF() //D_P55_OFF()
#define D_IO_LED1_INIT() ///D_P35_INIT()
#define D_IO_LED2_INIT() ///D_P34_INIT()
#define D_IO_485_RE_INIT() ///D_P33_INIT()
#define D_IO_485_DE_INIT() ///D_P32_INIT()
#define D_IO_LED1_ON() D_P35_ON()
#define D_IO_LED2_ON() D_P34_ON()
#define D_IO_485_RE_ON() D_P33_ON()
#define D_IO_485_DE_ON() D_P32_ON()
#define D_IO_LED1_ON() D_P17_ON()
#define D_IO_LED2_ON() D_P54_ON()
#define D_IO_485_RE_ON() D_P55_ON()
#define D_IO_485_DE_ON() //D_P32_ON()
////////////////////////////////sim iic config
@ -266,6 +295,15 @@ L1_tick_tick
#define L0_IIC_SIM_close() BITN_1(P3M1,5);BITN_0(P3M0,5);\
BITN_1(P3M1,4);BITN_0(P3M0,4);
#define L0_board_config() D_stdIO_P1(BITN7);D_stdIO_P5(BITN4);\
D_stdIO_P1(BITN0);D_stdIO_P1(BITN1);\
D_stdIO_P1(BITN2);D_stdIO_P1(BITN6);\
D_stdIO_P3(BITN2);D_stdIO_P3(BITN3);\
D_stdIO_P3(BITN4);D_stdIO_P3(BITN5);\
D_stdIO_P3(BITN6);D_stdIO_P3(BITN7);
#if 10
#define L0_SDA_ON() D_P34_ON()
#define L0_SDA_OFF() D_P34_OFF()
@ -329,7 +367,8 @@ if(BITN_G(DR_who_wakeup, DRB_who_wakeup_timer0))
#include <string.h>
#include <intrins.h>
#include "../cpu/STC_stc8a8k.h"
//#include "../cpu/STC_stc8a8k.h"
#include "../cpu/stc_stc8hxx.h"
#define D_CPUfamily_type D_CPUfamily_8bits

65
source/bsp/bsp_cs1232.h

@ -90,45 +90,44 @@ P3.1 TXD0 12
P3.0 RXD0 11
*****************/
#define D_ADC_DOUT1_INIT() ///D_P16_INIT()
#define D_ADC_SCLK1_INIT() ///D_P17_INIT()
#define D_ADC_DOUT1_INIT() ///D_P17_INIT()
#define D_ADC_SCLK1_INIT() ///D_P16_INIT()
#define D_ADC_CS_A0_INIT() ///D_P55_INIT()
#define D_ADC_DOUT1_AT() D_P14_AT()
#define D_ADC_DOUT1_ON() D_P14_ON()
#define D_ADC_SCLK1_ON() D_P15_ON();D_adc_delay2();
#define D_ADC_CS_A0_ON() D_P55_ON()
#define D_ADC_DOUT1_OFF() D_P14_OFF()
#define D_ADC_SCLK1_OFF() D_P15_OFF();D_adc_delay();
#define D_ADC_CS_A0_OFF() D_P55_OFF()
#define D_ADC_DOUT1_AT() D_P36_AT()
#define D_ADC_DOUT1_ON() D_P36_ON()
#define D_ADC_SCLK1_ON() D_P35_ON();D_adc_delay2();
#define D_ADC_CS_A0_ON() //D_P55_ON()
#define D_ADC_DOUT1_OFF() D_P36_OFF()
#define D_ADC_SCLK1_OFF() D_P35_OFF();D_adc_delay();
#define D_ADC_CS_A0_OFF() //D_P55_OFF()
//#define D_ADC_CS2_A0_ON() D_P13_ON()
#define D_ADC_DOUT2_ON() D_P16_ON()
#define D_ADC_DOUT2_AT() D_P16_AT()
#define D_ADC_SCLK2_ON() D_P17_ON();D_adc_delay2();
#define D_ADC_DOUT2_ON() D_P10_ON()
#define D_ADC_DOUT2_AT() D_P10_AT()
#define D_ADC_SCLK2_ON() D_P16_ON();D_adc_delay2();
//#define D_ADC_CS2_A0_INIT() ///D_P13_INIT()
#define D_ADC_DOUT2_INIT() ///D_P14_IN() ///D_P14_INIT()
#define D_ADC_SCLK2_INIT() ///D_P15_INIT()
//#define D_ADC_CS2_A0_OFF() D_P13_OFF()
#define D_ADC_DOUT2_OFF() D_P16_OFF()
#define D_ADC_SCLK2_OFF() D_P17_OFF();D_adc_delay();
#define D_ADC_DOUT2_OFF() D_P10_OFF()
#define D_ADC_SCLK2_OFF() D_P16_OFF();D_adc_delay();
#define D_ADC_DOUT3_INIT() ///D_P11_INIT()
#define D_ADC_SCLK3_INIT() ///D_P13_INIT()
#define D_ADC_DOUT3_AT() D_P11_AT()
#define D_ADC_DOUT3_ON() D_P11_ON()
#define D_ADC_SCLK3_ON() D_P13_ON();D_adc_delay2();
#define D_ADC_DOUT3_OFF() D_P11_OFF()
#define D_ADC_SCLK3_OFF() D_P13_OFF();D_adc_delay();
#define D_ADC_DOUT3_AT() D_P37_AT()
#define D_ADC_DOUT3_ON() D_P37_ON()
#define D_ADC_SCLK3_ON() D_P34_ON();D_adc_delay2();
#define D_ADC_DOUT3_OFF() D_P37_OFF()
#define D_ADC_SCLK3_OFF() D_P34_OFF();D_adc_delay();
#define D_ADC_DOUT4_INIT() ///D_P34_INIT()
#define D_ADC_SCLK4_INIT() ///D_P33_INIT()
#define D_ADC_DOUT4_AT() D_P34_AT()
#define D_ADC_DOUT4_ON() D_P34_ON()
#define D_ADC_SCLK4_ON() D_P33_ON();D_adc_delay2();
#define D_ADC_DOUT4_OFF() D_P34_OFF()
#define D_ADC_SCLK4_OFF() D_P33_OFF();D_adc_delay();
#define D_ADC_DOUT4_AT() D_P33_AT()
#define D_ADC_DOUT4_ON() D_P33_ON()
#define D_ADC_SCLK4_ON() D_P32_ON();D_adc_delay2();
#define D_ADC_DOUT4_OFF() D_P33_OFF()
#define D_ADC_SCLK4_OFF() D_P32_OFF();D_adc_delay();
@ -137,14 +136,14 @@ P3.0 RXD0 11
#define D_ADC_TEMP_INIT() ///D_P12_INIT()
#define D_ADC_TEMP_ON() D_P12_ON()
#define D_ADC_TEMP_OFF() D_P12_OFF()
#define D_ADC_TEMP_ON() //D_P12_ON()
#define D_ADC_TEMP_OFF() //D_P12_OFF()
#define D_ADC_PDWN_INIT() ///D_P54_INIT()
#define D_ADC_PDWN_OFF() D_P54_OFF()
#define D_ADC_PDWN_ON() D_P54_ON()
#define D_ADC_PDWN_OFF() D_P11_OFF()
#define D_ADC_PDWN_ON() D_P11_ON()
@ -152,10 +151,10 @@ P3.0 RXD0 11
#define D_ADC_GAIN1_INIT() ///D_P37_INIT()
#define D_ADC_GAIN0_INIT() ///D_P36_INIT()
#define D_ADC_GAIN1_OFF() D_P37_OFF()
#define D_ADC_GAIN0_OFF() D_P36_OFF()
#define D_ADC_GAIN1_ON() D_P37_ON()
#define D_ADC_GAIN0_ON() D_P36_ON()
#define D_ADC_GAIN1_OFF() //D_P37_OFF()
#define D_ADC_GAIN0_OFF() D_P12_OFF()
#define D_ADC_GAIN1_ON() //D_P37_ON()
#define D_ADC_GAIN0_ON() D_P12_ON()
// #define D_ADS1213_GAIN_VAL 1
// #define D_ADS1213_GAIN_VAL 2

4
source/clib/type.h

@ -268,8 +268,8 @@ typedef struct
#define HIGHT 1
#define LOW 0
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#ifndef __MIN
#define __MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX

384
source/cpu/stc_macro.H

@ -0,0 +1,384 @@
//////////////////////////////////////////////////////////////////////////
/// COPYRIGHT NOTICE
/// Copyright (c) 2018, 传控科技
/// All rights reserved.
///
/// @file __C51_MACRO_H_
/// @brief macro define 和cpu相关,可以和同一个系列的cpu共享
///
///(本文件实现的功能的详述)
///
/// @version 1.1 CCsens technology
/// @author CC
/// @date 20180102
//
//////////////////////////////////////////////////////////////////////////
#ifndef __STC_MACRO_H_
#define __STC_MACRO_H_
#include<intrins.h>
#include "../clib/bit.h"
#define NOP() _nop_()
#define D_P07_ON() P07 = 1
#define D_P06_ON() P06 = 1
#define D_P05_ON() P05 = 1
#define D_P04_ON() P04 = 1
#define D_P03_ON() P03 = 1
#define D_P02_ON() P02 = 1
#define D_P01_ON() P01 = 1
#define D_P00_ON() P00 = 1
#define D_P07_OFF() P07 = 0
#define D_P06_OFF() P06 = 0
#define D_P05_OFF() P05 = 0
#define D_P04_OFF() P04 = 0
#define D_P03_OFF() P03 = 0
#define D_P02_OFF() P02 = 0
#define D_P01_OFF() P01 = 0
#define D_P00_OFF() P00 = 0
#define D_P07_AT() (P07)
#define D_P06_AT() (P06)
#define D_P05_AT() (P05)
#define D_P04_AT() (P04)
#define D_P03_AT() (P03)
#define D_P02_AT() (P02)
#define D_P01_AT() (P01)
#define D_P00_AT() (P00)
#define D_P07_REV() P07 = ~P07
#define D_P06_REV() P06 = ~P06
#define D_P05_REV() P05 = ~P05
#define D_P04_REV() P04 = ~P04
#define D_P03_REV() P03 = ~P03
#define D_P02_REV() P02 = ~P02
#define D_P01_REV() P01 = ~P01
#define D_P00_REV() P00 = ~P00
#define D_P17_ON() P17 = 1
#define D_P16_ON() P16 = 1
#define D_P15_ON() P15 = 1
#define D_P14_ON() P14 = 1
#define D_P13_ON() P13 = 1
#define D_P12_ON() P12 = 1
#define D_P11_ON() P11 = 1
#define D_P10_ON() P10 = 1
#define D_P17_OFF() P17 = 0
#define D_P16_OFF() P16 = 0
#define D_P15_OFF() P15 = 0
#define D_P14_OFF() P14 = 0
#define D_P13_OFF() P13 = 0
#define D_P12_OFF() P12 = 0
#define D_P11_OFF() P11 = 0
#define D_P10_OFF() P10 = 0
#define D_P17_AT() (P17)
#define D_P16_AT() (P16)
#define D_P15_AT() (P15)
#define D_P14_AT() (P14)
#define D_P13_AT() (P13)
#define D_P12_AT() (P12)
#define D_P11_AT() (P11)
#define D_P10_AT() (P10)
#define D_P17_REV() P17 = ~P17
#define D_P16_REV() P16 = ~P16
#define D_P15_REV() P15 = ~P15
#define D_P14_REV() P14 = ~P14
#define D_P13_REV() P13 = ~P13
#define D_P12_REV() P12 = ~P12
#define D_P11_REV() P11 = ~P11
#define D_P10_REV() P10 = ~P10
#define D_P27_ON() P27 = 1
#define D_P26_ON() P26 = 1
#define D_P25_ON() P25 = 1
#define D_P24_ON() P24 = 1
#define D_P23_ON() P23 = 1
#define D_P22_ON() P22 = 1
#define D_P21_ON() P21 = 1
#define D_P20_ON() P20 = 1
#define D_P27_OFF() P27 = 0
#define D_P26_OFF() P26 = 0
#define D_P25_OFF() P25 = 0
#define D_P24_OFF() P24 = 0
#define D_P23_OFF() P23 = 0
#define D_P22_OFF() P22 = 0
#define D_P21_OFF() P21 = 0
#define D_P20_OFF() P20 = 0
#define D_P27_AT() (P27)
#define D_P26_AT() (P26)
#define D_P25_AT() (P25)
#define D_P24_AT() (P24)
#define D_P23_AT() (P23)
#define D_P22_AT() (P22)
#define D_P21_AT() (P21)
#define D_P20_AT() (P20)
#define D_P27_REV() P27 = ~P27
#define D_P26_REV() P26 = ~P26
#define D_P25_REV() P25 = ~P25
#define D_P24_REV() P24 = ~P24
#define D_P23_REV() P23 = ~P23
#define D_P22_REV() P22 = ~P22
#define D_P21_REV() P21 = ~P21
#define D_P20_REV() P20 = ~P20
#define D_P37_ON() P37 = 1
#define D_P36_ON() P36 = 1
#define D_P35_ON() P35 = 1
#define D_P34_ON() P34 = 1
#define D_P33_ON() P33 = 1
#define D_P32_ON() P32 = 1
#define D_P31_ON() P31 = 1
#define D_P30_ON() P30 = 1
#define D_P37_OFF() P37 = 0
#define D_P36_OFF() P36 = 0
#define D_P35_OFF() P35 = 0
#define D_P34_OFF() P34 = 0
#define D_P33_OFF() P33 = 0
#define D_P32_OFF() P32 = 0
#define D_P31_OFF() P31 = 0
#define D_P30_OFF() P30 = 0
#define D_P37_AT() (P37)
#define D_P36_AT() (P36)
#define D_P35_AT() (P35)
#define D_P34_AT() (P34)
#define D_P33_AT() (P33)
#define D_P32_AT() (P32)
#define D_P31_AT() (P31)
#define D_P30_AT() (P30)
#define D_P37_REV() P37 = ~P37
#define D_P36_REV() P36 = ~P36
#define D_P35_REV() P35 = ~P35
#define D_P34_REV() P34 = ~P34
#define D_P33_REV() P33 = ~P33
#define D_P32_REV() P32 = ~P32
#define D_P31_REV() P31 = ~P31
#define D_P30_REV() P30 = ~P30
#define D_P47_ON() P47 = 1
#define D_P46_ON() P46 = 1
#define D_P45_ON() P45 = 1
#define D_P44_ON() P44 = 1
#define D_P43_ON() P43 = 1
#define D_P42_ON() P42 = 1
#define D_P41_ON() P41 = 1
#define D_P40_ON() P40 = 1
#define D_P47_OFF() P47 = 0
#define D_P46_OFF() P46 = 0
#define D_P45_OFF() P45 = 0
#define D_P44_OFF() P44 = 0
#define D_P43_OFF() P43 = 0
#define D_P42_OFF() P42 = 0
#define D_P41_OFF() P41 = 0
#define D_P40_OFF() P40 = 0
#define D_P47_AT() (P47)
#define D_P46_AT() (P46)
#define D_P45_AT() (P45)
#define D_P44_AT() (P44)
#define D_P43_AT() (P43)
#define D_P42_AT() (P42)
#define D_P41_AT() (P41)
#define D_P40_AT() (P40)
#define D_P47_REV() P47 = ~P47
#define D_P46_REV() P46 = ~P46
#define D_P45_REV() P45 = ~P45
#define D_P44_REV() P44 = ~P44
#define D_P43_REV() P43 = ~P43
#define D_P42_REV() P42 = ~P42
#define D_P41_REV() P41 = ~P41
#define D_P40_REV() P40 = ~P40
#define D_P57_ON() P57 = 1
#define D_P56_ON() P56 = 1
#define D_P55_ON() P55 = 1
#define D_P54_ON() P54 = 1
#define D_P53_ON() P53 = 1
#define D_P52_ON() P52 = 1
#define D_P51_ON() P51 = 1
#define D_P50_ON() P50 = 1
#define D_P57_OFF() P57 = 0
#define D_P56_OFF() P56 = 0
#define D_P55_OFF() P55 = 0
#define D_P54_OFF() P54 = 0
#define D_P53_OFF() P53 = 0
#define D_P52_OFF() P52 = 0
#define D_P51_OFF() P51 = 0
#define D_P50_OFF() P50 = 0
#define D_P57_AT() (P57)
#define D_P56_AT() (P56)
#define D_P55_AT() (P55)
#define D_P54_AT() (P54)
#define D_P53_AT() (P53)
#define D_P52_AT() (P52)
#define D_P51_AT() (P51)
#define D_P50_AT() (P50)
#define D_P57_REV() P57 = ~P57
#define D_P56_REV() P56 = ~P56
#define D_P55_REV() P55 = ~P55
#define D_P54_REV() P54 = ~P54
#define D_P53_REV() P53 = ~P53
#define D_P52_REV() P52 = ~P52
#define D_P51_REV() P51 = ~P51
#define D_P50_REV() P50 = ~P50
#define D_P67_ON() P67 = 1
#define D_P66_ON() P66 = 1
#define D_P65_ON() P65 = 1
#define D_P64_ON() P64 = 1
#define D_P63_ON() P63 = 1
#define D_P62_ON() P62 = 1
#define D_P61_ON() P61 = 1
#define D_P60_ON() P60 = 1
#define D_P67_OFF() P67 = 0
#define D_P66_OFF() P66 = 0
#define D_P65_OFF() P65 = 0
#define D_P64_OFF() P64 = 0
#define D_P63_OFF() P63 = 0
#define D_P62_OFF() P62 = 0
#define D_P61_OFF() P61 = 0
#define D_P60_OFF() P60 = 0
#define D_P67_AT() (P67)
#define D_P66_AT() (P66)
#define D_P65_AT() (P65)
#define D_P64_AT() (P64)
#define D_P63_AT() (P63)
#define D_P62_AT() (P62)
#define D_P61_AT() (P61)
#define D_P60_AT() (P60)
#define D_P67_REV() P67 = ~P67
#define D_P66_REV() P66 = ~P66
#define D_P65_REV() P65 = ~P65
#define D_P64_REV() P64 = ~P64
#define D_P63_REV() P63 = ~P63
#define D_P62_REV() P62 = ~P62
#define D_P61_REV() P61 = ~P61
#define D_P60_REV() P60 = ~P60
#define D_P77_ON() P77 = 1
#define D_P76_ON() P76 = 1
#define D_P75_ON() P75 = 1
#define D_P74_ON() P74 = 1
#define D_P73_ON() P73 = 1
#define D_P72_ON() P72 = 1
#define D_P71_ON() P71 = 1
#define D_P70_ON() P70 = 1
#define D_P77_OFF() P77 = 0
#define D_P76_OFF() P76 = 0
#define D_P75_OFF() P75 = 0
#define D_P74_OFF() P74 = 0
#define D_P73_OFF() P73 = 0
#define D_P72_OFF() P72 = 0
#define D_P71_OFF() P71 = 0
#define D_P70_OFF() P70 = 0
#define D_P77_AT() (P77)
#define D_P76_AT() (P76)
#define D_P75_AT() (P75)
#define D_P74_AT() (P74)
#define D_P73_AT() (P73)
#define D_P72_AT() (P72)
#define D_P71_AT() (P71)
#define D_P70_AT() (P70)
#define D_P77_REV() P77 = ~P77
#define D_P76_REV() P76 = ~P76
#define D_P75_REV() P75 = ~P75
#define D_P74_REV() P74 = ~P74
#define D_P73_REV() P73 = ~P73
#define D_P72_REV() P72 = ~P72
#define D_P71_REV() P71 = ~P71
#define D_P70_REV() P70 = ~P70
#define D_stdIO_P0_ALL() P0M1=0;P0M0=0;
#define D_HighI_P0_ALL() P0M1=0;P0M0=0XFF;
#define D_HighR_P0_ALL() P0M1=0XFF;P0M0=0;
#define D_OpenD_P0_ALL() P0M1=0XFF;P0M0=0XFF;
#define D_stdIO_P1_ALL() P1M1=0;P1M0=0;
#define D_HighI_P1_ALL() P1M1=0;P1M0=0XFF;
#define D_HighR_P1_ALL() P1M1=0XFF;P1M0=0;
#define D_OpenD_P1_ALL() P1M1=0XFF;P1M0=0XFF;
#define D_stdIO_P2_ALL() P2M1=0;P2M0=0;
#define D_HighI_P2_ALL() P2M1=0;P2M0=0XFF;
#define D_HighR_P2_ALL() P2M1=0XFF;P2M0=0;
#define D_OpenD_P2_ALL() P2M1=0XFF;P2M0=0XFF;
#define D_stdIO_P3_ALL() P3M1=0;P3M0=0;
#define D_HighI_P3_ALL() P3M1=0;P3M0=0XFF;
#define D_HighR_P3_ALL() P3M1=0XFF;P3M0=0;
#define D_OpenD_P3_ALL() P3M1=0XFF;P3M0=0XFF;
#define D_stdIO_P4_ALL() P4M1=0;P4M0=0;
#define D_HighI_P4_ALL() P4M1=0;P4M0=0XFF;
#define D_HighR_P4_ALL() P4M1=0XFF;P4M0=0;
#define D_OpenD_P4_ALL() P4M1=0XFF;P4M0=0XFF;
#define D_stdIO_P5_ALL() P5M1=0;P5M0=0;
#define D_HighI_P5_ALL() P5M1=0;P5M0=0XFF;
#define D_HighR_P5_ALL() P5M1=0XFF;P5M0=0;
#define D_OpenD_P5_ALL() P5M1=0XFF;P5M0=0XFF;
#define D_stdIO_P6_ALL() P6M1=0;P6M0=0;
#define D_HighI_P6_ALL() P6M1=0;P6M0=0XFF;
#define D_HighR_P6_ALL() P6M1=0XFF;P6M0=0;
#define D_OpenD_P6_ALL() P6M1=0XFF;P6M0=0XFF;
#define D_stdIO_P7_ALL() P7M1=0;P7M0=0;
#define D_HighI_P7_ALL() P7M1=0;P7M0=0XFF;
#define D_HighR_P7_ALL() P7M1=0XFF;P7M0=0;
#define D_OpenD_P7_ALL() P7M1=0XFF;P7M0=0XFF;
////Notice: n: BITN0---BITN7 不是0-7 eg:D_stdIO_P0(BITN0)
#define D_stdIO_P0(n) BITN_0(P0M1,n);BITN_0(P0M0,n); //////00 准双向口 灌电流20mA 拉电流270-150uS
#define D_HighI_P0(n) BITN_0(P0M1,n);BITN_1(P0M0,n); //////01 推挽输出 20mA 加限流
#define D_HighR_P0(n) BITN_1(P0M1,n);BITN_0(P0M0,n); /////////10 高阻
#define D_OpenD_P0(n) BITN_1(P0M1,n);BITN_1(P0M0,n); /////11 开漏 open-Drain 内部上拉电阻断开 开漏模式既可以度外部状态也可以对外输出高低电平
#define D_stdIO_P1(n) BITN_0(P1M1,n);BITN_0(P1M0,n); //////00 准双向口 灌电流20mA 拉电流270-150uS
#define D_HighI_P1(n) BITN_0(P1M1,n);BITN_1(P1M0,n); //////01 推挽输出 20mA 加限流
#define D_HighR_P1(n) BITN_1(P1M1,n);BITN_0(P1M0,n); /////////10 高阻
#define D_OpenD_P1(n) BITN_1(P1M1,n);BITN_1(P1M0,n); /////11 开漏 open-Drain 内部上拉电阻断开 开漏模式既可以度外部状态也可以对外输出高低电平
#define D_stdIO_P2(n) BITN_0(P2M1,n);BITN_0(P2M0,n); //////00 准双向口 灌电流20mA 拉电流270-150uS
#define D_HighI_P2(n) BITN_0(P2M1,n);BITN_1(P2M0,n); //////01 推挽输出 20mA 加限流
#define D_HighR_P2(n) BITN_1(P2M1,n);BITN_0(P2M0,n); /////////10 高阻
#define D_OpenD_P2(n) BITN_1(P2M1,n);BITN_1(P2M0,n); /////11 开漏 open-Drain 内部上拉电阻断开 开漏模式既可以度外部状态也可以对外输出高低电平
#define D_stdIO_P3(n) BITN_0(P3M1,n);BITN_0(P3M0,n); //////00 准双向口 灌电流20mA 拉电流270-150uS
#define D_HighI_P3(n) BITN_0(P3M1,n);BITN_1(P3M0,n); //////01 推挽输出 20mA 加限流
#define D_HighR_P3(n) BITN_1(P3M1,n);BITN_0(P3M0,n); /////////10 高阻
#define D_OpenD_P3(n) BITN_1(P3M1,n);BITN_1(P3M0,n); /////11 开漏 open-Drain 内部上拉电阻断开 开漏模式既可以度外部状态也可以对外输出高低电平
#define D_stdIO_P4(n) BITN_0(P4M1,n);BITN_0(P4M0,n); //////00 准双向口 灌电流20mA 拉电流270-150uS
#define D_HighI_P4(n) BITN_0(P4M1,n);BITN_1(P4M0,n); //////01 推挽输出 20mA 加限流
#define D_HighR_P4(n) BITN_1(P4M1,n);BITN_0(P4M0,n); /////////10 高阻
#define D_OpenD_P4(n) BITN_1(P4M1,n);BITN_1(P4M0,n); /////11 开漏 open-Drain 内部上拉电阻断开 开漏模式既可以度外部状态也可以对外输出高低电平
#define D_stdIO_P5(n) BITN_0(P5M1,n);BITN_0(P5M0,n); //////00 准双向口 灌电流20mA 拉电流270-150uS
#define D_HighI_P5(n) BITN_0(P5M1,n);BITN_1(P5M0,n); //////01 推挽输出 20mA 加限流
#define D_HighR_P5(n) BITN_1(P5M1,n);BITN_0(P5M0,n); /////////10 高阻
#define D_OpenD_P5(n) BITN_1(P5M1,n);BITN_1(P5M0,n); /////11 开漏 open-Drain 内部上拉电阻断开 开漏模式既可以度外部状态也可以对外输出高低电平
#define D_stdIO_P6(n) BITN_0(P6M1,n);BITN_0(P6M0,n); //////00 准双向口 灌电流20mA 拉电流270-150uS
#define D_HighI_P6(n) BITN_0(P6M1,n);BITN_1(P6M0,n); //////01 推挽输出 20mA 加限流
#define D_HighR_P6(n) BITN_1(P6M1,n);BITN_0(P6M0,n); /////////10 高阻
#define D_OpenD_P6(n) BITN_1(P6M1,n);BITN_1(P6M0,n); /////11 开漏 open-Drain 内部上拉电阻断开 开漏模式既可以度外部状态也可以对外输出高低电平
#define D_stdIO_P7(n) BITN_0(P7M1,n);BITN_0(P7M0,n); //////00 准双向口 灌电流20mA 拉电流270-150uS
#define D_HighI_P7(n) BITN_0(P7M1,n);BITN_1(P7M0,n); //////01 推挽输出 20mA 加限流
#define D_HighR_P7(n) BITN_1(P7M1,n);BITN_0(P7M0,n); /////////10 高阻
#define D_OpenD_P7(n) BITN_1(P7M1,n);BITN_1(P7M0,n); /////11 开漏 open-Drain 内部上拉电阻断开 开漏模式既可以度外部状态也可以对外输出高低电平
#endif //__STC_MACRO_H_

640
source/cpu/stc_stc8hxx.h

@ -0,0 +1,640 @@
#ifndef __STC8H_H__
#define __STC8H_H__
/////////////////////////////////////////////////
//包含本头文件后,不用另外再包含"REG51.H"
sfr P0 = 0x80;
sbit P00 = P0^0;
sbit P01 = P0^1;
sbit P02 = P0^2;
sbit P03 = P0^3;
sbit P04 = P0^4;
sbit P05 = P0^5;
sbit P06 = P0^6;
sbit P07 = P0^7;
sfr SP = 0x81;
sfr DPL = 0x82;
sfr DPH = 0x83;
sfr S4CON = 0x84;
sfr S4BUF = 0x85;
sfr PCON = 0x87;
sfr TCON = 0x88;
sbit TF1 = TCON^7;
sbit TR1 = TCON^6;
sbit TF0 = TCON^5;
sbit TR0 = TCON^4;
sbit IE1 = TCON^3;
sbit IT1 = TCON^2;
sbit IE0 = TCON^1;
sbit IT0 = TCON^0;
sfr TMOD = 0x89;
sfr TL0 = 0x8a;
sfr TL1 = 0x8b;
sfr TH0 = 0x8c;
sfr TH1 = 0x8d;
sfr AUXR = 0x8e;
sfr INTCLKO = 0x8f;
sfr P1 = 0x90;
sbit P10 = P1^0;
sbit P11 = P1^1;
sbit P12 = P1^2;
sbit P13 = P1^3;
sbit P14 = P1^4;
sbit P15 = P1^5;
sbit P16 = P1^6;
sbit P17 = P1^7;
sfr P1M1 = 0x91;
sfr P1M0 = 0x92;
sfr P0M1 = 0x93;
sfr P0M0 = 0x94;
sfr P2M1 = 0x95;
sfr P2M0 = 0x96;
sfr SCON = 0x98;
sbit SM0 = SCON^7;
sbit SM1 = SCON^6;
sbit SM2 = SCON^5;
sbit REN = SCON^4;
sbit TB8 = SCON^3;
sbit RB8 = SCON^2;
sbit TI = SCON^1;
sbit RI = SCON^0;
sfr SBUF = 0x99;
sfr S2CON = 0x9a;
sfr S2BUF = 0x9b;
sfr IRCBAND = 0x9d;
sfr LIRTRIM = 0x9e;
sfr IRTRIM = 0x9f;
sfr P2 = 0xa0;
sbit P20 = P2^0;
sbit P21 = P2^1;
sbit P22 = P2^2;
sbit P23 = P2^3;
sbit P24 = P2^4;
sbit P25 = P2^5;
sbit P26 = P2^6;
sbit P27 = P2^7;
sfr P_SW1 = 0xa2;
sfr IE = 0xa8;
sbit EA = IE^7;
sbit ELVD = IE^6;
sbit EADC = IE^5;
sbit ES = IE^4;
sbit ET1 = IE^3;
sbit EX1 = IE^2;
sbit ET0 = IE^1;
sbit EX0 = IE^0;
sfr SADDR = 0xa9;
sfr WKTCL = 0xaa;
sfr WKTCH = 0xab;
sfr S3CON = 0xac;
sfr S3BUF = 0xad;
sfr TA = 0xae;
sfr IE2 = 0xaf;
sfr P3 = 0xb0;
sbit P30 = P3^0;
sbit P31 = P3^1;
sbit P32 = P3^2;
sbit P33 = P3^3;
sbit P34 = P3^4;
sbit P35 = P3^5;
sbit P36 = P3^6;
sbit P37 = P3^7;
sfr P3M1 = 0xb1;
sfr P3M0 = 0xb2;
sfr P4M1 = 0xb3;
sfr P4M0 = 0xb4;
sfr IP2 = 0xb5;
sfr IP2H = 0xb6;
sfr IPH = 0xb7;
sfr IP = 0xb8;
sbit PPCA = IP^7;
sbit PLVD = IP^6;
sbit PADC = IP^5;
sbit PS = IP^4;
sbit PT1 = IP^3;
sbit PX1 = IP^2;
sbit PT0 = IP^1;
sbit PX0 = IP^0;
sfr SADEN = 0xb9;
sfr P_SW2 = 0xba;
sfr ADC_CONTR = 0xbc;
sfr ADC_RES = 0xbd;
sfr ADC_RESL = 0xbe;
sfr P4 = 0xc0;
sbit P40 = P4^0;
sbit P41 = P4^1;
sbit P42 = P4^2;
sbit P43 = P4^3;
sbit P44 = P4^4;
sbit P45 = P4^5;
sbit P46 = P4^6;
sbit P47 = P4^7;
sfr WDT_CONTR = 0xc1;
sfr IAP_DATA = 0xc2;
sfr IAP_ADDRH = 0xc3;
sfr IAP_ADDRL = 0xc4;
sfr IAP_CMD = 0xc5;
sfr IAP_TRIG = 0xc6;
sfr IAP_CONTR = 0xc7;
sfr P5 = 0xc8;
sbit P50 = P5^0;
sbit P51 = P5^1;
sbit P52 = P5^2;
sbit P53 = P5^3;
sbit P54 = P5^4;
sbit P55 = P5^5;
sbit P56 = P5^6;
sbit P57 = P5^7;
sfr P5M1 = 0xc9;
sfr P5M0 = 0xca;
sfr P6M1 = 0xcb;
sfr P6M0 = 0xcc;
sfr SPSTAT = 0xcd;
sfr SPCTL = 0xce;
sfr SPDAT = 0xcf;
sfr PSW = 0xd0;
sbit CY = PSW^7;
sbit AC = PSW^6;
sbit F0 = PSW^5;
sbit RS1 = PSW^4;
sbit RS0 = PSW^3;
sbit OV = PSW^2;
sbit F1 = PSW^1;
sbit P = PSW^0;
sfr T4T3M = 0xd1;
sfr T4H = 0xd2;
sfr T4L = 0xd3;
sfr T3H = 0xd4;
sfr T3L = 0xd5;
sfr T2H = 0xd6;
sfr T2L = 0xd7;
sfr USBCLK = 0xdc;
sfr ADCCFG = 0xde;
sfr IP3 = 0xdf;
sfr ACC = 0xe0;
sfr P7M1 = 0xe1;
sfr P7M0 = 0xe2;
sfr DPS = 0xe3;
sfr DPL1 = 0xe4;
sfr DPH1 = 0xe5;
sfr CMPCR1 = 0xe6;
sfr CMPCR2 = 0xe7;
sfr P6 = 0xe8;
sfr USBDAT = 0xec;
sfr IP3H = 0xee;
sfr AUXINTIF = 0xef;
sfr B = 0xf0;
sfr USBCON = 0xf4;
sfr IAP_TPS = 0xf5;
sfr P7 = 0xf8;
sfr USBADR = 0xfc;
sfr RSTCFG = 0xff;
//如下特殊功能寄存器位于扩展RAM区域
//访问这些寄存器,需先将P_SW2的BIT7设置为1,才可正常读写
/////////////////////////////////////////////////
//FF00H-FFFFH
/////////////////////////////////////////////////
/////////////////////////////////////////////////
//FE00H-FEFFH
/////////////////////////////////////////////////
#define CKSEL (*(unsigned char volatile xdata *)0xfe00)
#define CLKDIV (*(unsigned char volatile xdata *)0xfe01)
#define HIRCCR (*(unsigned char volatile xdata *)0xfe02)
#define XOSCCR (*(unsigned char volatile xdata *)0xfe03)
#define IRC32KCR (*(unsigned char volatile xdata *)0xfe04)
#define MCLKOCR (*(unsigned char volatile xdata *)0xfe05)
#define IRCDB (*(unsigned char volatile xdata *)0xfe06)
#define X32KCR (*(unsigned char volatile xdata *)0xfe08)
#define P0PU (*(unsigned char volatile xdata *)0xfe10)
#define P1PU (*(unsigned char volatile xdata *)0xfe11)
#define P2PU (*(unsigned char volatile xdata *)0xfe12)
#define P3PU (*(unsigned char volatile xdata *)0xfe13)
#define P4PU (*(unsigned char volatile xdata *)0xfe14)
#define P5PU (*(unsigned char volatile xdata *)0xfe15)
#define P6PU (*(unsigned char volatile xdata *)0xfe16)
#define P7PU (*(unsigned char volatile xdata *)0xfe17)
#define P0NCS (*(unsigned char volatile xdata *)0xfe18)
#define P1NCS (*(unsigned char volatile xdata *)0xfe19)
#define P2NCS (*(unsigned char volatile xdata *)0xfe1a)
#define P3NCS (*(unsigned char volatile xdata *)0xfe1b)
#define P4NCS (*(unsigned char volatile xdata *)0xfe1c)
#define P5NCS (*(unsigned char volatile xdata *)0xfe1d)
#define P6NCS (*(unsigned char volatile xdata *)0xfe1e)
#define P7NCS (*(unsigned char volatile xdata *)0xfe1f)
#define P0SR (*(unsigned char volatile xdata *)0xfe20)
#define P1SR (*(unsigned char volatile xdata *)0xfe21)
#define P2SR (*(unsigned char volatile xdata *)0xfe22)
#define P3SR (*(unsigned char volatile xdata *)0xfe23)
#define P4SR (*(unsigned char volatile xdata *)0xfe24)
#define P5SR (*(unsigned char volatile xdata *)0xfe25)
#define P6SR (*(unsigned char volatile xdata *)0xfe26)
#define P7SR (*(unsigned char volatile xdata *)0xfe27)
#define P0DR (*(unsigned char volatile xdata *)0xfe28)
#define P1DR (*(unsigned char volatile xdata *)0xfe29)
#define P2DR (*(unsigned char volatile xdata *)0xfe2a)
#define P3DR (*(unsigned char volatile xdata *)0xfe2b)
#define P4DR (*(unsigned char volatile xdata *)0xfe2c)
#define P5DR (*(unsigned char volatile xdata *)0xfe2d)
#define P6DR (*(unsigned char volatile xdata *)0xfe2e)
#define P7DR (*(unsigned char volatile xdata *)0xfe2f)
#define P0IE (*(unsigned char volatile xdata *)0xfe30)
#define P1IE (*(unsigned char volatile xdata *)0xfe31)
#define P2IE (*(unsigned char volatile xdata *)0xfe32)
#define P3IE (*(unsigned char volatile xdata *)0xfe33)
#define P4IE (*(unsigned char volatile xdata *)0xfe34)
#define P5IE (*(unsigned char volatile xdata *)0xfe35)
#define P6IE (*(unsigned char volatile xdata *)0xfe36)
#define P7IE (*(unsigned char volatile xdata *)0xfe37)
#define RTCCR (*(unsigned char volatile xdata *)0xfe60)
#define RTCCFG (*(unsigned char volatile xdata *)0xfe61)
#define RTCIEN (*(unsigned char volatile xdata *)0xfe62)
#define RTCIF (*(unsigned char volatile xdata *)0xfe63)
#define ALAHOUR (*(unsigned char volatile xdata *)0xfe64)
#define ALAMIN (*(unsigned char volatile xdata *)0xfe65)
#define ALASEC (*(unsigned char volatile xdata *)0xfe66)
#define ALASSEC (*(unsigned char volatile xdata *)0xfe67)
#define INIYEAR (*(unsigned char volatile xdata *)0xfe68)
#define INIMONTH (*(unsigned char volatile xdata *)0xfe69)
#define INIDAY (*(unsigned char volatile xdata *)0xfe6a)
#define INIHOUR (*(unsigned char volatile xdata *)0xfe6b)
#define INIMIN (*(unsigned char volatile xdata *)0xfe6c)
#define INISEC (*(unsigned char volatile xdata *)0xfe6d)
#define INISSEC (*(unsigned char volatile xdata *)0xfe6e)
#define YEAR (*(unsigned char volatile xdata *)0xfe70)
#define MONTH (*(unsigned char volatile xdata *)0xfe71)
#define DAY (*(unsigned char volatile xdata *)0xfe72)
#define HOUR (*(unsigned char volatile xdata *)0xfe73)
#define MIN (*(unsigned char volatile xdata *)0xfe74)
#define SEC (*(unsigned char volatile xdata *)0xfe75)
#define SSEC (*(unsigned char volatile xdata *)0xfe76)
#define I2CCFG (*(unsigned char volatile xdata *)0xfe80)
#define I2CMSCR (*(unsigned char volatile xdata *)0xfe81)
#define I2CMSST (*(unsigned char volatile xdata *)0xfe82)
#define I2CSLCR (*(unsigned char volatile xdata *)0xfe83)
#define I2CSLST (*(unsigned char volatile xdata *)0xfe84)
#define I2CSLADR (*(unsigned char volatile xdata *)0xfe85)
#define I2CTXD (*(unsigned char volatile xdata *)0xfe86)
#define I2CRXD (*(unsigned char volatile xdata *)0xfe87)
#define I2CMSAUX (*(unsigned char volatile xdata *)0xfe88)
#define TM2PS (*(unsigned char volatile xdata *)0xfea2)
#define TM3PS (*(unsigned char volatile xdata *)0xfea3)
#define TM4PS (*(unsigned char volatile xdata *)0xfea4)
#define ADCTIM (*(unsigned char volatile xdata *)0xfea8)
#define PWM1_ETRPS (*(unsigned char volatile xdata *)0xfeb0)
#define PWM1_ENO (*(unsigned char volatile xdata *)0xfeb1)
#define PWM1_PS (*(unsigned char volatile xdata *)0xfeb2)
#define PWM1_IOAUX (*(unsigned char volatile xdata *)0xfeb3)
#define PWM2_ETRPS (*(unsigned char volatile xdata *)0xfeb4)
#define PWM2_ENO (*(unsigned char volatile xdata *)0xfeb5)
#define PWM2_PS (*(unsigned char volatile xdata *)0xfeb6)
#define PWM2_IOAUX (*(unsigned char volatile xdata *)0xfeb7)
#define PWM1_CR1 (*(unsigned char volatile xdata *)0xfec0)
#define PWM1_CR2 (*(unsigned char volatile xdata *)0xfec1)
#define PWM1_SMCR (*(unsigned char volatile xdata *)0xfec2)
#define PWM1_ETR (*(unsigned char volatile xdata *)0xfec3)
#define PWM1_IER (*(unsigned char volatile xdata *)0xfec4)
#define PWM1_SR1 (*(unsigned char volatile xdata *)0xfec5)
#define PWM1_SR2 (*(unsigned char volatile xdata *)0xfec6)
#define PWM1_EGR (*(unsigned char volatile xdata *)0xfec7)
#define PWM1_CCMR1 (*(unsigned char volatile xdata *)0xfec8)
#define PWM1_CCMR2 (*(unsigned char volatile xdata *)0xfec9)
#define PWM1_CCMR3 (*(unsigned char volatile xdata *)0xfeca)
#define PWM1_CCMR4 (*(unsigned char volatile xdata *)0xfecb)
#define PWM1_CCER1 (*(unsigned char volatile xdata *)0xfecc)
#define PWM1_CCER2 (*(unsigned char volatile xdata *)0xfecd)
#define PWM1_CNTR (*(unsigned int volatile xdata *)0xfece)
#define PWM1_CNTRH (*(unsigned char volatile xdata *)0xfece)
#define PWM1_CNTRL (*(unsigned char volatile xdata *)0xfecf)
#define PWM1_PSCR (*(unsigned int volatile xdata *)0xfed0)
#define PWM1_PSCRH (*(unsigned char volatile xdata *)0xfed0)
#define PWM1_PSCRL (*(unsigned char volatile xdata *)0xfed1)
#define PWM1_ARR (*(unsigned int volatile xdata *)0xfed2)
#define PWM1_ARRH (*(unsigned char volatile xdata *)0xfed2)
#define PWM1_ARRL (*(unsigned char volatile xdata *)0xfed3)
#define PWM1_RCR (*(unsigned char volatile xdata *)0xfed4)
#define PWM1_CCR1 (*(unsigned int volatile xdata *)0xfed5)
#define PWM1_CCR1H (*(unsigned char volatile xdata *)0xfed5)
#define PWM1_CCR1L (*(unsigned char volatile xdata *)0xfed6)
#define PWM1_CCR2 (*(unsigned int volatile xdata *)0xfed7)
#define PWM1_CCR2H (*(unsigned char volatile xdata *)0xfed7)
#define PWM1_CCR2L (*(unsigned char volatile xdata *)0xfed8)
#define PWM1_CCR3 (*(unsigned int volatile xdata *)0xfed9)
#define PWM1_CCR3H (*(unsigned char volatile xdata *)0xfed9)
#define PWM1_CCR3L (*(unsigned char volatile xdata *)0xfeda)
#define PWM1_CCR4 (*(unsigned int volatile xdata *)0xfedb)
#define PWM1_CCR4H (*(unsigned char volatile xdata *)0xfedb)
#define PWM1_CCR4L (*(unsigned char volatile xdata *)0xfedc)
#define PWM1_BKR (*(unsigned char volatile xdata *)0xfedd)
#define PWM1_DTR (*(unsigned char volatile xdata *)0xfede)
#define PWM1_OISR (*(unsigned char volatile xdata *)0xfedf)
#define PWM2_CR1 (*(unsigned char volatile xdata *)0xfee0)
#define PWM2_CR2 (*(unsigned char volatile xdata *)0xfee1)
#define PWM2_SMCR (*(unsigned char volatile xdata *)0xfee2)
#define PWM2_ETR (*(unsigned char volatile xdata *)0xfee3)
#define PWM2_IER (*(unsigned char volatile xdata *)0xfee4)
#define PWM2_SR1 (*(unsigned char volatile xdata *)0xfee5)
#define PWM2_SR2 (*(unsigned char volatile xdata *)0xfee6)
#define PWM2_EGR (*(unsigned char volatile xdata *)0xfee7)
#define PWM2_CCMR1 (*(unsigned char volatile xdata *)0xfee8)
#define PWM2_CCMR2 (*(unsigned char volatile xdata *)0xfee9)
#define PWM2_CCMR3 (*(unsigned char volatile xdata *)0xfeea)
#define PWM2_CCMR4 (*(unsigned char volatile xdata *)0xfeeb)
#define PWM2_CCER1 (*(unsigned char volatile xdata *)0xfeec)
#define PWM2_CCER2 (*(unsigned char volatile xdata *)0xfeed)
#define PWM2_CNTR (*(unsigned int volatile xdata *)0xfeee)
#define PWM2_CNTRH (*(unsigned char volatile xdata *)0xfeee)
#define PWM2_CNTRL (*(unsigned char volatile xdata *)0xfeef)
#define PWM2_PSCR (*(unsigned int volatile xdata *)0xfef0)
#define PWM2_PSCRH (*(unsigned char volatile xdata *)0xfef0)
#define PWM2_PSCRL (*(unsigned char volatile xdata *)0xfef1)
#define PWM2_ARR (*(unsigned int volatile xdata *)0xfef2)
#define PWM2_ARRH (*(unsigned char volatile xdata *)0xfef2)
#define PWM2_ARRL (*(unsigned char volatile xdata *)0xfef3)
#define PWM2_RCR (*(unsigned char volatile xdata *)0xfef4)
#define PWM2_CCR1 (*(unsigned int volatile xdata *)0xfef5)
#define PWM2_CCR1H (*(unsigned char volatile xdata *)0xfef5)
#define PWM2_CCR1L (*(unsigned char volatile xdata *)0xfef6)
#define PWM2_CCR2 (*(unsigned int volatile xdata *)0xfef7)
#define PWM2_CCR2H (*(unsigned char volatile xdata *)0xfef7)
#define PWM2_CCR2L (*(unsigned char volatile xdata *)0xfef8)
#define PWM2_CCR3 (*(unsigned int volatile xdata *)0xfef9)
#define PWM2_CCR3H (*(unsigned char volatile xdata *)0xfef9)
#define PWM2_CCR3L (*(unsigned char volatile xdata *)0xfefa)
#define PWM2_CCR4 (*(unsigned int volatile xdata *)0xfefb)
#define PWM2_CCR4H (*(unsigned char volatile xdata *)0xfefb)
#define PWM2_CCR4L (*(unsigned char volatile xdata *)0xfefc)
#define PWM2_BKR (*(unsigned char volatile xdata *)0xfefd)
#define PWM2_DTR (*(unsigned char volatile xdata *)0xfefe)
#define PWM2_OISR (*(unsigned char volatile xdata *)0xfeff)
#define PWMA_ETRPS (*(unsigned char volatile xdata *)0xfeb0)
#define PWMA_ENO (*(unsigned char volatile xdata *)0xfeb1)
#define PWMA_PS (*(unsigned char volatile xdata *)0xfeb2)
#define PWMA_IOAUX (*(unsigned char volatile xdata *)0xfeb3)
#define PWMB_ETRPS (*(unsigned char volatile xdata *)0xfeb4)
#define PWMB_ENO (*(unsigned char volatile xdata *)0xfeb5)
#define PWMB_PS (*(unsigned char volatile xdata *)0xfeb6)
#define PWMB_IOAUX (*(unsigned char volatile xdata *)0xfeb7)
#define PWMA_CR1 (*(unsigned char volatile xdata *)0xfec0)
#define PWMA_CR2 (*(unsigned char volatile xdata *)0xfec1)
#define PWMA_SMCR (*(unsigned char volatile xdata *)0xfec2)
#define PWMA_ETR (*(unsigned char volatile xdata *)0xfec3)
#define PWMA_IER (*(unsigned char volatile xdata *)0xfec4)
#define PWMA_SR1 (*(unsigned char volatile xdata *)0xfec5)
#define PWMA_SR2 (*(unsigned char volatile xdata *)0xfec6)
#define PWMA_EGR (*(unsigned char volatile xdata *)0xfec7)
#define PWMA_CCMR1 (*(unsigned char volatile xdata *)0xfec8)
#define PWMA_CCMR2 (*(unsigned char volatile xdata *)0xfec9)
#define PWMA_CCMR3 (*(unsigned char volatile xdata *)0xfeca)
#define PWMA_CCMR4 (*(unsigned char volatile xdata *)0xfecb)
#define PWMA_CCER1 (*(unsigned char volatile xdata *)0xfecc)
#define PWMA_CCER2 (*(unsigned char volatile xdata *)0xfecd)
#define PWMA_CNTR (*(unsigned int volatile xdata *)0xfece)
#define PWMA_CNTRH (*(unsigned char volatile xdata *)0xfece)
#define PWMA_CNTRL (*(unsigned char volatile xdata *)0xfecf)
#define PWMA_PSCR (*(unsigned int volatile xdata *)0xfed0)
#define PWMA_PSCRH (*(unsigned char volatile xdata *)0xfed0)
#define PWMA_PSCRL (*(unsigned char volatile xdata *)0xfed1)
#define PWMA_ARR (*(unsigned int volatile xdata *)0xfed2)
#define PWMA_ARRH (*(unsigned char volatile xdata *)0xfed2)
#define PWMA_ARRL (*(unsigned char volatile xdata *)0xfed3)
#define PWMA_RCR (*(unsigned char volatile xdata *)0xfed4)
#define PWMA_CCR1 (*(unsigned int volatile xdata *)0xfed5)
#define PWMA_CCR1H (*(unsigned char volatile xdata *)0xfed5)
#define PWMA_CCR1L (*(unsigned char volatile xdata *)0xfed6)
#define PWMA_CCR2 (*(unsigned int volatile xdata *)0xfed7)
#define PWMA_CCR2H (*(unsigned char volatile xdata *)0xfed7)
#define PWMA_CCR2L (*(unsigned char volatile xdata *)0xfed8)
#define PWMA_CCR3 (*(unsigned int volatile xdata *)0xfed9)
#define PWMA_CCR3H (*(unsigned char volatile xdata *)0xfed9)
#define PWMA_CCR3L (*(unsigned char volatile xdata *)0xfeda)
#define PWMA_CCR4 (*(unsigned int volatile xdata *)0xfedb)
#define PWMA_CCR4H (*(unsigned char volatile xdata *)0xfedb)
#define PWMA_CCR4L (*(unsigned char volatile xdata *)0xfedc)
#define PWMA_BKR (*(unsigned char volatile xdata *)0xfedd)
#define PWMA_DTR (*(unsigned char volatile xdata *)0xfede)
#define PWMA_OISR (*(unsigned char volatile xdata *)0xfedf)
#define PWMB_CR1 (*(unsigned char volatile xdata *)0xfee0)
#define PWMB_CR2 (*(unsigned char volatile xdata *)0xfee1)
#define PWMB_SMCR (*(unsigned char volatile xdata *)0xfee2)
#define PWMB_ETR (*(unsigned char volatile xdata *)0xfee3)
#define PWMB_IER (*(unsigned char volatile xdata *)0xfee4)
#define PWMB_SR1 (*(unsigned char volatile xdata *)0xfee5)
#define PWMB_SR2 (*(unsigned char volatile xdata *)0xfee6)
#define PWMB_EGR (*(unsigned char volatile xdata *)0xfee7)
#define PWMB_CCMR1 (*(unsigned char volatile xdata *)0xfee8)
#define PWMB_CCMR2 (*(unsigned char volatile xdata *)0xfee9)
#define PWMB_CCMR3 (*(unsigned char volatile xdata *)0xfeea)
#define PWMB_CCMR4 (*(unsigned char volatile xdata *)0xfeeb)
#define PWMB_CCER1 (*(unsigned char volatile xdata *)0xfeec)
#define PWMB_CCER2 (*(unsigned char volatile xdata *)0xfeed)
#define PWMB_CNTR (*(unsigned int volatile xdata *)0xfeee)
#define PWMB_CNTRH (*(unsigned char volatile xdata *)0xfeee)
#define PWMB_CNTRL (*(unsigned char volatile xdata *)0xfeef)
#define PWMB_PSCR (*(unsigned int volatile xdata *)0xfef0)
#define PWMB_PSCRH (*(unsigned char volatile xdata *)0xfef0)
#define PWMB_PSCRL (*(unsigned char volatile xdata *)0xfef1)
#define PWMB_ARR (*(unsigned int volatile xdata *)0xfef2)
#define PWMB_ARRH (*(unsigned char volatile xdata *)0xfef2)
#define PWMB_ARRL (*(unsigned char volatile xdata *)0xfef3)
#define PWMB_RCR (*(unsigned char volatile xdata *)0xfef4)
#define PWMB_CCR5 (*(unsigned int volatile xdata *)0xfef5)
#define PWMB_CCR5H (*(unsigned char volatile xdata *)0xfef5)
#define PWMB_CCR5L (*(unsigned char volatile xdata *)0xfef6)
#define PWMB_CCR6 (*(unsigned int volatile xdata *)0xfef7)
#define PWMB_CCR6H (*(unsigned char volatile xdata *)0xfef7)
#define PWMB_CCR6L (*(unsigned char volatile xdata *)0xfef8)
#define PWMB_CCR7 (*(unsigned int volatile xdata *)0xfef9)
#define PWMB_CCR7H (*(unsigned char volatile xdata *)0xfef9)
#define PWMB_CCR7L (*(unsigned char volatile xdata *)0xfefa)
#define PWMB_CCR8 (*(unsigned int volatile xdata *)0xfefb)
#define PWMB_CCR8H (*(unsigned char volatile xdata *)0xfefb)
#define PWMB_CCR8L (*(unsigned char volatile xdata *)0xfefc)
#define PWMB_BKR (*(unsigned char volatile xdata *)0xfefd)
#define PWMB_DTR (*(unsigned char volatile xdata *)0xfefe)
#define PWMB_OISR (*(unsigned char volatile xdata *)0xfeff)
/////////////////////////////////////////////////
//FD00H-FDFFH
/////////////////////////////////////////////////
#define P0INTE (*(unsigned char volatile xdata *)0xfd00)
#define P1INTE (*(unsigned char volatile xdata *)0xfd01)
#define P2INTE (*(unsigned char volatile xdata *)0xfd02)
#define P3INTE (*(unsigned char volatile xdata *)0xfd03)
#define P4INTE (*(unsigned char volatile xdata *)0xfd04)
#define P5INTE (*(unsigned char volatile xdata *)0xfd05)
#define P6INTE (*(unsigned char volatile xdata *)0xfd06)
#define P7INTE (*(unsigned char volatile xdata *)0xfd07)
#define P0INTF (*(unsigned char volatile xdata *)0xfd10)
#define P1INTF (*(unsigned char volatile xdata *)0xfd11)
#define P2INTF (*(unsigned char volatile xdata *)0xfd12)
#define P3INTF (*(unsigned char volatile xdata *)0xfd13)
#define P4INTF (*(unsigned char volatile xdata *)0xfd14)
#define P5INTF (*(unsigned char volatile xdata *)0xfd15)
#define P6INTF (*(unsigned char volatile xdata *)0xfd16)
#define P7INTF (*(unsigned char volatile xdata *)0xfd17)
#define P0IM0 (*(unsigned char volatile xdata *)0xfd20)
#define P1IM0 (*(unsigned char volatile xdata *)0xfd21)
#define P2IM0 (*(unsigned char volatile xdata *)0xfd22)
#define P3IM0 (*(unsigned char volatile xdata *)0xfd23)
#define P4IM0 (*(unsigned char volatile xdata *)0xfd24)
#define P5IM0 (*(unsigned char volatile xdata *)0xfd25)
#define P6IM0 (*(unsigned char volatile xdata *)0xfd26)
#define P7IM0 (*(unsigned char volatile xdata *)0xfd27)
#define P0IM1 (*(unsigned char volatile xdata *)0xfd30)
#define P1IM1 (*(unsigned char volatile xdata *)0xfd31)
#define P2IM1 (*(unsigned char volatile xdata *)0xfd32)
#define P3IM1 (*(unsigned char volatile xdata *)0xfd33)
#define P4IM1 (*(unsigned char volatile xdata *)0xfd34)
#define P5IM1 (*(unsigned char volatile xdata *)0xfd35)
#define P6IM1 (*(unsigned char volatile xdata *)0xfd36)
#define P7IM1 (*(unsigned char volatile xdata *)0xfd37)
#define P0WKUE (*(unsigned char volatile xdata *)0xfd40)
#define P1WKUE (*(unsigned char volatile xdata *)0xfd41)
#define P2WKUE (*(unsigned char volatile xdata *)0xfd42)
#define P3WKUE (*(unsigned char volatile xdata *)0xfd43)
#define P4WKUE (*(unsigned char volatile xdata *)0xfd44)
#define P5WKUE (*(unsigned char volatile xdata *)0xfd45)
#define P6WKUE (*(unsigned char volatile xdata *)0xfd46)
#define P7WKUE (*(unsigned char volatile xdata *)0xfd47)
#define PIN_IP (*(unsigned char volatile xdata *)0xfd60)
#define PIN_IPH (*(unsigned char volatile xdata *)0xfd61)
/////////////////////////////////////////////////
//FC00H-FCFFH
/////////////////////////////////////////////////
#define MD3 (*(unsigned char volatile xdata *)0xfcf0)
#define MD2 (*(unsigned char volatile xdata *)0xfcf1)
#define MD1 (*(unsigned char volatile xdata *)0xfcf2)
#define MD0 (*(unsigned char volatile xdata *)0xfcf3)
#define MD5 (*(unsigned char volatile xdata *)0xfcf4)
#define MD4 (*(unsigned char volatile xdata *)0xfcf5)
#define ARCON (*(unsigned char volatile xdata *)0xfcf6)
#define OPCON (*(unsigned char volatile xdata *)0xfcf7)
/////////////////////////////////////////////////
//FB00H-FBFFH
/////////////////////////////////////////////////
#define COMEN (*(unsigned char volatile xdata *)0xfb00)
#define SEGENL (*(unsigned char volatile xdata *)0xfb01)
#define SEGENH (*(unsigned char volatile xdata *)0xfb02)
#define LEDCTRL (*(unsigned char volatile xdata *)0xfb03)
#define LEDCKS (*(unsigned char volatile xdata *)0xfb04)
#define COM0_DA_L (*(unsigned char volatile xdata *)0xfb10)
#define COM1_DA_L (*(unsigned char volatile xdata *)0xfb11)
#define COM2_DA_L (*(unsigned char volatile xdata *)0xfb12)
#define COM3_DA_L (*(unsigned char volatile xdata *)0xfb13)
#define COM4_DA_L (*(unsigned char volatile xdata *)0xfb14)
#define COM5_DA_L (*(unsigned char volatile xdata *)0xfb15)
#define COM6_DA_L (*(unsigned char volatile xdata *)0xfb16)
#define COM7_DA_L (*(unsigned char volatile xdata *)0xfb17)
#define COM0_DA_H (*(unsigned char volatile xdata *)0xfb18)
#define COM1_DA_H (*(unsigned char volatile xdata *)0xfb19)
#define COM2_DA_H (*(unsigned char volatile xdata *)0xfb1a)
#define COM3_DA_H (*(unsigned char volatile xdata *)0xfb1b)
#define COM4_DA_H (*(unsigned char volatile xdata *)0xfb1c)
#define COM5_DA_H (*(unsigned char volatile xdata *)0xfb1d)
#define COM6_DA_H (*(unsigned char volatile xdata *)0xfb1e)
#define COM7_DA_H (*(unsigned char volatile xdata *)0xfb1f)
#define COM0_DC_L (*(unsigned char volatile xdata *)0xfb20)
#define COM1_DC_L (*(unsigned char volatile xdata *)0xfb21)
#define COM2_DC_L (*(unsigned char volatile xdata *)0xfb22)
#define COM3_DC_L (*(unsigned char volatile xdata *)0xfb23)
#define COM4_DC_L (*(unsigned char volatile xdata *)0xfb24)
#define COM5_DC_L (*(unsigned char volatile xdata *)0xfb25)
#define COM6_DC_L (*(unsigned char volatile xdata *)0xfb26)
#define COM7_DC_L (*(unsigned char volatile xdata *)0xfb27)
#define COM0_DC_H (*(unsigned char volatile xdata *)0xfb28)
#define COM1_DC_H (*(unsigned char volatile xdata *)0xfb29)
#define COM2_DC_H (*(unsigned char volatile xdata *)0xfb2a)
#define COM3_DC_H (*(unsigned char volatile xdata *)0xfb2b)
#define COM4_DC_H (*(unsigned char volatile xdata *)0xfb2c)
#define COM5_DC_H (*(unsigned char volatile xdata *)0xfb2d)
#define COM6_DC_H (*(unsigned char volatile xdata *)0xfb2e)
#define COM7_DC_H (*(unsigned char volatile xdata *)0xfb2f)
#define TSCHEN1 (*(unsigned char volatile xdata *)0xfb40)
#define TSCHEN2 (*(unsigned char volatile xdata *)0xfb41)
#define TSCFG1 (*(unsigned char volatile xdata *)0xfb42)
#define TSCFG2 (*(unsigned char volatile xdata *)0xfb43)
#define TSWUTC (*(unsigned char volatile xdata *)0xfb44)
#define TSCTRL (*(unsigned char volatile xdata *)0xfb45)
#define TSSTA1 (*(unsigned char volatile xdata *)0xfb46)
#define TSSTA2 (*(unsigned char volatile xdata *)0xfb47)
#define TSRT (*(unsigned char volatile xdata *)0xfb48)
#define TSDAT (*(unsigned int volatile xdata *)0xfb49)
#define TSDATH (*(unsigned char volatile xdata *)0xfb49)
#define TSDATL (*(unsigned char volatile xdata *)0xfb4A)
#define TSTH00 (*(unsigned int volatile xdata *)0xfb50)
#define TSTH00H (*(unsigned char volatile xdata *)0xfb50)
#define TSTH00L (*(unsigned char volatile xdata *)0xfb51)
#define TSTH01 (*(unsigned int volatile xdata *)0xfb52)
#define TSTH01H (*(unsigned char volatile xdata *)0xfb52)
#define TSTH01L (*(unsigned char volatile xdata *)0xfb53)
#define TSTH02 (*(unsigned int volatile xdata *)0xfb54)
#define TSTH02H (*(unsigned char volatile xdata *)0xfb54)
#define TSTH02L (*(unsigned char volatile xdata *)0xfb55)
#define TSTH03 (*(unsigned int volatile xdata *)0xfb56)
#define TSTH03H (*(unsigned char volatile xdata *)0xfb56)
#define TSTH03L (*(unsigned char volatile xdata *)0xfb57)
#define TSTH04 (*(unsigned int volatile xdata *)0xfb58)
#define TSTH04H (*(unsigned char volatile xdata *)0xfb58)
#define TSTH04L (*(unsigned char volatile xdata *)0xfb59)
#define TSTH05 (*(unsigned int volatile xdata *)0xfb5a)
#define TSTH05H (*(unsigned char volatile xdata *)0xfb5a)
#define TSTH05L (*(unsigned char volatile xdata *)0xfb5b)
#define TSTH06 (*(unsigned int volatile xdata *)0xfb5c)
#define TSTH06H (*(unsigned char volatile xdata *)0xfb5c)
#define TSTH06L (*(unsigned char volatile xdata *)0xfb5d)
#define TSTH07 (*(unsigned int volatile xdata *)0xfb5e)
#define TSTH07H (*(unsigned char volatile xdata *)0xfb5e)
#define TSTH07L (*(unsigned char volatile xdata *)0xfb5f)
#define TSTH08 (*(unsigned int volatile xdata *)0xfb60)
#define TSTH08H (*(unsigned char volatile xdata *)0xfb60)
#define TSTH08L (*(unsigned char volatile xdata *)0xfb61)
#define TSTH09 (*(unsigned int volatile xdata *)0xfb62)
#define TSTH09H (*(unsigned char volatile xdata *)0xfb62)
#define TSTH09L (*(unsigned char volatile xdata *)0xfb63)
#define TSTH10 (*(unsigned int volatile xdata *)0xfb64)
#define TSTH10H (*(unsigned char volatile xdata *)0xfb64)
#define TSTH10L (*(unsigned char volatile xdata *)0xfb65)
#define TSTH11 (*(unsigned int volatile xdata *)0xfb66)
#define TSTH11H (*(unsigned char volatile xdata *)0xfb66)
#define TSTH11L (*(unsigned char volatile xdata *)0xfb67)
#define TSTH12 (*(unsigned int volatile xdata *)0xfb68)
#define TSTH12H (*(unsigned char volatile xdata *)0xfb68)
#define TSTH12L (*(unsigned char volatile xdata *)0xfb69)
#define TSTH13 (*(unsigned int volatile xdata *)0xfb6a)
#define TSTH13H (*(unsigned char volatile xdata *)0xfb6a)
#define TSTH13L (*(unsigned char volatile xdata *)0xfb6b)
#define TSTH14 (*(unsigned int volatile xdata *)0xfb6c)
#define TSTH14H (*(unsigned char volatile xdata *)0xfb6c)
#define TSTH14L (*(unsigned char volatile xdata *)0xfb6d)
#define TSTH15 (*(unsigned int volatile xdata *)0xfb6e)
#define TSTH15H (*(unsigned char volatile xdata *)0xfb6e)
#define TSTH15L (*(unsigned char volatile xdata *)0xfb6f)
/////////////////////////////////////////////////
//FA00H-FAFFH
/////////////////////////////////////////////////
/////////////////////////////////////////////////
#endif

6
source/msp/UART0.C

@ -374,7 +374,7 @@ void L0_uart0_sendArray(U8 *buf,U16 len)
/*************************************************
UART
*************************************************/
void INTERRUPT_UART(void) interrupt D_SERVE_UART// using 2
void INTERRUPT_UART(void) D_SERVE_UART// using 2
{
NOP(); NOP(); NOP();
if(L0_uart0_IntRI() /*&& G.e.mcu_enc_id[5] == eep_enc.enc_val[5]*/) //如果是U0接收中断
@ -411,7 +411,7 @@ void INTERRUPT_UART(void) interrupt D_SERVE_UART// using 2
}
#if 1
void timer1_isrHanddle (void) interrupt D_ISR_timer1
void timer1_isrHanddle (void) D_SERVE_TIMER1
{//
TF1 = 0;
//s_nos_tick.uart0_free = 1;
@ -419,7 +419,7 @@ void timer1_isrHanddle (void) interrupt D_ISR_timer1
if(s_uart0_rec.head == 1) //收到一条协议
{
s_uart0_rec.head = 0;
P10 ^= 1;
P17 ^= 1;
if(s_uart0_rec.ok == 0)
{
s_uart0_rec.ok = 1;

2
source/msp/iic_sim.h

@ -25,7 +25,7 @@
///>>>端口位定义,可修改!!!!!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include "../cpu/stc_stc8a8k.h"
//#include "../cpu/stc_stc8a8k.h"
#include "../cpu/c51_macro.h"
#include "../bsp/bsp_config.h"

58
source/msp/msp_eeprom.c

@ -25,8 +25,64 @@
U_F16 uf_ee_add;
//8G8H
void L0_Iap_Idle()
{
IAP_CONTR = 0; //关闭IAP功能
IAP_CMD = 0; //清除命令寄存器
IAP_TRIG = 0; //清除触发寄存器
IAP_ADDRH = 0x80; //将地址设置到非IAP区域
IAP_ADDRL = 0;
}
char L0_Iap_Read(vU16 addr)
{
char dat;
IAP_CONTR = 0x80; //使能IAP
IAP_TPS = 12;
IAP_CMD = 1; //设置IAP读命令
IAP_ADDRL = addr; //设置IAP低地址
IAP_ADDRH = addr >> 8; //设置IAP高地址
IAP_TRIG = 0x5a; //写触发命令(0x5a)
IAP_TRIG = 0xa5; //写触发命令(0xa5)
_nop_();
dat = IAP_DATA; //读IAP数据
L0_Iap_Idle(); //关闭IAP功能
return dat;
}
void L0_Iap_Program(vU16 addr, char dat)
{
IAP_CONTR = 0x80; //使能IAP
IAP_TPS = 12; //设置擦除等待参数 12MHz
IAP_CMD = 2; //设置IAP写命令
IAP_ADDRL = addr; //设置IAP低地址
IAP_ADDRH = addr >> 8; //设置IAP高地址
IAP_DATA = dat; //写IAP数据
IAP_TRIG = 0x5a; //写触发命令(0x5a)
IAP_TRIG = 0xa5; //写触发命令(0xa5)
_nop_();
L0_Iap_Idle(); //关闭IAP功能
}
///每个扇区512字节
///指定地址可以为当前扇区内的任意地址,都会完整擦除当前扇区
void L0_Iap_Erase(vU16 addr)
{
IAP_CONTR = 0x80; //使能IAP
IAP_TPS = 12; //设置擦除等待参数 12MHz
IAP_CMD = 3; //设置IAP擦除命令
IAP_ADDRL = addr; //设置IAP低地址
IAP_ADDRH = addr >> 8; //设置IAP高地址
IAP_TRIG = 0x5a; //写触发命令(0x5a)
IAP_TRIG = 0xa5; //写触发命令(0xa5)
_nop_(); //
L0_Iap_Idle(); //关闭IAP功能
}
#if 0 //8F
void L0_Iap_Idle()
{
IAP_CONTR = 0; //关闭IAP功能
@ -79,7 +135,7 @@ void L0_Iap_Erase(vU16 addr)
_nop_(); //
L0_Iap_Idle(); //关闭IAP功能
}
#endif
void L0_Iap_Program_array(vU16 addr,U8 *buf,U8 len)
{
U8 i = 0;

5
source/msp/msp_eeprom.h

@ -25,9 +25,10 @@
///>>>端口位定义,可修改!!!!!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include "../cpu/stc_stc8a8k.h"
#include "../cpu/c51_macro.h"
//#include "../cpu/stc_stc8a8k.h"
#include "../cpu/stc_macro.h"
#include "../bsp/bsp_config.h"
#include "../cpu/stc_stc8hxx.h"
#include "uart0.h"

2
source/msp/msp_id.c

@ -26,7 +26,7 @@ void L0_id_get(U8 *id)
void L0_id_get_rom(U8 *id)
{
U8 i = 0;
char *ID = (char code *)0x3ff9;
char *ID = (char code *)(D_MCU_SPEC_PARAM_CHIPID);
for(i=0;i<MSP_ID_LEN;i++)
{
id[i] = ID[i];

4
source/msp/msp_id.h

@ -25,11 +25,7 @@
///>>>端口位定义,可修改!!!!!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include "../cpu/stc_stc8a8k.h"
#include "../cpu/c51_macro.h"
#include "../bsp/bsp_config.h"
#include "uart0.h"
extern void L0_id_get(U8 *id);

2
source/msp/time.c

@ -78,7 +78,7 @@ void L0_timer0_Init(void) //25毫秒@11.0592MHz
/********************** Timer0中断函数************************/
/// 和 L0_timer0_Init 关联,需要配置 bsp_config.h中的 D_sys_MainFre
/// 默认10ms 作为TTSS系统的定时引擎
void timer0_isrHanddle (void) interrupt D_ISR_timer0
void timer0_isrHanddle (void) D_SERVE_TIMER0
{//
NOP(); NOP(); NOP();
TF0 = 0;

BIN
sscom5.13.1.exe

Binary file not shown.

383
sscom51.ini

@ -0,0 +1,383 @@
;删除本文件可以恢复默认值。
;这是SSCOM的设置保存文件,您在程序中设置好的串口参数和字符串数据都会自动保存,请最好不要用外部编辑器改动本文件!
;如果文件被修改后程序不能打开,请删除本文件,程序将会自动生成一个新的ini文件.
;靠行首的半角分号是注释符号
;每行都以回车结束
;"="后面的H表示这是个HEX数据串
;"="后面的A表示这是个ASC字符串
;Nx表示第几条定义的字符串(1<x<=N)
N101=0,保留,1000
N1=H,01 03 00 01 00 01
N102=1,净重,50
N2=H,01 03 00 02 00 02
N103=0,皮重,1000
N3=H,01 03 00 04 00 02
N104=0,保留2,1000
N4=H,01 03 00 06 00 01
N105=0,RESET,1000
N5=H,01 06 00 07 00 01
N106=0,AD采样掩码,1000
N6=H,01 03 00 08 00 01
N107=0,从设备ID,1000
N7=H,01 03 00 09 00 01
N108=0,清零,1000
N8=H,01 06 00 0A 00 01
N109=0,量程,1000
N9=H,01 03 00 0B 00 01
N110=0,灵敏度,1000
N10=H,01 03 00 0C 00 01
N111=0,均值滤波点数,1000
N11=H,01 03 00 0D 00 01
N112=0,移位滤波点数,1000
N12=H,01 03 00 0E 00 01
N113=0,和值移位滤波点数1,1000
N13=H,01 03 00 0F 00 01
N114=0,和值移位滤波点数2,1000
N14=H,01 03 00 10 00 01
N115=0,移位阈值1,1000
N15=H,01 03 00 11 00 01
N116=0,移位阈值2,1000
N16=H,01 03 00 12 00 01
N117=0,移位滤波阀值2,1000
N17=H,
N118=0,保留3,1000
N18=A,
N119=0,1路重量(AD),1000
N19=H,
N120=0,2路重量(AD),1000
N20=H,
N121=0,3路重量(AD),1000
N21=H,
N122=0,4路重量(AD),1000
N22=H,
N123=0,1路重量,1000
N23=H,
N124=0,2路重量,1000
N24=H,
N125=0,3路重量,1000
N25=H,
N126=0,4路重量,1000
N26=H,
N127=0,毛重,1000
N27=H,01 03 00 25 00 05
N128=0,写重置,1000
N28=H,01 06 00 07 00 01 F9 CB
N129=0,修改AD采样掩码,1000
N29=H,01 06 00 08 00 07
N130=0,修改从设备ID,1000
N30=H,FF 06 00 09 00 01
N131=0,清零,1000
N31=H,01 10 00 07 00 01 02 00 01
N132=0,修改量程250kg,1000
N32=H,01 10 00 0B 00 01 02 01 F4
N133=0,修改灵敏度,1000
N33=H,01 06 00 0C 00 0E
N134=0,单路移位滤波右移位数,1000
N34=H,01 06 00 0D 00 01 D9 C9
N135=0,和值移位滤波右移位数,1000
N35=H,01 06 00 0E 00 01 29 C9
N136=0,和值移位滤波右移位数,1000
N36=H,01 06 00 0F 00 01 78 09
N137=0,移位比较阈值,1000
N37=H,01 06 00 11 00 01 18 0F
N138=0,移位比较阈值1,1000
N38=H,01 06 00 12 00 01 E8 0F
N139=0,重量显示设定1,1000
N39=H,01 06 00 13 00 14
N140=0,重量显示设定1次数,1000
N40=H,01 06 00 14 00 80
N141=0,重量显示设定2,1000
N41=H,01 06 00 15 00 1A
N142=0,重量显示设定2次数,1000
N42=H,01 06 00 16 00 0C
N143=0,重量显示设定3,1000
N43=H,01 06 00 17 00 64
N144=0,重量显示设定3次数,1000
N44=H,01 06 00 18 00 0D
N145=0,重量显示设定4,1000
N45=H,01 06 00 19 00 35
N146=0,重量显示设定4次数,1000
N46=H,01 06 00 1A 00 EF
N147=0,重量显示设定5,1000
N47=H,01 06 00 1B 00 36
N148=0,重量显示设定5次数,1000
N48=H,01 06 00 1C 00 3C
N149=0,49无注释,1000
N49=H,
N150=0,100Kg系数1标定,1000
N50=H,01 10 00 1D 00 02 04 00 14 00 64
N151=0,Reserved3,1000
N51=H,01 10 00 31 00 02 27 10 00 64 14 9A
N152=0,20Kg系数0.8标定,1000
N52=H,01 10 00 1D 00 02 04 00 14 00 62
N153=0,读标定,1000
N53=H,01 03 00 1D 00 02
N154=0,43无注释,1000
N54=A,
N155=0,40字节,10段标定,1000
N55=H,01 10 00 13 00 14 28 00 14 00 70 00 28 00 78 00 3c 00 64 00 50 00 6e 00 64 00 5A 00 78 00 64 00 8c 00 69 00 A0 00 5A 00 B4 00 6e 00 C8 00 5A
N156=0,读40字节标定,1000
N56=H,01 03 00 16 00 14 A4 01
N157=0,46无注释,1000
N57=A,
N158=0,25KG系数1.0标定,1000
N58=H,01 10 00 1D 00 02 04 00 19 00 66
N159=0,55KG系数1.0标定,1000
N59=H,01 10 00 1F 00 02 04 00 41 00 65
N160=0,105KG系数1.0标定,1000
N60=H,01 10 00 21 00 02 04 00 69 00 67
N161=0,50无注释,1000
N61=H,
N162=0,51无注释,1000
N62=H,
N163=0,52无注释,1000
N63=H,
N164=0,53无注释,1000
N64=H,
N165=0,54无注释,100
N65=H,01 03 00 02 00 02
N166=0,55无注释,100
N66=H,FF 03 00 02 00 02
N167=0,56无注释,1000
N67=H,03 03 00 02 00 02
N168=0,57无注释,1000
N68=H,
N169=0,波特率改为9600,1000
N69=H,01 06 00 31 25 80
N170=0,stopbits,1000
N70=H,01 06 00 32 00 02
N171=0,60无注释,1000
N71=H,01 03 00 31 00 01
N172=0,61无注释,1000
N72=H,01 06 00 31 00 02
N173=0,73无注释,1000
N73=A,
N174=0,74无注释,1000
N74=H,
N175=0,75无注释,1000
N75=H,
N176=0,76无注释,1000
N76=H,
N177=0,77无注释,1000
N77=H,
N178=0,78无注释,1000
N78=A,
N179=0,79无注释,1000
N79=H,
N180=0,80无注释,1000
N80=H,
N181=0,81无注释,1000
N81=A,
N182=0,82无注释,1000
N82=H,
N183=0,83无注释,1000
N83=H,
N184=0,84无注释,1000
N84=H,
N185=0,85无注释,1000
N85=H,
N186=0,86无注释,1000
N86=A,
N187=0,87无注释,1000
N87=H,
N188=0,88无注释,1000
N88=A,
N189=0,89无注释,1000
N89=H,
N190=0,90无注释,1000
N90=H,
N191=0,91无注释,1000
N91=H,
N192=0,92无注释,1000
N92=H,
N193=0,93无注释,1000
N93=A,
N194=0,94无注释,1000
N94=H,
N195=0,95无注释,1000
N95=A,
N196=0,96无注释,1000
N96=H,
N197=0,97无注释,1000
N97=A,
N198=0,98无注释,1000
N98=H,
N199=0,99无注释,1000
N99=H,
;发送文件时每256字节延时时间ms
N1051=,1
;打开文件地址和名称
N1052=,
;主面板ASC字符串
N1053=,01 10 00 1D 00 02 04 00 64 00 64
;主面板HEX数据串
N1054=,11 06 00 07 00 01
;主面板发送方式(ASC or HEX)
N1055=,H
;主面板字符串发送间隔时间ms
N1056=,20
;主面板字符串发送新行
N1057=,Y
;多条字符串发送间隔时间ms
N1058=,50
;接收窗口是否HEX显示方式
N1059=,Y
;校验方式,0=None,1=modbusCRC16,2=ADD,3=XOR
N1060=,1
;保存DTR:
N1061=,Y
;保存RTS:
N1062=,N
;程序启动时是否打开串口
N1063=,N
;是否分包显示
N1064=,Y
;分包超时时间ms
N1065=,20
;接收窗背景颜色
N1066=,16777215
;显示缓冲上限,200K,500K,1M,2M,5M,10M,20M
N1067=,1000000
;远程IP地址
N1068=,test.tall.wiki
;远程端口
N1069=,49000
;本地端口
N1070=,9000
;选择回车后发送行(带回显)
N1071=,N
;选择按键立即发送键值
N1072=,Y
;选择回显
N1073=,N
;第几字节至末尾加校验
N1074=,1
;至末尾倒数第几字节加校验,存第几个项目
N1075=,0
;终端仿真输入回车后是否自动加换行
N1076=,N
;当前串口号Port=COMX,网络模式):1=TCPCLIENT,2=TCPSERVER,3=UDP
N1080=,COM4
;波特率Band rate
N1081=,115200
;保存窗口宽度
N1082=,922
;保存窗口高度
N1083=,840
;保存窗口left
N1084=,631
;保存窗口top
N1085=,17
;分割线位置(右侧装多条自定义字符串的容器宽度)
N1086=,409
;多条发送按钮的宽度
N1087=,160
;保存窗口字体名称
N1088=,宋体
;保存窗口字体大小
N1089=,9
;保存窗口字体颜色
N1090=,0
;C:Chinese汉语,E:English
N1100=,汉语
;end
Loading…
Cancel
Save