Line No. | Rev | Author | Line |
---|---|---|---|
1 | 3 | kaklik | |
2 | |||
3 | #include <16F876.h> |
||
4 | #include <16f877_reg.h> |
||
5 | #use delay (clock=4000000) |
||
6 | #use rs232 (baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7) |
||
7 | #fuses XT,NOWDT,NOBROWNOUT,NOPROTECT,NOLVP |
||
8 | |||
9 | |||
10 | |||
11 | // definice obsazeni portu |
||
12 | // pro driver touch memory |
||
13 | #define TM_PIN PIN_A1 |
||
14 | #bit TM_PIN_BIT = PORTA.1 |
||
15 | #include <tm.c> |
||
16 | |||
17 | |||
18 | void main() { |
||
19 | |||
20 | int8 sn[8]; |
||
21 | int8 i; |
||
22 | |||
23 | printf("cteni TM\n\r"); |
||
24 | for(;;) |
||
25 | { |
||
26 | if(TM_present()) |
||
27 | { |
||
28 | if(TM_read_sn(sn)) |
||
29 | { |
||
30 | printf("%2X",*sn); // vypis family kod |
||
31 | for (i=6;i>0;i--) printf("%2X",*(sn+i)); // vypis SN |
||
32 | printf("%2X\r\n",*(sn+7)); // vypis CRC |
||
33 | } |
||
34 | else printf("BAD CRC\n\r"); |
||
35 | } |
||
36 | while(TM_present()); // cekej az se odpoji touch memory |
||
37 | } |
||
38 | } |
Powered by WebSVN v2.8.3