Discussion in "8051 Discussion Forum" started by    rearthur2003    Jun 14, 2009.
Sun Jun 14 2009, 08:52 PM
#1
you can give it a try
#include "uart.h"
#include "uart.c"

void delay_rony(unsigned int delay_val)
{	
	int temp = 0;
	do
		{
			temp++;
		}
		while(temp<=delay_val);
}

void main(void)
{
	//int i;
	unsigned char usr1, usr2, usr3, usr4, usr5, pass1, pass2, pass3, pass4, pass5;
	while(1)
	{
	uart_init();
start:
	uart_string("******************************\n\r");
	uart_string("  8051 AUTHENTICATION SYSTEM  \n\r");
	uart_string("******************************\n\r\n\r");
	delay_rony(50000);
	uart_string("Username: ");
	usr1 = uart_receive();
	uart_send(usr1);
	usr2 = uart_receive();
	uart_send(usr2);
	usr3 = uart_receive();
	uart_send(usr3);
	usr4 = uart_receive();
	uart_send(usr4);
	usr5 = uart_receive();
	uart_send(usr5);
		if(uart_receive() == 0x0d)
			{
				if(usr1==0x61&&usr2==0x64&&usr3==0x6d&&usr4==0x69&&usr5==0x6e)
				{
				uart_string("\n\r");
				goto passwd;
				}
				else
				{
				uart_string("\n\r\n\rInvalid User!!!\n\r");
				goto start;
				}
			}
		else
			{
				uart_string("\n\r\n\rYOU HAVE EXCEEDED MAX NUMBER OF CHARS. \n\r");
			}
		}
passwd:
	uart_string("\n\rPassword: ");
	pass1 = uart_receive();
	uart_string("*");
	pass2 = uart_receive();
	uart_string("*");
	pass3 = uart_receive();
	uart_string("*");
	pass4 = uart_receive();
	uart_string("*");
	pass5 = uart_receive();
	uart_string("*");
		if(uart_receive() == 0x0d)
			{
				if(pass1==0x61&&pass2==0x64&&pass3==0x6d&&pass4==0x69&&pass5==0x6e)
				{
				uart_string("\n\r\n\rACCESS GRANTED\n\r");
				}
				else
				{
				uart_string("\n\r\n\rInvalid Password!!!\n\r");
				goto start;
				}
			}
		else
			{
				uart_string("\n\r\n\rYOU HAVE EXCEEDED MAX NUMBER OF CHARS. \n\r");
			}
		uart_receive();

}
Tags 8051 uart based authentication systemuart access system
Sun Jun 14 2009, 10:49 PM
#2
Hello rearthur2003

Thanks for the post.
Could you explain a bit more about how your program is used ?.
Mon Jun 15 2009, 01:26 AM
#3
This works with serial port on baud rate 4800 once connected to you will need to authenticate yourself before doing anything, it can be added to uart based code. username is admin and password is admin. hope you like it.
Tue Jun 16 2009, 02:19 PM
#4
good work
Why dont you make an application using this code, will be a good project and can help others too
 rearthur2003 like this.
Tue Jun 16 2009, 05:15 PM
#5
i am working on it, i am working on something to control doors lights in the home so i can do everything from my pc so i dont get interrupted. anyways thanks for the comment

Get Social

Information

Powered by e107 Forum System

Conversation

Sun Apr 11 2021, 02:48 PM
Harmancwt
only
Fri Apr 09 2021, 02:02 PM
Hong
Quality articles is the secret to interest the users to visit the site, that's what this web page is providing. christian dating sites https://datingsitesww.com
Fri Apr 09 2021, 03:53 AM
QGWIJ38V49HEBD3WXF www.web.de
I have a small question for you
Thu Apr 08 2021, 06:26 PM
Lilly
Post writing is also a fun, if you be familiar with afterward you can write otherwise it is complex to write. dating sim https://onlinedatingtind.com/
Thu Apr 08 2021, 12:35 PM
Fredericka Horn
Thanks, Fredericka Horn

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 133, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123