Académique Documents
Professionnel Documents
Culture Documents
Diagram above shows the waveform in which the bits has to be transferred. First is the
start bit.. then 8-bit data and at last a stop bit. There is a formula to calculate the time
which is needed between bits to get correct baudrate.
Below is a software implemented UART, which can be used in C programs. It is written
for Keil software.
(((11059200)/12)/32)/9600=3
Hardware Details:
P89v51rd2
Matrix Keypad:
UART section (RS232):
#include <REG51F.H>
/*********DELAY FUNCTION********************************/
// 1. passing parameter is int & no return
/****************************UART FUNCTION**********************/
void uart(int num) //TO SEND DATA TO PC USING DB-9 SERIAL PORT (COM 1)
{
char alp[16]={'1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G'};
row--;
num=(row*4+col); // CALCULATES NUMBER
void main()
{
int temp,row; //TEMP IS TEPORARY MEM
P2=0x0F;
P2=0x7f; //ENABLE ROW ZERO BY SETTING MSB AS LOW
ACC=P2;
temp=ACC&0x0f;
if(temp!=0x0f) //CHECK FOR KEY PRESSED
{
row=1;
disp(temp,row);
}