Решил вынести файл описания регистров отдельно, так как время от времени всплывают неточности или банальные опечатки.
НЕ РЕКОМЕНДУЕТСЯ! См. ниже! STC_8H.DAT (обновление 5 мая 2024)
[BIT] ACC = E0 B = F0 PSW = D0 P0 = 80 P1 = 90 P2 = A0 P3 = B0 P4 = c0 P5 = c8 P6 = e8 P7 = f8 SCON = 98 T2CON = C8 IE = A8 IP = B8 TCON = 88 [BYTE] SP = 81 DPL = 82 DPH = 83 TH0 = 8C TH1 = 8D TL0 = 8A TL1 = 8B PCON = 87 TMOD = 89 SBUF = 99 T2MOD = C9 TL2 = CC TH2 = CD RCAP2L = CA RCAP2H = CB AUXR = 8E SADDR = A9 IPH = B7 SADEN = B9 P_SW1 = a2 P_SW2 = ba T2H = d6 T2L = d7 S1CON = 9A ' UARTs control register S1BUF = 9B S2CON = 9A ' UARTs control register S2BUF = 9B S3CON = AC S3BUF = AD S4CON = 84 S4BUF = 85 ' ISP_IAP_EEPROM Register IAP_DATA = c2 ' IAP Flash Data Register IAP_ADDRH = c3 ' IAP Flash Address High Byte IAP_ADDRL = c4 ' IAP Flash Address Low Byte IAP_CMD = c5 ' IAP Flash Command Register IAP_TRIG = c6 ' IAP Flash Trigger register IAP_CONTR = c7 ' IAP Control Register IAP_TPS = F5 ' IAP Waiting Time Control Register WDT_CONTR = C1 ' Watchdog Timer Register RSTCFG = FF ' Reset Configuration Register WKTCL = AA ' Power-down wake-up timer count register WKTCH = AB' WKTEN = 7 P0M1 = 93 ' mode register 1 P0M0 = 94 ' mode register 0 P1M1 = 91' PnM1.x PnM0.x Pn.x mode P1M0 = 92' 0 0 Quasi bidirectional mode P2M1 = 95' 0 1 Push-pull output mode P2M0 = 96' 1 0 High-impedance input mode P3M1 = b1' 1 1 Open drain mode P3M0 = b2 P4M1 = b3 P4M0 = b4 P5M1 = c9 P5M0 = ca P6M1 = cb P6M0 = cc P7M1 = e1 P7M0 = e2 ADC_CONTR = BC ' control register ADC_RES = BD ' Result High Byte ADC_RESL= BE ' Result Low Byte ADCCFG = DE ' Configuration Register ' ADC Register 'ADC_POWER = 7 'ADC_START = 6 'ADC_FLAG = 5 'ADC_EPWMT = 4 'ADC_CHS = 3210 ' ADC channel selection bits ' SPI Register SPSTAT = cd SPCTL = ce SPDAT = cf CCON = D8 ' PCA CMOD = D9 CCAPM0 = DA CCAPM1 = DB CCAPM2 = DC CCAPM3 = DD CCAPM4 = DE CCAPM5 = DF CL = E9 CCAP0L = EA CCAP1L = EB CCAP2L = EC CCAP3L = ED CCAP4L = EE CCAP5L = EF CH = F9 CCAP0H = FA CCAP1H = FB CCAP2H = FC CCAP3H = FD CCAP4H = FE CCAP5H = FF PCA_PWM0 = F2 PCA_PWM1 = F3 PCA_PWM2 = F4 PCA_PWM3 = F5 PCA_PWM4 = F6 PCA_PWM5 = F7 [SBIT] TF1 = 8f TR1 = 8e TF0 = 8d TR0 = 8c IE1 = 8b IT1 = 8a IE0 = 89 IT0 = 88 EA = AF ' IE EPCA_LVD = AE EADC_SPI = AD ES = AC ET1 = AB EX1 = AA ET0 = A9 EX0 = A8 PPCA_LVD = BE ' IP PADC_SPI = BD PS = BC PT1 = BB PX1 = BA PT0 = B9 PX0 = B8 CY = d7 ' PSW AC = d6 F0 = d5 RS1 = d4 RS0 = d3 OV = d2 F1 = d1 P = d0 RD = b7 ' P3 WR = b6 T1 = b5 T0 = b4 INT1 = b3 INT0 = b2 TXD = b1 RXD = b0 SM0 = 9f ' SCON SM1 = 9e SM2 = 9d REN = 9c TB8 = 9b RB8 = 9a TI = 99 RI = 98 TF2 = cf ' T2CON EXF2 = ce RCLK = cd TCLK = cc EXEN2 =cb TR2 = ca C_T2 = c9 CP_RL2= c8 [XBYTE] P0PU = FE10 ' Pull-up resistor control register P1PU = FE11' Internal 4.1K pull-up resistor control bit P2PU = FE12' 0: Disable 4.1K pull-up resistor inside the port P3PU = FE13' 1: Enable 4.1K pull-up resistor inside the port P4PU = FE14 P5PU = FE15 P6PU = FE16 P7PU = FE17 P0NCS = FE18 ' Schmitt trigger control register P1NCS = FE19' Schmitt trigger control bit: P2NCS = FE1a '0: Enable schmitt trigger function on the port. (Schmitt trigger is enabled by default after power-on reset.) P3NCS = FE1b' 1: Disable schmitt trigger function on the port. P4NCS = FE1c P5NCS = FE1d P6NCS = FE1e P7NCS = FE1f P0SR = FE20 ' Level Shift Rate Register P1SR = FE21 P2SR = FE22' Level shifting speed control bits: P3SR = FE23' 0: Fast level shifting, and the corresponding up and down impact will be relatively large. P4SR = FE24' 1: Slow level shifting, and the corresponding up and down impact will be relatively small. P5SR = FE25 P6SR = FE26 P7SR = FE27 P0IE = FE30 ' Input Enable Control Register P1IE = FE31 P2IE = FE32 P3IE = FE33 P4IE = FE34 P5IE = FE35 ' Digital signal input enable control: P6IE = FE36 ' 0: Disable digital signal input. P7IE = FE37 ' 1: Enable digital signal input. If the I/O is used as a digital port, it must be set to 1 CKSEL = FE00 ' Clock selection register CLKDIV = FE01 ' Clock Division Register IRCCR = FE02 ' Internal Oscillator control register XOSCCR = FE03 ' External Oscillator control register IRC32KCR = FE04 ' Internal 32KHz Oscillator control register MCLKOCR = FE05 ' Main clock output control register X32KCR = FE08 ' External 32KHz Oscillator control register P0DR = FE28 ' Drive Current Control Register P1DR = FE29' 0: Enhanced drive ability P2DR = FE2a' 1: General drive ability P3DR = FE2b P4DR = FE2c P5DR = FE2d P6DR = FE2e P7DR = FE2f ADCTIM = FEA8 ' Timing Control Register [MISC] up = STC8H IRAM = 128 clockdiv=1 I_lvd = &H33 I_uart2 = &H43 I_spi = &H4B I_int2 = &H53 I_int3 = &H5B I_tmr2 = &H63 I_user = &H6B I_int4 = &H83 I_uart3 = &H8B I_uart4 = &H93 I_tmr3 = &H9B I_tmr4 = &HA3 I_cmp = &HAB I_i2c = &HC3 I_usb = &HCB I_pwma = &HD3 I_pwmb = &HDB 'I_int = &H03 'I_tmr = &H0B 'I_int1 = &H13 'I_tmr1 = &H1B 'I_uart1 = &H23 'I_adc = &H2B 'I_tksu = &H011B 'I_rtc = &H0123 'I_p0int = &H012B 'I_p1int = &H0133 'I_p2int = &H013B 'I_p3int = &H0143 'I_p4int = &H014B 'I_p5int = &H0153 'I_p6int = &H015B 'I_p7int = &H0163 'I_dma_m2m = &H017B 'I_dma_adc = &H0183 'I_dma_spi = &H018B 'I_dma_ur1t = &H0193 'I_dma_ur1r = &H019B 'I_dma_ur2t = &H01A3 'I_dma_ur2r = &H01AB 'I_dma_ur3t = &H01B3 'I_dma_ur3r = &H01BB 'I_dma_ur4t = &H01C3 'I_dma_ur4r = &H01CB 'I_dma_lcm = &H01D3 'I_lcm = &H01DB 'S2SM0 = 7 ' UART2 control register S2CON = 9A 'S2SM2 = 5 'S2REN = 4 'S2TB8 = 3 'S2RB8 = 2 'S2TI = 1 'S2RI = 0 'S3SM0 = 7 ' UART3 control register S3CON = AC 'S3ST3 = 6 'S3SM2 = 5 'S3REN = 4 'S3TB8 = 3 'S3RB8 = 2 'S3TI = 1 'S3RI = 0 'S4SM0 = 7 ' UART4 control register S4CON = 84 'S4ST3 = 6 'S4SM2 = 5 'S4REN = 4 'S4TB8 = 3 'S4RB8 = 2 'S4TI = 1 'S4RI = 0 'PCON = 87 'SMOD = 7 'SMOD0 = 6 'LVDF = 5 'POF = 4 'GF1 = 3 'GF0 = 2 'PD = 1 'IDL = 0 ' 05-05-2024