Microcontroller › 8051 › Intefacing Problem in my RFID module and its CODING….. › MAX 232 IC is already
MAX 232 IC is already connected in my module.. Do i need to connect another max232 IC to interface with my at89c52 microcontroller..? Serial port is also connected. plz tell me how to interface with Microcontroller.
my program is like this. Is there any correction needed..?
// Program to interface controller with controller
#include<reg52.h>
#include<stdio.h>
#include<string.h>
#define port P3 // command port for lcd
#define dataport P0 //dataport for lcd
#define key P1 // port for keypad
#define sec 100
sbit rs = port^7;
sbit rw = port^6;
sbit e = port^5;
sbit col1=key^4;
sbit col2=key^5;
sbit col3=key^6;
sbit row1=key^0;
sbit row2=key^1;
sbit row3=key^2;
sbit row4=key^3;
sbit buzzer_pin=P2^1; // Buzzer pin to sound the buzzer.
sbit lock_output=P2^7;
int check=0;
int digit[4]={0,0,0,0};
int dig_one=3;
int dig_two=9;
int dig_three=0;
int dig_four=7;
int i,count=0;
unsigned char card_id[12];
void delay(unsigned int msec) // time delay function
{
int i,j;
for(i=0;i<msec;i++)
for (j=0;j<1275;j++);
}
void lcdcmd(unsigned char item) // function to send lcd command
{
dataport=item;
rs=0;
rw=0;
e=1;
delay(10);
e=0;
return;
}
void lcddata(unsigned char item) //function to send data to the lcd
{
dataport=item;
rs=1;
rw=0;
e=1;
delay(10);
e=0;
return;
}
void lcddatastring(unsigned char *str) // function to display on lcd string thru pointer by reading 1 by 1
{
int i=0;
while(str!=’