วันศุกร์ที่ 8 กุมภาพันธ์ พ.ศ. 2562

microcontroller 9

RFID Interfacing with PIC Microcontroller


RFID Interfacing with PIC Microcontroller



Material Required

To make this project we need following items-
  1. PIC16F877A
  2. 20Mhz Crystal
  3. 2pcs 33pF ceramic disc capacitor
  4. 16x2 Character LCD
  5. A breadboard
  6. 10k preset pot
  7. 4.7k resistor
  8. Single strand wires to connect
  9. A 5V adapter
  10. RF Module EM-18
  11. 5V Buzzer
  12. 100uF & .1uF 12V capacitor
  13. BC557 Transistor
  14. LED
  15. 2.2k and 470R resistor.

Project Code


/*
 * File:   main.c
 * Author: Sourav Gupta
 * By:- circuitdigest.com
 * Created on August 15, 2018, 2:26 PM
 */
// PIC16F877A Configuration Bit Settings
// 'C' source line config statements
// CONFIG
#pragma config FOSC = HS        // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
#pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = ON       // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = OFF         // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3/PGM pin has PGM function; low-voltage programming enabled)
#pragma config CPD = OFF        // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF        // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF         // Flash Program Memory Code Protection bit (Code protection off)

#include <xc.h>
#include <stdio.h>
#include <string.h>
#include "supporing_cfile\lcd.h"
#include "supporing_cfile\eusart1.h"
/*
 Hardware related definition
 */
#define _XTAL_FREQ 200000000 //Crystal Frequency, used in delay
/*
 Other Specific definition
 */
void system_init(void); // This will initialize the system.
void main(void) {
    unsigned char count;
    unsigned char RF_ID[13];    
    system_init();
    lcd_com(0x80);
    lcd_puts("Circuit Digest");    
    while (1){        
        for (count=0; count<12; count++){
            RF_ID[count] = 0;
            RF_ID[count]=EUSART1_Read();
        }        
        lcd_com(0xC0); // Set the cursor for second line begining
        lcd_puts("ID: ");
        lcd_puts(RF_ID);        
    }
}
/*
 This Function is for system initializations.
 */
void system_init(void){
    TRISB = 0x00; //PORT B set as output pin
    lcd_init(); // This will initialize the lcd
    EUSART1_Initialize(); // This will initialize the Eusart
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

Internet of Things (IoT)

Internet of Things หรือ IoT Internet of Things (IoT)  คือ การที่อุปกรณ์อิเล็กทรอนิกส์ต่างๆ สามารถเชื่อมโยงหรือส่งข้อมูลถึงกันได้ด้วยอิน...