PIC16F628A VÍ DỤ MÁY PHÁT RF NHẬN C VỚI DILI

PIC16F628A VÍ DỤ MÁY PHÁT RF NHẬN C VỚI DILI


"PIC16F628 Mẫu RF Transceiver Circuit với C Ngôn ngữ" Resource Project Proteus Isis mô phỏng và máy thu, các file phần mềm phát với PIC16F628 Mẫu RF Transceiver mạch C Ngôn ngữ
Tải xuống tệp LINK danh sách (ở định dạng TXT) link-4200.zip mật khẩu-pass: 320volt.com
Cảm ơn bạn
Sơ đồ mạch thu phát RF
Sơ đồ mạch thu phát RF
Alıcı.c
#include <16f628 .h="">
#FUSES NOWDT, NOPUT, PROTECT, BROWNOUT, NOMCLR, NOLVP, INTRC_IO
#use delay (clock = 4000000)
#use rs232 (baud = 300, chẵn lẻ = N, rcv = PIN_B1, XMIT = PIN_B2, bit = 8, ERRORS, BRGH1OK)


#Byte PORTA = 5
#Byte PORTB = 6
#Bit C_ac = PortA.0
#Bit C_kapa = PortA.1
#Bit G_guvenlik = PortB.3
#Bit G_Acik = PortB.4
#Bit G_kapali = PortB.5

void first ();

int8 x = 0, y = 0, Vtam = 0, Bắt đầu = 0;
int8 dat [4];

trong #int_r
void serial_isr () {
if (Kbhit ()) y = getc ();
if ((y == 'B') && (! vtam)) Basla = 1;

if (Bắt đầu)
   {Ngày [x] = y; x ++;
         if (x & gt; 2) {
            if (Dat [1] == 'C') {vtam = 1; basla = 0; x = 0;
               {VTAM = 0; start = 0; x = 0;}
                  }

   }

}


void main ()

{
   đầu tiên ();
   while (1) {

   if (Vtam) {
      Disable_interrupts (GLOBAL);

      if (Dat [2] == 'A') // Mở lệnh
      {
      if (G_kapali == 0 && G_guvenlik == 1)
      C_ac = 1;

      trong khi (C_ac == 1) {
         if (G_acik == 0) C_ac = 0;
         if (G_ security == 0) C_ac = 0;
      }
      }

      if (Dat [2] == 'K') // Đóng lệnh
      {
      if (G_acik == 0 && G_guliklik == 1)
      C_kapa = 1;

      trong khi (C_kapa == 1) {
      if (G_kapali == 0 || G_guliklik == 0)
      C_kapa = 0;
      }
      }

   vtam = 0;
   enable_interrupts (GLOBAL);

   }
   }
}



void first () {
   set_tris_b (0B00111010);
   set_tris_ A (0);
   clear_interrupt (trong INT_R);
   clear_interrupt (INT_EXT);
   Disable_interrupts (GLOBAL);
   PortA = 0;
   PORTB = 0;
   port_b_pullups (TRUE);

   setup_timer_0 (RTCC_INTERNAL);
   setup_timer_1 (T1_DISABLED);
   setup_timer_2 (T2_DISABLED, 0,1);
   setup_comparat là (NC_NC_NC_NC);
   setup_vref (FALSE);
   setup_uart (True);
   enable_interrupts (trong INT_R);
   enable_interrupts (GLOBAL);
}
Verici.c
#include <16f628 .h="">
#FUSES NOWDT, NOPUT, NOPROTECT, BROWNOUT, NOMCLR, NOLVP, INTRC_IO
#use delay (clock = 4000000)
#use rs232 (baud = 300, chẵn lẻ = N, rcv = PIN_B1, XMIT = PIN_B2, bit = 8, ERRORS, BRGH1OK)


#Byte PORTA = 5
#Byte PORTB = 6
#Bit B_ac = PortB.4
#Bit B_close = PortB.5

void first ();

void main ()

{
   đầu tiên ();
   while (1) {
   if (B_ac == 0) {
   Putc ( 'B'); putc ( 'C'); putc ( 'A');
   Delay_ms (100);

Post a Comment

[disqus] [facebook] [blogger]

MKRdezign

Biểu mẫu liên hệ

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget
Hỗ trợ trực tuyến