使用Microchip公司16F648实现4*6键盘程序. 在PICC环境下编译通过,包含RS485通讯. 代码完整,可供参考.

源代码在线查看: led.sdb

软件大小: 188 K
上传用户: wangdatouay
关键词: Microchip 16F648 PICC 485
下载地址: 免注册下载 普通下载 VIP

相关代码

				[p GLOBOPT AUTOSTATIC PIC14 PICMIDHI PICLOMID ]
				"13 c:\program files\HT-PIC\INCLUDE\pic16f62xa.h
				[v _TMR0 `Vuc  1 s 1 @1 ]
				"14
				[v _PCL `Vuc  1 s 1 @2 ]
				"15
				[v _STATUS `Vuc  1 s 1 @3 ]
				"16
				[v _FSR `uc  1 s 1 @4 ]
				"17
				[v _PORTA `Vuc  1 s 1 @5 ]
				"18
				[v _PORTB `Vuc  1 s 1 @6 ]
				"19
				[v _PCLATH `Vuc  1 s 1 @10 ]
				"20
				[v _INTCON `Vuc  1 s 1 @11 ]
				"21
				[v _PIR1 `Vuc  1 s 1 @12 ]
				"22
				[v _TMR1L `Vuc  1 s 1 @14 ]
				"23
				[v _TMR1H `Vuc  1 s 1 @15 ]
				"24
				[v _T1CON `uc  1 s 1 @16 ]
				"25
				[v _TMR2 `Vuc  1 s 1 @17 ]
				"26
				[v _T2CON `uc  1 s 1 @18 ]
				"27
				[v _CCPR1L `Vuc  1 s 1 @21 ]
				"28
				[v _CCPR1H `Vuc  1 s 1 @22 ]
				"29
				[v _CCP1CON `Vuc  1 s 1 @23 ]
				"30
				[v _RCSTA `Vuc  1 s 1 @24 ]
				"31
				[v _TXREG `Vuc  1 s 1 @25 ]
				"32
				[v _RCREG `Vuc  1 s 1 @26 ]
				"33
				[v _CMCON `Vuc  1 s 1 @31 ]
				"34
				[v _OPTION `Xuc  1 s 1 @129 ]
				"35
				[v _TRISA `VXuc  1 s 1 @133 ]
				"36
				[v _TRISB `VXuc  1 s 1 @134 ]
				"37
				[v _PIE1 `Xuc  1 s 1 @140 ]
				"38
				[v _PCON `VXuc  1 s 1 @142 ]
				"39
				[v _PR2 `Xuc  1 s 1 @146 ]
				"40
				[v _TXSTA `VXuc  1 s 1 @152 ]
				"41
				[v _SPBRG `Xuc  1 s 1 @153 ]
				"42
				[v _EEDATA `VXuc  1 s 1 @154 ]
				"43
				[v _EEADR `Xuc  1 s 1 @155 ]
				"44
				[v _EECON1 `VXuc  1 s 1 @156 ]
				"45
				[v _EECON2 `VXuc  1 s 1 @157 ]
				"46
				[v _VRCON `Xuc  1 s 1 @159 ]
				"50
				[v _CARRY `Vb  1 s 0 @24 ]
				"51
				[v _DC `Vb  1 s 0 @25 ]
				"52
				[v _ZERO `Vb  1 s 0 @26 ]
				"53
				[v _PD `Vb  1 s 0 @27 ]
				"54
				[v _TO `Vb  1 s 0 @28 ]
				"55
				[v _RP0 `b  1 s 0 @29 ]
				"56
				[v _RP1 `b  1 s 0 @30 ]
				"57
				[v _IRP `b  1 s 0 @31 ]
				"60
				[v _RA0 `Vb  1 s 0 @40 ]
				"61
				[v _RA1 `Vb  1 s 0 @41 ]
				"62
				[v _RA2 `Vb  1 s 0 @42 ]
				"63
				[v _RA3 `Vb  1 s 0 @43 ]
				"64
				[v _RA4 `Vb  1 s 0 @44 ]
				"65
				[v _RA5 `Vb  1 s 0 @45 ]
				"66
				[v _RA6 `Vb  1 s 0 @46 ]
				"67
				[v _RA7 `Vb  1 s 0 @47 ]
				"70
				[v _RB0 `Vb  1 s 0 @48 ]
				"71
				[v _RB1 `Vb  1 s 0 @49 ]
				"72
				[v _RB2 `Vb  1 s 0 @50 ]
				"73
				[v _RB3 `Vb  1 s 0 @51 ]
				"74
				[v _RB4 `Vb  1 s 0 @52 ]
				"75
				[v _RB5 `Vb  1 s 0 @53 ]
				"76
				[v _RB6 `Vb  1 s 0 @54 ]
				"77
				[v _RB7 `Vb  1 s 0 @55 ]
				"80
				[v _RBIF `Vb  1 s 0 @88 ]
				"81
				[v _INTF `Vb  1 s 0 @89 ]
				"82
				[v _T0IF `Vb  1 s 0 @90 ]
				"83
				[v _RBIE `b  1 s 0 @91 ]
				"84
				[v _INTE `b  1 s 0 @92 ]
				"85
				[v _T0IE `b  1 s 0 @93 ]
				"86
				[v _PEIE `b  1 s 0 @94 ]
				"87
				[v _GIE `b  1 s 0 @95 ]
				"90
				[v _TMR1IF `Vb  1 s 0 @96 ]
				"91
				[v _TMR2IF `Vb  1 s 0 @97 ]
				"92
				[v _CCP1IF `Vb  1 s 0 @98 ]
				"93
				[v _TXIF `Vb  1 s 0 @100 ]
				"94
				[v _RCIF `Vb  1 s 0 @101 ]
				"95
				[v _CMIF `Vb  1 s 0 @102 ]
				"96
				[v _EEIF `Vb  1 s 0 @103 ]
				"99
				[v _TMR1ON `b  1 s 0 @128 ]
				"100
				[v _TMR1CS `b  1 s 0 @129 ]
				"101
				[v _T1SYNC `b  1 s 0 @130 ]
				"102
				[v _T1OSCEN `b  1 s 0 @131 ]
				"103
				[v _T1CKPS0 `b  1 s 0 @132 ]
				"104
				[v _T1CKPS1 `b  1 s 0 @133 ]
				"107
				[v _T2CKPS0 `b  1 s 0 @144 ]
				"108
				[v _T2CKPS1 `b  1 s 0 @145 ]
				"109
				[v _TMR2ON `b  1 s 0 @146 ]
				"110
				[v _TOUTPS0 `b  1 s 0 @147 ]
				"111
				[v _TOUTPS1 `b  1 s 0 @148 ]
				"112
				[v _TOUTPS2 `b  1 s 0 @149 ]
				"113
				[v _TOUTPS3 `b  1 s 0 @150 ]
				"116
				[v _CCP1M0 `b  1 s 0 @184 ]
				"117
				[v _CCP1M1 `b  1 s 0 @185 ]
				"118
				[v _CCP1M2 `b  1 s 0 @186 ]
				"119
				[v _CCP1M3 `b  1 s 0 @187 ]
				"120
				[v _CCP1Y `Vb  1 s 0 @188 ]
				"121
				[v _CCP1X `Vb  1 s 0 @189 ]
				"124
				[v _RX9D `Vb  1 s 0 @192 ]
				"125
				[v _OERR `Vb  1 s 0 @193 ]
				"126
				[v _FERR `Vb  1 s 0 @194 ]
				"127
				[v _ADEN `b  1 s 0 @195 ]
				"128
				[v _CREN `b  1 s 0 @196 ]
				"129
				[v _SREN `b  1 s 0 @197 ]
				"130
				[v _RX9 `b  1 s 0 @198 ]
				"131
				[v _SPEN `b  1 s 0 @199 ]
				"134
				[v _CM0 `b  1 s 0 @248 ]
				"135
				[v _CM1 `b  1 s 0 @249 ]
				"136
				[v _CM2 `b  1 s 0 @250 ]
				"137
				[v _CIS `b  1 s 0 @251 ]
				"138
				[v _C1INV `b  1 s 0 @252 ]
				"139
				[v _C2INV `b  1 s 0 @253 ]
				"140
				[v _C1OUT `Vb  1 s 0 @254 ]
				"141
				[v _C2OUT `Vb  1 s 0 @255 ]
				"144
				[v _PS0 `Xb  1 s 0 @1032 ]
				"145
				[v _PS1 `Xb  1 s 0 @1033 ]
				"146
				[v _PS2 `Xb  1 s 0 @1034 ]
				"147
				[v _PSA `Xb  1 s 0 @1035 ]
				"148
				[v _T0SE `Xb  1 s 0 @1036 ]
				"149
				[v _T0CS `Xb  1 s 0 @1037 ]
				"150
				[v _INTEDG `Xb  1 s 0 @1038 ]
				"151
				[v _RBPU `Xb  1 s 0 @1039 ]
				"154
				[v _TRISA0 `VXb  1 s 0 @1064 ]
				"155
				[v _TRISA1 `VXb  1 s 0 @1065 ]
				"156
				[v _TRISA2 `VXb  1 s 0 @1066 ]
				"157
				[v _TRISA3 `VXb  1 s 0 @1067 ]
				"158
				[v _TRISA4 `VXb  1 s 0 @1068 ]
				"159
				[v _TRISA5 `VXb  1 s 0 @1069 ]
				"160
				[v _TRISA6 `VXb  1 s 0 @1070 ]
				"161
				[v _TRISA7 `VXb  1 s 0 @1071 ]
				"164
				[v _TRISB0 `VXb  1 s 0 @1072 ]
				"165
				[v _TRISB1 `VXb  1 s 0 @1073 ]
				"166
				[v _TRISB2 `VXb  1 s 0 @1074 ]
				"167
				[v _TRISB3 `VXb  1 s 0 @1075 ]
				"168
				[v _TRISB4 `VXb  1 s 0 @1076 ]
				"169
				[v _TRISB5 `VXb  1 s 0 @1077 ]
				"170
				[v _TRISB6 `VXb  1 s 0 @1078 ]
				"171
				[v _TRISB7 `VXb  1 s 0 @1079 ]
				"174
				[v _TMR1IE `Xb  1 s 0 @1120 ]
				"175
				[v _TMR2IE `Xb  1 s 0 @1121 ]
				"176
				[v _CCP1IE `Xb  1 s 0 @1122 ]
				"177
				[v _TXIE `Xb  1 s 0 @1124 ]
				"178
				[v _RCIE `Xb  1 s 0 @1125 ]
				"179
				[v _CMIE `Xb  1 s 0 @1126 ]
				"180
				[v _EEIE `Xb  1 s 0 @1127 ]
				"183
				[v _BOR `VXb  1 s 0 @1136 ]
				"184
				[v _POR `VXb  1 s 0 @1137 ]
				"185
				[v _OSCF `Xb  1 s 0 @1139 ]
				"188
				[v _TX9D `VXb  1 s 0 @1216 ]
				"189
				[v _TRMT `VXb  1 s 0 @1217 ]
				"190
				[v _BRGH `Xb  1 s 0 @1218 ]
				"191
				[v _SYNC `Xb  1 s 0 @1220 ]
				"192
				[v _TXEN `Xb  1 s 0 @1221 ]
				"193
				[v _TX9 `Xb  1 s 0 @1222 ]
				"194
				[v _CSRC `Xb  1 s 0 @1223 ]
				"197
				[v _RD `VXb  1 s 0 @1248 ]
				"198
				[v _WR `VXb  1 s 0 @1249 ]
				"199
				[v _WREN `Xb  1 s 0 @1250 ]
				"200
				[v _WRERR `VXb  1 s 0 @1251 ]
				"203
				[v _VR0 `Xb  1 s 0 @1272 ]
				"204
				[v _VR1 `Xb  1 s 0 @1273 ]
				"205
				[v _VR2 `Xb  1 s 0 @1274 ]
				"206
				[v _VR3 `Xb  1 s 0 @1275 ]
				"207
				[v _VRR `Xb  1 s 0 @1277 ]
				"208
				[v _VROE `Xb  1 s 0 @1278 ]
				"209
				[v _VREN `Xb  1 s 0 @1279 ]
				"3 D:\NewKeyBoard\typedefine.h
				[v _uint `ui  1 t 2 ]
				"4
				[v _ulong `ul  1 t 4 ]
				"5
				[v _uchar `uc  1 t 1 ]
				"33
				[s S2 . 2 `uc  1 time1ms 1 0 :1:0 
				`uc  1 time2ms 1 0 :1:1 
				`uc  1 time4ms 1 0 :1:2 
				`uc  1 time8ms 1 0 :1:3 
				`uc  1 time16ms 1 0 :1:4 
				`uc  1 time32ms 1 0 :1:5 
				`uc  1 time64ms 1 0 :1:6 
				`uc  1 time128ms 1 0 :1:7 
				`uc  1 time256ms 1 1 :1:0 
				`uc  1 time512ms 1 1 :1:1 
				`uc  1 time1s 1 1 :1:2 
				`uc  1 time2s 1 1 :1:3 
				`uc  1 time4s 1 1 :1:4 
				`uc  1 time8s 1 1 :1:5 
				`uc  1 time16s 1 1 :1:6 
				`uc  1 time32s 1 1 :1:7 
				]
				"35
				[u S1 . 2 `S2  1 bits 2 0 
				`ui  1 alltimes 2 0 
				]
				[v _TIMEBASEstruct `S1  1 t 2 ]
				"50
				[s S4 . 1 `uc  1 scankey 1 0 :1:0 
				`uc  1 keybitmanage 1 0 :1:1 
				`uc  1 keymanage 1 0 :1:2 
				`uc  1 ledshowdigitcou 1 0 :1:3 
				`uc  1 ledshow 1 0 :1:4 
				`uc  1 . 1 0 :1:5 
				]
				"52
				[u S3 . 2 `S4  1 bits 1 0 
				`ui  1 allbits 2 0 
				]
				[v _MissionFlagStruct `S3  1 t 2 ]
				"62
				[s S6 . 2 `uc  1 OneKey 1 0 
				`uc  1 CompKey 1 1 :4:0 
				`uc  1 Status 1 1 :4:4 
				]
				"64
				[u S5 . 2 `S6  1 bits 2 0 
				`ui  1 allbits 2 0 
				]
				[v _KEYVALUESTRUCT `S5  1 t 2 ]
				"77
				[s S8 . 1 `uc  1 keyscanbit0 1 0 :1:0 
				`uc  1 keyscanbit1 1 0 :1:1 
				`uc  1 keyscanbit2 1 0 :1:2 
				`uc  1 keyscanbit3 1 0 :1:3 
				]
				"79
				[u S7 . 1 `S8  1 bits 1 0 
				`uc  1 allbits 1 0 
				]
				[v _KeyInputStruct `S7  1 t 1 ]
				"99
				[s S10 . 2 `uc  1 UnitaryKey 1 0 :1:0 
				`uc  1 MultiKey 1 0 :1:1 
				`uc  1 LongKeyCouTag 1 0 :1:2 
				`uc  1 MultiKeyOne 1 0 :1:3 
				`uc  1 MultiKeyTwo 1 0 :1:4 
				`uc  1 MultiKeyThree 1 0 :1:5 
				`uc  1 MultiKeyFour 1 0 :1:6 
				`uc  1 MultiKeyTwoCouTag 1 0 :1:7 
				`uc  1 MultiKeyThreeCouTag 1 1 :3:0 
				]
				"101
				[u S9 . 2 `S10  1 bits 2 0 
				`ui  1 allbits 2 0 
				]
				[v _KeyFunStruct `S9  1 t 2 ]
				"135
				[s S12 . 3 `uc  1 KeyValue_1 1 0 :1:0 
				`uc  1 KeyValue_2 1 0 :1:1 
				`uc  1 KeyValue_3 1 0 :1:2 
				`uc  1 KeyValue_4 1 0 :1:3 
				`uc  1 KeyValue_5 1 0 :1:4 
				`uc  1 KeyValue_6 1 0 :1:5 
				`uc  1 KeyValue_7 1 0 :1:6 
				`uc  1 KeyValue_8 1 0 :1:7 
				`uc  1 KeyValue_9 1 1 :1:0 
				`uc  1 KeyValue_10 1 1 :1:1 
				`uc  1 KeyValue_11 1 1 :1:2 
				`uc  1 KeyValue_12 1 1 :1:3 
				`uc  1 KeyValue_13 1 1 :1:4 
				`uc  1 KeyValue_14 1 1 :1:5 
				`uc  1 KeyValue_15 1 1 :1:6 
				`uc  1 KeyValue_16 1 1 :1:7 
				`uc  1 KeyValue_17 1 2 :1:0 
				`uc  1 KeyValue_18 1 2 :1:1 
				`uc  1 KeyValue_19 1 2 :1:2 
				`uc  1 KeyValue_20 1 2 :1:3 
				`uc  1 KeyValue_21 1 2 :1:4 
				`uc  1 KeyValue_22 1 2 :1:5 
				`uc  1 KeyValue_23 1 2 :1:6 
				`uc  1 KeyValue_24 1 2 :1:7 
				]
				"137
				[u S11 . 4 `S12  1 bits 3 0 
				`ul  1 allbits 4 0 
				]
				[v _KEYBITVALUESTRUCT `S11  1 t 4 ]
				"152
				[s S14 . 1 `uc  1 HostStatus 1 0 :2:0 
				`uc  1 UartSendTag 1 0 :1:2 
				`uc  1 UartSendEndTag 1 0 :1:3 
				`uc  1 UartLinkErrTag 1 0 :1:4 
				`uc  1 frameSendEndTag 1 0 :1:5 
				`uc  1 singleKeyTag 1 0 :1:6 
				]
				"154
				[u S13 . 2 `S14  1 bits 1 0 
				`ui  1 allbits 2 0 
				]
				[v _UARTSTRUCT `S13  1 t 2 ]
				"13 D:\NewKeyBoard\extern.h
				[v F410 `(v  1 t 0 ]
				"6 D:\NewKeyBoard\led.c
				[v _aloneD `Xuc  4a e 4 0 ]
				"10
				[v _lightled0 `(v  1 e 0 0 ]
				{
				"13
				} 0
				"16
				[v _lightled1 `(v  1 e 0 0 ]
				{
				"20
				} 0
				"23
				[v _lightled2 `(v  1 e 0 0 ]
				{
				"27
				} 0
				"30
				[v _lightled3 `(v  1 e 0 0 ]
				{
				"34
				} 0
				"37
				[v _lightled4 `(v  1 e 0 0 ]
				{
				"41
				} 0
				"44
				[v _lightled5 `(v  1 e 0 0 ]
				{
				"48
				} 0
				"51
				[v _lightled6 `(v  1 e 0 0 ]
				{
				"55
				} 0
				"58
				[v _lightled7 `(v  1 e 0 0 ]
				{
				"62
				} 0
				"65
				[v _lightled8 `(v  1 e 0 0 ]
				{
				"68
				} 0
				"71
				[v _lightled9 `(v  1 e 0 0 ]
				{
				"75
				} 0
				"80
				[v _ledinit `(v  1 e 0 0 ]
				{
				"98
				} 0
				"102
				[v _CalculateSub `(v  1 e 0 0 ]
				{
				[v _Digit `ui  1 p 2 0 ]
				[v _p_aloneD `*uc  1 p 1 2 ]
				[v _p_aloneD `*uc  1 p 1 2 ]
				[v _Digit `ui  1 p 2 0 ]
				"114
				} 0
				"118
				[v _sub2 `(v  1 e 0 0 ]
				{
				"119
				[v F498 `Yui  1 s 2 ShowDigit ]
				"124
				} 0
				"128
				[v _subled `(v  1 e 0 0 ]
				{
				"129
				[v F501 `Yuc  1 s 1 ledbitcou ]
				"128
				[v _byteT `uc  1 a 1 0 ]
				[v _bytebit `uc  1 a 1 1 ]
				"153
				} 2
				[v _LedShowLink `VYui  0 e 2 0 ]
				[v _pcled `*(v  0a e 0 0 ]
							

相关资源