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

📄 i2c.lst

📁 在cypress晶片上實驗讀取ps2 keyboard按鍵後顯示在lcd上,同時利用I2C寫入EEPROM
💻 LST
📖 第 1 页 / 共 4 页
字号:
   245                           ;i2c.c: 120: return (-1);
   246  04EC  34FF               	retlw	-1
   247                           ;i2c.c: 121: return ack;
   248  04ED  0843               	movf	?a_i2c_ReadAcknowledge,w
   249                           ;i2c.c: 122: }
   250  04EE  0008               	return
   251                           ;i2c.c: 128: int
   252                           ;i2c.c: 129: i2c_ReadByte(void)
   253                           ;i2c.c: 130: {
   254  04EF                     _i2c_ReadByte
   255                           ;	_i assigned to ?a_i2c_ReadByte+0
   256  0000                     _i2c_ReadByte$i	set	?a_i2c_ReadByte
   257                           ;	_byte assigned to ?a_i2c_ReadByte+1
   258  0000                     _i2c_ReadByte$byte	set	?a_i2c_ReadByte+1
   259                           ;	__dcnt assigned to ?a_i2c_ReadByte+2
   260  0000                     _i2c_ReadByte$_dcnt	set	?a_i2c_ReadByte+2
   261                           ;	__dcnt assigned to ?a_i2c_ReadByte+2
   262  0000                     _i2c_ReadByte$_dcnt	set	?a_i2c_ReadByte+2
   263                           ;i2c.c: 131: unsigned char i;
   264  04EF  0183               	clrf	3	;select bank 0
   265  04F0  01C4               	clrf	?a_i2c_ReadByte+1
   266                           ;i2c.c: 134: for(i=0; i<8; i++)
   267  04F1  01C3               	clrf	?a_i2c_ReadByte
   268  04F2                     l44
   269                           ;i2c.c: 135: {
   270                           ;i2c.c: 136: RC1 = 0; TRISC1 = 0;
   271  04F2  1087               	bcf	7,1
   272  04F3  1683               	bsf	3,5
   273  04F4  1087               	bcf	7,1
   274                           ;i2c.c: 137: { unsigned char _dcnt; _dcnt = (5)
      +                          *((20*1000L)/(12*1000L)); while(--_dcnt != 0) c
      +                          ontinue; };
   275  04F5  3005               	movlw	5
   276  04F6  1283               	bcf	3,5
   277  04F7  00C5               	movwf	?a_i2c_ReadByte+2
   278  04F8                     l48
   279  04F8  0BC5               	decfsz	?a_i2c_ReadByte+2
   280  04F9  2CF8               	goto	l48
   281                           ;i2c.c: 138: TRISC0 = 1;
   282  04FA  1683               	bsf	3,5
   283  04FB  1407               	bsf	7,0
   284                           ;i2c.c: 140: TRISC1 = 1;
   285  04FC  1487               	bsf	7,1
   286                           ;i2c.c: 141: if(i2c_WaitForSCL())
   287  04FD  2487               	fcall	_i2c_WaitForSCL
   288  04FE  3800               	iorlw	0
   289  04FF  1903               	btfsc	3,2
   290  0500  2D05               	goto	l50
   291                           ;i2c.c: 142: return (-1);
   292  0501  30FF               	movlw	255
   293  0502  00D6               	movwf	btemp
   294  0503  00D7               	movwf	btemp+1
   295  0504  0008               	return
   296  0505                     l50
   297                           ;i2c.c: 143: { unsigned char _dcnt; _dcnt = (4)
      +                          *((20*1000L)/(12*1000L)); while(--_dcnt != 0) c
      +                          ontinue; };
   298  0505  3004               	movlw	4
   299  0506  00C5               	movwf	?a_i2c_ReadByte+2
   300  0507                     l52
   301  0507  0BC5               	decfsz	?a_i2c_ReadByte+2
   302  0508  2D07               	goto	l52
   303                           ;i2c.c: 144: byte = byte << 1;
   304  0509  1003               	bcf	3,0
   305  050A  0DC4               	rlf	?a_i2c_ReadByte+1
   306                           ;i2c.c: 145: byte |= RC0;
   307  050B  3000               	movlw	0
   308  050C  1807               	btfsc	7,0
   309  050D  3001               	movlw	1
   310  050E  04C4               	iorwf	?a_i2c_ReadByte+1
   311                           ;i2c.c: 146: }
   312  050F  0AC3               	incf	?a_i2c_ReadByte
   313  0510  3008               	movlw	8
   314  0511  0243               	subwf	?a_i2c_ReadByte,w
   315  0512  1C03               	btfss	3,0
   316  0513  2CF2               	goto	l44
   317                           ;i2c.c: 147: return (int)byte;
   318  0514  0844               	movf	?a_i2c_ReadByte+1,w
   319  0515  00D6               	movwf	btemp
   320  0516  01D7               	clrf	btemp+1
   321                           ;i2c.c: 148: }
   322  0517  0008               	return
   323  0518                     _i2c_SendAddress
   324                           ;	_address assigned to ?a_i2c_SendAddress+0
   325  0000                     _i2c_SendAddress$address	set	?a_i2c_SendAddress
   326                           ;_address stored from w
   327  0518  0183               	clrf	3	;select bank 0
   328  0519  00C3               	movwf	?a_i2c_SendAddress
   329                           ;i2c.c: 99: return i2c_SendByte(address | (rw?1
      +                          :0));
   330  051A  08C3               	movf	?_i2c_SendAddress
   331  051B  3000               	movlw	0
   332  051C  1D03               	btfss	3,2
   333  051D  3001               	movlw	1
   334  051E  0443               	iorwf	?a_i2c_SendAddress,w
   335  051F  2C91               	ljmp	_i2c_SendByte
   336                           ;i2c.c: 100: }
   337  0520  0008               	return
   338                           ;i2c.c: 43: void
   339                           ;i2c.c: 44: i2c_Restart(void)
   340                           ;i2c.c: 45: {
   341  0521                     _i2c_Restart
   342                           ;	__dcnt assigned to ?a_i2c_Restart+0
   343  0000                     _i2c_Restart$_dcnt	set	?a_i2c_Restart
   344                           ;	__dcnt assigned to ?a_i2c_Restart+0
   345  0000                     _i2c_Restart$_dcnt	set	?a_i2c_Restart
   346                           ;	__dcnt assigned to ?a_i2c_Restart+0
   347  0000                     _i2c_Restart$_dcnt	set	?a_i2c_Restart
   348                           ;i2c.c: 46: RC1 = 0; TRISC1 = 0;
   349  0521  0183               	clrf	3	;select bank 0
   350  0522  1087               	bcf	7,1
   351  0523  1683               	bsf	3,5
   352  0524  1087               	bcf	7,1
   353                           ;i2c.c: 47: RC0 = 1; TRISC0 = 0;
   354  0525  1283               	bcf	3,5
   355  0526  1407               	bsf	7,0
   356  0527  1683               	bsf	3,5
   357  0528  1007               	bcf	7,0
   358                           ;i2c.c: 49: { unsigned char _dcnt; _dcnt = (1)*
      +                          ((20*1000L)/(12*1000L)); while(--_dcnt != 0) co
      +                          ntinue; };
   359  0529  1283               	bcf	3,5
   360  052A  01C3               	clrf	?a_i2c_Restart
   361  052B  0AC3               	incf	?a_i2c_Restart
   362  052C                     l12
   363  052C  0BC3               	decfsz	?a_i2c_Restart
   364  052D  2D2C               	goto	l12
   365                           ;i2c.c: 51: TRISC1 = 1;
   366  052E  1683               	bsf	3,5
   367  052F  1487               	bsf	7,1
   368                           ;i2c.c: 52: { unsigned char _dcnt; _dcnt = (4)*
      +                          ((20*1000L)/(12*1000L)); while(--_dcnt != 0) co
      +                          ntinue; };
   369  0530  3004               	movlw	4
   370  0531  1283               	bcf	3,5
   371  0532  00C3               	movwf	?a_i2c_Restart
   372  0533                     l16
   373  0533  0BC3               	decfsz	?a_i2c_Restart
   374  0534  2D33               	goto	l16
   375                           ;i2c.c: 54: RC0 = 0; TRISC0 = 0;
   376  0535  1007               	bcf	7,0
   377  0536  1683               	bsf	3,5
   378  0537  1007               	bcf	7,0
   379                           ;i2c.c: 55: { unsigned char _dcnt; _dcnt = (4)*
      +                          ((20*1000L)/(12*1000L)); while(--_dcnt != 0) co
      +                          ntinue; };
   380  0538  3004               	movlw	4
   381  0539  1283               	bcf	3,5
   382  053A  00C3               	movwf	?a_i2c_Restart
   383  053B                     l19
   384  053B  0BC3               	decfsz	?a_i2c_Restart
   385  053C  2D3B               	goto	l19
   386                           ;i2c.c: 56: return;
   387                           ;i2c.c: 57: }
   388  053D  0008               	return
   389  053E                     _i2c_Open
   390                           ;	_address assigned to ?a_i2c_Open+0
   391  0000                     _i2c_Open$address	set	?a_i2c_Open
   392                           ;_address stored from w
   393  053E  0183               	clrf	3	;select bank 0
   394  053F  00C3               	movwf	?a_i2c_Open
   395                           ;i2c.c: 251: i2c_Restart();
   396  0540  2521               	fcall	_i2c_Restart
   397                           ;i2c.c: 252: i2c_SendAddress(address, mode);
   398  0541  0843               	movf	?_i2c_Open,w
   399  0542  00C3               	movwf	?_i2c_SendAddress
   400  0543  0843               	movf	?a_i2c_Open,w
   401  0544  2518  118A         	fcall	_i2c_SendAddress
   402                           ;i2c.c: 253: if(i2c_ReadAcknowledge())
   403  0546  24D4               	fcall	_i2c_ReadAcknowledge
   404  0547  3800               	iorlw	0
   405  0548  1D03               	btfss	3,2
   406                           ;i2c.c: 254: return !0;
   407  0549  3401               	retlw	1
   408                           ;i2c.c: 256: return 0;
   409  054A  3400               	retlw	0
   410  054B                     _i2c_Stop
   411                           ;	__dcnt assigned to ?a_i2c_Stop+0
   412  0000                     _i2c_Stop$_dcnt	set	?a_i2c_Stop
   413                           ;	__dcnt assigned to ?a_i2c_Stop+0
   414  0000                     _i2c_Stop$_dcnt	set	?a_i2c_Stop
   415                           ;	__dcnt assigned to ?a_i2c_Stop+0
   416  0000                     _i2c_Stop$_dcnt	set	?a_i2c_Stop
   417                           ;i2c.c: 24: RC0 = 0; TRISC0 = 0;
   418  054B  0183               	clrf	3	;select bank 0
   419  054C  1007               	bcf	7,0
   420  054D  1683               	bsf	3,5
   421  054E  1007               	bcf	7,0
   422                           ;i2c.c: 25: RC1 = 1; TRISC1 = 0;
   423  054F  1283               	bcf	3,5
   424  0550  1487               	bsf	7,1
   425  0551  1683               	bsf	3,5
   426  0552  1087               	bcf	7,1
   427                           ;i2c.c: 27: { unsigned char _dcnt; _dcnt = (1)*
      +                          ((20*1000L)/(12*1000L)); while(--_dcnt != 0) co
      +                          ntinue; };
   428  0553  1283               	bcf	3,5
   429  0554  01C3               	clrf	?a_i2c_Stop
   430  0555  0AC3               	incf	?a_i2c_Stop
   431  0556                     l2
   432  0556  0BC3               	decfsz	?a_i2c_Stop
   433  0557  2D56               	goto	l2
   434                           ;i2c.c: 28: TRISC1 = 1;
   435  0558  1683               	bsf	3,5
   436  0559  1487               	bsf	7,1
   437                           ;i2c.c: 29: { unsigned char _dcnt; _dcnt = (5)*
      +                          ((20*1000L)/(12*1000L)); while(--_dcnt != 0) co
      +                          ntinue; };
   438  055A  3005               	movlw	5
   439  055B  1283               	bcf	3,5
   440  055C  00C3               	movwf	?a_i2c_Stop
   441  055D                     l6
   442  055D  0BC3               	decfsz	?a_i2c_Stop
   443  055E  2D5D               	goto	l6
   444                           ;i2c.c: 30: RC0 = 1; TRISC0 = 0;
   445  055F  1407               	bsf	7,0
   446  0560  1683               	bsf	3,5
   447  0561  1007               	bcf	7,0
   448                           ;i2c.c: 31: { unsigned char _dcnt; _dcnt = (5)*
      +                          ((20*1000L)/(12*1000L)); while(--_dcnt != 0) co
      +                          ntinue; };
   449  0562  3005               	movlw	5
   450  0563  1283               	bcf	3,5
   451  0564  00C3               	movwf	?a_i2c_Stop
   452  0565                     l9
   453  0565  0BC3               	decfsz	?a_i2c_Stop
   454  0566  2D65               	goto	l9
   455                           ;i2c.c: 32: TRISC0 = 1;
   456  0567  1683               	bsf	3,5
   457  0568  1407               	bsf	7,0
   458                           ;i2c.c: 34: return;
   459                           ;i2c.c: 35: }
   460  0569  1283               	bcf	3,5
   461  056A  0008               	return
   462                           ;i2c.c: 294: unsigned char i2c_read(unsigned ch
      +                          ar ucAdr)
   463                           ;i2c.c: 295: {
   464  056B                     _i2c_read
   465                           ;	_ucAdr assigned to ?a_i2c_read+0
   466  0000                     _i2c_read$ucAdr	set	?a_i2c_read
   467                           ;	_ucDat assigned to ?a_i2c_read+1
   468  0000                     _i2c_read$ucDat	set	?a_i2c_read+1
   469                           ;_ucAdr stored from w
   470  056B  0183               	clrf	3	;select bank 0
   471  056C  00C3               	movwf	?a_i2c_read
   472                           ;i2c.c: 296: unsigned char ucDat;
   473  056D  01C3               	clrf	?_i2c_Open
   474  056E  0AC3               	incf	?_i2c_Open
   475  056F  253E               	fcall	_i2c_Open
   476  0570  00D6               	movwf	btemp
   477  0571  01D7               	clrf	btemp+1
   478  0572  0457               	iorwf	btemp+1,w
   479  0573  1D03               	btfss	3,2
   480  0574  2D7B               	goto	l99
   481                           ;i2c.c: 299: {
   482  0575  3001               	movlw	1
   483  0576  2597  118A         	fcall	_i2c_GetByte
   484  0578  0856               	movf	btemp,w
   485  0579  00C4               	movwf	?a_i2c_read+1
   486                           ;i2c.c: 301: i2c_Stop();
   487  057A  254B               	fcall	_i2c_Stop
   488  057B                     l99

⌨️ 快捷键说明

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