Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] AVR WiFi-UART Module interfacing

Status
Not open for further replies.

tahertinu

Member level 4
Joined
Jun 11, 2011
Messages
74
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Ahmedabad
Activity points
1,752
Good afternoon to all my dear friends.
Here i want to share my problem with you.
I am working on a WiFi server project on ATmega16 controller. I have purchased this WiFi-UART module
I have tested the sample server on Arduino board as per the given test file.
now i want to convert the same Arduino code to ATmega16 avr studio. I have wrote the same code in AVRStudio. but unfortunately it is not working.
here is the datasheet of module.
here is my AVR Studio code:

Code:
int main()
{   	
	//Varriable Declaration
    
    char ch;
	unsigned int currentLineIsBlank=1;
   	/*First Initialize the USART with baud rate = 19200bps*/
	uart_init();
	while(1)
	{
		ch=USARTReadChar();
		if(ch=='\n'&&currentLineIsBlank)
		{
			USART_putstring("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<center><h1>Hello World!! I am Taher Kawantwala</h1></center>");
			USARTWriteChar(0x0D);
			break;
		}
		if(ch=='\n')
		{
			currentLineIsBlank=1;
		}
		else if(ch=='\r')
		{
			currentLineIsBlank=0;
		}
	}
}
Please If anybody has worked on such project and same module do help me.
 

I have done the code and its working!!
here is image
Good afternoon to all my dear friends.
Here i want to share my problem with you.
I am working on a WiFi server project on ATmega16 controller. I have purchased this WiFi-UART module
I have tested the sample server on Arduino board as per the given test file.
now i want to convert the same Arduino code to ATmega16 avr studio. I have wrote the same code in AVRStudio. but unfortunately it is not working.
here is the datasheet of module.
here is my AVR Studio code:

Code:
int main()
{   	
	//Varriable Declaration
    
    char ch;
	unsigned int currentLineIsBlank=1;
   	/*First Initialize the USART with baud rate = 19200bps*/
	uart_init();
	while(1)
	{
		ch=USARTReadChar();
		if(ch=='\n'&&currentLineIsBlank)
		{
			USART_putstring("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<center><h1>Hello World!! I am Taher Kawantwala</h1></center>");
			USARTWriteChar(0x0D);
			break;
		}
		if(ch=='\n')
		{
			currentLineIsBlank=1;
		}
		else if(ch=='\r')
		{
			currentLineIsBlank=0;
		}
	}
}
Please If anybody has worked on such project and same module do help me.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top