80 likes | 243 Vues
RFID-LCM. 下載 uart1-rfid-lcm-txet-chinese.rar. RS-232 接線. MSP430 實驗板. RFID. 7 Seg LED. 反接線. uart1. uart0. while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready? U1TXBUF = 0x02; // char to TXBUF0
E N D
RS-232接線 MSP430 實驗板 RFID 7 Seg LED 反接線 uart1 uart0
while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready? • U1TXBUF = 0x02; // char to TXBUF0 • while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready? • U1TXBUF = 0xA0; // char to TXBUF0 • while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready? • U1TXBUF = 0; // char to TXBUF0 • while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready? • U1TXBUF = 0x03; // char to TXBUF0 • while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready? • U1TXBUF = 0xA1; // char to TXBUF0 • while (!(IFG2 & UTXIFG1)); // USART1 TX buffer ready?
temp=0; • while(temp==0) • { • temp=recv_uart1(); • k++; • if (k >10000) • break; • } • rfid[0]=temp; • if (temp==2) • { • for(i=1; i<11; i++) • { • while(temp==0) • { • temp=recv_uart1(); • } • rfid[i]=temp; • }
讀取卡號 • - Command : 02 A0 00 03 A1 • - Response : 02 A0 05 53 4D • 0 1 2 3 4 • C2 EF 1C EB 03 60 (Incase of Mifare) • 5 6 7 8 9 10 • A6 9F E3 E5 黃慶祥卡號 • - Response : 02 A0 05 53 41 08 EB 4F 22 03 38 (Incase of Type A )
temp= rfid[i]; • temp= temp >>4; • if (temp <0x0a) • { • write_one_text(4,i*2, 0xd+temp); • } else { • write_one_text(4,i*2, 0x17+temp-0x0a); • }
If (rfid[5]== 0xc1 && rfid[6]== 0xc1 && rfid[7]== 0xc1 && rfid[8]== 0xc1 ) • { • }