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

📄 3100_2interface.lst

📁 3100 Tenx MCU Firmware
💻 LST
📖 第 1 页 / 共 5 页
字号:
  629 00629 0037 3039  		goto	EndInt
0630   
00631              ;==============================================================================
00632              ;Function:Pb0iTask
00633              ;  1.Keyboard wake up only by Pb0 io port.
00634              ;==============================================================================
0635   
00636              Pb0iTask:
  637 00637 0038 1052  		bcf 12h,1 	
0638   
00639              ;==============================================================================
00640              ;Function:EndInt
00641              ;  Recover regisiter Status.
00642              ;==============================================================================
0643   
00644              EndInt:
  645 00645 0039 0821  		movfw	StateTemp1
  646 00646 003A 0083  		movwf	Psw
  647 00647 003B 0820  		movfw	StateTemp0
0648   
  649 00649 003C 0060  		reti
0650   
00651              ;==================================================================================================
  652 0100 **** NEW ADDR ****  		org	0100h	;
00653              ;==================================================================================================
0654   
00655              Start:
  656 00656 0100 2109  		call	SystemReset
0657   
00658                UsbStart:
  659 00659 0101 2142  		call	Ep0IntCheck
0660   
  661 00661 0102 150E  		btfsc 0eh,4 	
  662 00662 0103 2147  		call	SuspendTask
0663   
  664 00664 0104 160E  		btfss 0eh,0 	
  665 00665 0105 3101  		goto	UsbStart
0666   
  667 00667 0106 23F8  		call	DataInTask
0668   
  669 00669 0107 2423  		call	ReportTask
0670   
  671 00671 0108 3101  		goto	UsbStart
0672   
00673              ;==============================================================================
00674              ;Function:SystemReset
00675              ;  1.Disable all Interrupts Flag
00676              ;  2.Clear all ram buffers in MCU
00677              ;  3.Turn off leds
00678              ;==============================================================================
0679   
00680              SystemReset:
  681 00681 0109 018E  		clrf	Gpr0
  682 00682 010A 018F  		clrf	Gpr1
  683 00683 010B 0190  		clrf	UsbFun
  684 00684 010C 0191  		clrf	Int0
  685 00685 010D 0192  		clrf	Int1
  686 00686 010E 0193  		clrf	Int2
  687 00687 010F 0193  		clrf	UsbCtr
  688 00688 0110 0195  		clrf	Tx0Reg
  689 00689 0111 0196  		clrf	Tx1Reg
  690 00690 0112 0197  		clrf	Tx2Reg
0691   
  692 00692 0113 1900  		movlw	00h
  693 00693 0114 0001  		movwr	Tm0Reload
  694 00694 0115 0002  		movwr	Tm0Pscl
  695 00695 0116 0011  		movwr	IntEn0
  696 00696 0117 0012  		movwr	IntEn1
0697   
  698 00698 0118 1303  		bsf 03h,4
00699                ClearRam0:
  700 00700 0119 1920  		movlw	20h
  701 00701 011A 0084  		movwf	Fsr
00702                  ClearLoop0:
  703 00703 011B 1900  		movlw	00h
  704 00704 011C 0080  		movwf	Indf
  705 00705 011D 0A84  		incf	Fsr,F
  706 00706 011E 1980  		movlw	80h
  707 00707 011F 0204  		subwf	Fsr,W
  708 00708 0120 1683  		btfss 03h,2
  709 00709 0121 311B  		goto	ClearLoop0
0710   
  711 00711 0122 1103  		bcf 03h,4
00712                ClearRam1:
  713 00713 0123 1920  		movlw	20h
  714 00714 0124 0084  		movwf	Fsr
00715                  ClearLoop1:
  716 00716 0125 1900  		movlw	00h
  717 00717 0126 0080  		movwf	Indf
  718 00718 0127 0A84  		incf	Fsr,F
  719 00719 0128 1980  		movlw	80h
  720 00720 0129 0204  		subwf	Fsr,W
  721 00721 012A 1683  		btfss 03h,2
  722 00722 012B 3125  		goto	ClearLoop1
0723   
00724                Usb:
  725 00725 012C 13D0    		bsf 10h,7
  726 00726 012D 19CC  		movlw	cch
  727 00727 012E 0011  		movwr	IntEn0
0728   
  729 00729 012F 0040  		ret
0730   
00731              ;==============================================================================
00732              ;Function:UsbReset
00733              ;  1.Enable USBEn flag
00734              ;  2.Enable Rc0int,Tx0int,Rstint,Suspint,Timer0int flags
00735              ;  3.Enable Tx1,Tx2 toggle
00736              ;  4.Enable Timer0
00737              ;==============================================================================
0738   
00739              UsbReset:
0740   
  741 00741 0130 018E  		clrf	Gpr0
  742 00742 0131 018F  		clrf	Gpr1
  743 00743 0132 0190  		clrf	UsbFun
  744 00744 0133 0191  		clrf	Int0
  745 00745 0134 0192  		clrf	Int1
  746 00746 0135 0193  		clrf	Int2
  747 00747 0136 0193  		clrf	UsbCtr
  748 00748 0137 0195  		clrf	Tx0Reg
  749 00749 0138 0196  		clrf	Tx1Reg
  750 00750 0139 0197  		clrf	Tx2Reg
0751   
  752 00752 013A 13D0  		bsf 10h,7
0753   
  754 00754 013B 19CC  		movlw	cch
  755 00755 013C 0011  		movwr	IntEn0
  756 00756 013D 1900  		movlw	00h
  757 00757 013E 0012  		movwr	IntEn1
0758   
  759 00759 013F 1907  		movlw	07h
  760 00760 0140 0002  		movwr	Tm0Pscl
0761   
  762 00762 0141 0040  		ret
0763   
00764              ;==============================================================================
00765              ;Function:Ep0IntCheck
00766              ;  1.Check two kinds of interrupts:Tx0i and Rc0i
00767              ;==============================================================================
0768   
00769              Ep0IntCheck:
  770 00770 0142 14CE                  btfsc 0eh,3 	
  771 00771 0143 31E8        		goto	Rc0Task
0772   
  773 00773 0144 148E  		btfsc 0eh,2 	
  774 00774 0145 31D5  		goto	Tx0Task
  775 00775 0146 0040  		ret
0776   
00777              ;==============================================================================
00778              ;Function:SuspendTask
00779              ;  1.Check two kinds of interrupts:Tx0i and Rc0i
00780              ;==============================================================================
0781   
00782              SuspendTask:
  783 00783 0147 1900  		movlw	00h
  784 00784 0148 0011  		movwr	IntEn0		;Disable all interrupts
  785 00785 0149 1908  		movlw	08h
  786 00786 014A 0012  		movwr	IntEn1		;Only Enable Rsmie
0787   
  788 00788 014B 13D3  		bsf 13h,7 	
0789   
  790 00790 014C 0000  		nop
  791 00791 014D 0000  		nop
  792 00792 014E 0000  		nop
0793   
00794              ;		movlw	00h
00795              ;		movwr	PwrDown		;Save the power consumption of MCU
  796 00796 014F 0003  		sleep
0797   
  798 00798 0150 0000  		nop
0799   
  800 00800 0151 0040  		ret
0801   
00802              ;==============================================================================
00803              ;Function:CheckLength
00804              ;  1.Check how many data want to send
00805              ;==============================================================================
0806   
00807              CheckLength:
  808 00808 0152 0826  		movfw	DataLength
  809 00809 0153 00A3  		movwf	WLengthTemp
  810 00810 0154 089F  		testz	WLengthHi
  811 00811 0155 1683  		btfss 03h,2
  812 00812 0156 0040  		ret
0813   
00814                CheckLenTask:
  815 00815 0157 1003    		bcf 03h,0
  816 00816 0158 0826    		movfw	DataLength
  817 00817 0159 021E    		subwf	WLength,W
  818 00818 015A 1403    		btfsc 03h,0
  819 00819 015B 0040    		ret
0820   
  821 00821 015C 081E    		movfw	WLength
  822 00822 015D 00A3    		movwf	WLengthTemp
  823 00823 015E 0040    		ret
0824   
00825              ;==============================================================================
00826              ;Function:Tx0Transfer
00827              ;  1.Transfer data to host
00828              ;==============================================================================
0829   
00830              Tx0Transfer:
  831 00831 015F 01A4  		clrf	LengthCnt
  832 00832 0160 08A3  		testz	WLengthTemp
  833 00833 0161 1483  		btfsc 03h,2
  834 00834 0162 31C8  		goto	SetTgl
0835   
  836 00836 0163 0825  		movfw	TableCnt
  837 00837 0164 2E00  		call	DeviceInfoTable
  838 00838 0165 178E  		btfss 0eh,6 	
  839 00839 0166 3169  		goto	Sendbyte0
  840 00840 0167 0825  		movfw	TableCnt
  841 00841 0168 2F00  		call	DeviceReportTable
00842                Sendbyte0:
  843 00843 0169 0018  		movwr	Tx0Fifo0
  844 00844 016A 0AA5  		incf	TableCnt,F
  845 00845 016B 0AA4  		incf	LengthCnt,F
  846 00846 016C 03A3  		decf	WLengthTemp,F
  847 00847 016D 08A3  		testz	WLengthTemp
  848 00848 016E 1483  		btfsc 03h,2
  849 00849 016F 31C8  		goto	SetTgl
0850   
  851 00851 0170 0825  		movfw	TableCnt
  852 00852 0171 2E00  		call	DeviceInfoTable
  853 00853 0172 178E  		btfss 0eh,6 	
  854 00854 0173 3176  		goto	Sendbyte1
  855 00855 0174 0825  		movfw	TableCnt
  856 00856 0175 2F00  		call	DeviceReportTable
00857                Sendbyte1:
  858 00858 0176 0019  		movwr	Tx0Fifo1
  859 00859 0177 0AA5  		incf	TableCnt,F
  860 00860 0178 0AA4  		incf	LengthCnt,F
  861 00861 0179 03A3  		decf	WLengthTemp,F
  862 00862 017A 08A3  		testz	WLengthTemp
  863 00863 017B 1483  		btfsc 03h,2
  864 00864 017C 31C8  		goto	SetTgl
0865   
  866 00866 017D 0825  		movfw	TableCnt
  867 00867 017E 2E00  		call	DeviceInfoTable
  868 00868 017F 178E  		btfss 0eh,6 	
  869 00869 0180 3183  		goto	Sendbyte2
  870 00870 0181 0825  		movfw	TableCnt
  871 00871 0182 2F00  		call	DeviceReportTable
00872                Sendbyte2:
  873 00873 0183 001A  		movwr	Tx0Fifo2
  874 00874 0184 0AA5  		incf	TableCnt,F
  875 00875 0185 0AA4  		incf	LengthCnt,F
  876 00876 0186 03A3  		decf	WLengthTemp,F
  877 00877 0187 08A3  		testz	WLengthTemp
  878 00878 0188 1483  		btfsc 03h,2
  879 00879 0189 31C8  		goto	SetTgl
0880   
  881 00881 018A 0825  		movfw	TableCnt
  882 00882 018B 2E00  		call	DeviceInfoTable
  883 00883 018C 178E  		btfss 0eh,6 	
  884 00884 018D 3190  		goto	Sendbyte3
  885 00885 018E 0825  		movfw	TableCnt
  886 00886 018F 2F00  		call	DeviceReportTable
00887                Sendbyte3:
  888 00888 0190 001B  		movwr	Tx0Fifo3
  889 00889 0191 0AA5  		incf	TableCnt,F
  890 00890 0192 0AA4  		incf	LengthCnt,F
  891 00891 0193 03A3  		decf	WLengthTemp,F
  892 00892 0194 08A3  		testz	WLengthTemp
  893 00893 0195 1483  		btfsc 03h,2
  894 00894 0196 31C8  		goto	SetTgl
0895   
  896 00896 0197 0825  		movfw	TableCnt
  897 00897 0198 2E00  		call	DeviceInfoTable
  898 00898 0199 178E  		btfss 0eh,6 	
  899 00899 019A 319D  		goto	Sendbyte4
  900 00900 019B 0825  		movfw	TableCnt
  901 00901 019C 2F00  		call	DeviceReportTable
00902                Sendbyte4:
  903 00903 019D 001C  		movwr	Tx0Fifo4
  904 00904 019E 0AA5  		incf	TableCnt,F
  905 00905 019F 0AA4  		incf	LengthCnt,F
  906 00906 01A0 03A3  		decf	WLengthTemp,F
  907 00907 01A1 08A3  		testz	WLengthTemp
  908 00908 01A2 1483  		btfsc 03h,2
  909 00909 01A3 31C8  		goto	SetTgl
0910   
  911 00911 01A4 0825  		movfw	TableCnt
  912 00912 01A5 2E00  		call	DeviceInfoTable
  913 00913 01A6 178E  		btfss 0eh,6 	
  914 00914 01A7 31AA  		goto	Sendbyte5
  915 00915 01A8 0825  		movfw	TableCnt
  916 00916 01A9 2F00  		call	DeviceReportTable
00917                Sendbyte5:
  918 00918 01AA 001D  		movwr	Tx0Fifo5
  919 00919 01AB 0AA5  		incf	TableCnt,F
  920 00920 01AC 0AA4  		incf	LengthCnt,F
  921 00921 01AD 03A3  		decf	WLengthTemp,F
  922 00922 01AE 08A3  		testz	WLengthTemp
  923 00923 01AF 1483  		btfsc 03h,2
  924 00924 01B0 31C8  		goto	SetTgl
0925   
  926 00926 01B1 0825  		movfw	TableCnt
  927 00927 01B2 2E00  		call	DeviceInfoTable
  928 00928 01B3 178E  		btfss 0eh,6 	
  929 00929 01B4 31B7  		goto	Sendbyte6
  930 00930 01B5 0825  		movfw	TableCnt
  931 00931 01B6 2F00  		call	DeviceReportTable
00932                Sendbyte6:
  933 00933 01B7 001E  		movwr	Tx0Fifo6
  934 00934 01B8 0AA5  		incf	TableCnt,F
  935 00935 01B9 0AA4  		incf	LengthCnt,F
  936 00936 01BA 03A3  		decf	WLengthTemp,F
  937 00937 01BB 08A3  		testz	WLengthTemp
  938 00938 01BC 1483  		btfsc 03h,2
  939 00939 01BD 31C8  		goto	SetTgl
0940   
  941 00941 01BE 0825  		movfw	TableCnt
  942 00942 01BF 2E00  		call	DeviceInfoTable

⌨️ 快捷键说明

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