?lang_form? ?lang_select? ?lang_submit? ?lang_endform?
{HEADER END}
{FILE START}

library

?curdirlinks? - Rev 3

?prevdifflink? - Blame - ?getfile?



#include <16F876.h>
#include <16f877_reg.h>
#use delay (clock=4000000)
#use rs232 (baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7)
#fuses XT,NOWDT,NOBROWNOUT,NOPROTECT,NOLVP



// definice obsazeni portu
// pro driver touch memory
#define  TM_PIN   PIN_A1
#bit     TM_PIN_BIT = PORTA.1
#include <tm.c>


void main() {

 int8 sn[8];
 int8 i;

printf("cteni TM\n\r");
 for(;;)
 {
   if(TM_present())
   {
      if(TM_read_sn(sn))
      {
       printf("%2X",*sn);     // vypis family kod
       for (i=6;i>0;i--)  printf("%2X",*(sn+i)); // vypis SN
       printf("%2X\r\n",*(sn+7));     // vypis CRC
      } 
      else printf("BAD CRC\n\r");
   } 
   while(TM_present()); // cekej az se odpoji touch memory
 }
}
{FILE END}
{FOOTER START}

Powered by WebSVN v2.8.3