⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spt6608.inc

📁 SPT6608平台软件
💻 INC
📖 第 1 页 / 共 2 页
字号:
//============================================================================*/
//                         Register address definitions                       */
//============================================================================*/
//-------------------------------------*/
//         Port A, B, C, D, E, F       */
//-------------------------------------*/
.CONST  P_IOA_Data      =0x7000;        //R/W, portA data
        // IOA0~IOA7 can be set as input or output pin by pin.
        // Input mode  - IOA0~IOA7 provide pull-high resistosrs
        //               IOA6 & IOA7 provide pull-low resistors
        // Output mode - CMOS output
        // Wake-up     - IOA0~IOA7 all provide wake-up function

.CONST  P_IOA_Buf       =0x7001;        //R, port A output latch
.CONST  P_IOA_Dir       =0x7002;        //R/W, portA direction, 0/1 = I/O
.CONST  P_IOA_PullR     =0x7003;        //R/W, portA pull-highs & pull-lows
                        // b15~b8 = 1 to enable pull-high of IOA7~IOA0
                        // b7~b6 = 1 to enable pull-low of IOA7~IOA6
.CONST  P_IOA_Latch     =0x7004;        //R, latch IO for wakeup

//---------------------------------
.CONST  P_IOB_Data      =0x7005;        //R/W, portB data
        // IOB0~IOB7 can be set as input or output pin by pin.
        // Input mode  - CMOS input (without pulled reisitors)
        // Output mode - IOB0~IOB5 are CMOS outputs
        //               IOB6 & IOB7 are NMOS open-drain
        // Wake-up     - no wake-up function
        
        
.CONST  P_IOB_Buf       =0x7006;        //R, portB output latch
.CONST  P_IOB_Dir       =0x7007;        //R/W, portB direction, 0/1 = I/O

//---------------------------------
.CONST  P_IOC_Data      =0x7008;        //R/W, portC data
        // IOC0~IOC7 can be set as input or output pin by pin.
        // Input mode  - CMOS input (without pulled reisitors)
        // Output mode - IOC0~IOC4 are CMOS outputs
        //               IOC5 & IOC7 are NMOS open-drain
        // Wake-up     - IOC0 & IOC1 provide wake-up function
.CONST  P_IOC_Buf       =0x7009;        //R, portC output latch
.CONST  P_IOC_Dir       =0x700A;        //R/W, portC direction

//---------------------------------
.CONST  P_IOD_Data      =0x700B;        //R/W, portD data
        // IOD0~7 can be set as input or output pin by pin.
        // Input mode  - CMOS input (without pulled reisitors)
        // Output mode - IOD0~IOD7 are CMOS outputs
        // Wake-up     - no wake-up function

.CONST  P_IOD_Buf       =0x700C;        //R, portD output latch
.CONST  P_IOD_Dir       =0x700D;        //R/W, portD direction, 0/1 = I/O


//---------------------------------
.CONST  P_IOE_Data      =0x7050;        //R/W, portA data
        // IOE0~IOE7 can be set as input or output pin by pin.
        // Input mode  - IOE0~IOE7 provide pull-high resistosrs
        //               IOE6 & IOE7 provide pull-low resistors
        // Output mode - CMOS output
        // Wake-up     - IOE0~IOE7 all provide wake-up function

.CONST  P_IOE_Buf       =0x7051;        //R, port E output latch
.CONST  P_IOE_Dir       =0x7052;        //R/W, portE direction, 0/1 = I/O
.CONST  P_IOE_PullR     =0x7053;        //R/W, portE pull-highs & pull-lows
                        // b15~b8 = 1 to enable pull-high of IOE7~IOE0
                        // b7~b6 = 1 to enable pull-low of IOE7~IOE6
.CONST  P_IOE_Latch     =0x7054;        //R, latch IO for wakeup
//---------------------------------

.CONST  P_IOCD_Ctrl     =0x700E;
//   		b0~b1, 00 - C0 provide interrupt/wake-up at falling edge
//	       	       01 - C0 provide interrupt/wake-up at rising edge
//                     1x - C0 provide interrupt/wake-up at both edges
//          b3~b2, 00 - C1 provide interrupt/wake-up at falling edge
//                 01 - C1 provide interrupt/wake-up at rising edge
//                 1x - C1 provide interrupt/wake-up at both edgex
//          b4,    0 - tone output (IOD1) comes from timer A overflow
//                 1 - tone output (IOD1) comes from timer B overflow
//          b5,    0 - IOD1 is normal I/O
//                 1 - IOD1 is tone-output



//-------------------------------*/
//      Interrupt & Wake-Up      */
//-------------------------------*/
.CONST  P_Int           =0x7010; // write 0/1 - disable/enable interrupt
                                 // read  0/1 - interrupt is disabled/enabled
.CONST  P_IntClr        =0x7011; // write 1 - clear happened interrupt flag
                                 // read  1 - interrupt is happened
.CONST  P_WakeUp        =0x7012; // write 0/1 - disable/enable wake-up
                                 // read  0/1 - wake-up is disabled/enabled
.CONST  P_WakeUpClr     =0x7013; // write 1 - clear happened wake-up flag
                                 // read  1 - wake-up is happened


.CONST  B_Irq0          =0x0001;        // vector = FFF8
.CONST  B_RiInt         =0x0001;

.CONST  B_Irq1          =0x0002;        // vector = FFF9
.CONST  B_IoaInt        =0x0002;

.CONST  B_Irq2          =0x0004;        // vector = FFFA
.CONST  B_TmrAInt       =0x0004;
.CONST  B_Irq3          =0x0008;        // vector = FFFB
.CONST  B_TmrBInt       =0x0008;
.CONST  B_Irq4          =0x0010;        // vector = FFFC
.CONST  B_T32KHzInt     =0x0010;
.CONST  B_8KHzInt       =0x0010;
.CONST  B_Irq5          =0x0020;        // vector = FFFD
.CONST  B_T2KHzInt      =0x0020;
.CONST  B_1KHzInt       =0x0020;
.CONST  B_512HzInt      =0x0020;
.CONST  B_Irq6          =0x0040;        // vector = FFFE
.CONST  B_T128HzInt     =0x0040;
.CONST  B_T8HzInt       =0x0080;	// vector = FFFF
.CONST  B_2HzInt        =0x0080;
.CONST  B_Ioc0Int       =0x0100;	// vector = FFF8
.CONST  B_Ioc1Int       =0x0200;	// vector = FFF6
.CONST  B_LineInt       =0x0400;	// vector = FFF8
.CONST  B_UARTInt	=0x0800;	// vector = FFF6
.CONST  B_IrDAInt	=0x0800;	// vector = FFF6
//-------------------------------*/
.CONST  P_IoaWakeUp     =0x7014; // R/W, b7~b0=1 to enable IOA7~0 wake-up
.CONST  P_IoeWakeUp     =0x7055; // R/W, b7~b0=1 to enable IOE7~0 wake-up

//-------------------------------*/
//        System Clock           */
//-------------------------------*/
.CONST  P_SystemClock   =0x7015;
//	b2~b0:  CPU Operating Clock Select
//              000 - Fosc
//              001 - Fosc/2
// 	       	 	010 - Fosc/4
//     			011 - Fosc/8  (default)
//              100 - Fosc/8
//              101 - Fosc/8
//              110 - Fosc/8
//              111 - Stop/Sleep
//	   b7:		0 - Fosc=  Low-Speed Mode
//	        	1 - Fosc=  High-Speed Mode
.CONST   B_FoscDivBy1      =0x0000;
.CONST   B_FoscDivBy2      =0x0001;
.CONST   B_FoscDivBy4      =0x0002;
.CONST   B_FoscDivBy8      =0x0003;
.CONST   B_Sleep           =0x0007;
.CONST   B_NormalCpuClock  =B_FoscDivBy4;
.CONST   B_28M             =0x0080;

.CONST  P_Watchdog_Clr  =0x7016; // period = 2sec
                                 // write 16-bit (0x55AA) value to reset watch dog

//-------------------------------*/
//          Time Base            */
//-------------------------------*/
.CONST  P_TimeBaseSet   =0x7018;
//            b15: enable 32768
//            b14: weak/strong mode
//	      b7~b6: T32KHzS
//      	     00 - 4KHz     
//          	     01 - 8KHz    
//         	     10 - 16KHz   
//           	     11 - 32KHz 
//	      b5~b4: T2KHz 			
//  	    	     00 - 256Hz              
//          	     01 - 512Hz              
//      	     10 - 1KHz               
//      	     11 - 2KHz               
//	      b3~b2: T128HzS
//		     00 - 16Hz
//		     01 - 32Hz
//		     10 - 64Hz
//		     11 - 128Hz
//	      b1~b0: T8HzS	
//        	     00 - 1Hz
//		     01 - 2Hz
//		     10 - 4Hz
//         	     11 - 8Hz
// Time Base, generated by 32768Hz, is a combination of frequency selection
// for timers and interrupt.

.CONST  B_Enable32768   =0x8000;
.CONST  B_Strong32768   =0x4000; // After powering on, set 32768 at strong mode
.CONST  B_1Hz           =0x0000;
.CONST  B_2Hz           =0x0001;
.CONST  B_4Hz           =0x0002;
.CONST  B_8Hz           =0x0003;
.CONST  B_16Hz          =0x0000;
.CONST  B_32Hz          =0x0004;
.CONST  B_64Hz          =0x0008;
.CONST  B_128Hz         =0x000C;
.CONST  B_256Hz         =0x0000;
.CONST  B_512Hz         =0x0010;
.CONST  B_1KHz          =0x0020;
.CONST  B_2KHz          =0x0030;
.CONST  B_4KHz          =0x0000;
.CONST  B_8KHz          =0x0040;
.CONST  B_16KHz         =0x0080;
.CONST  B_32KHz         =0x00C0;

//-------------------------------*/
//          Timer A & B          */
//-------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -