Guys I just connected my laptop to AVR using TTL , and burned that code on the avr and used putty to send from avr to the pc
after connecting the ttl to the laptop that bluescreen appeared !!!
#include "STD_TYPES_H.h"
#include <avr\io.h>
#include <avr\interrupt.h>
#include <avr\delay.h>
#undef F_CPU
#define F_CPU (u32)8000000
#define USART_BAUDRATE 9600
#define BAUD_PRESCALE (u32)((((F_CPU) / (((u32)USART_BAUDRATE) * (u32)16))))
int main(void)
{
u8 SentByte;
UCSRB = (1 << RXEN) | (1 << TXEN); // Turn on the transmission and reception circuitry
UCSRC = (1 << URSEL) | (1 << UCSZ0) | (1 << UCSZ1); // Use 8-bit character sizes
UBRRH = (BAUD_PRESCALE >> 8); // Load upper 8-bits of the baud rate value into the high byte of the UBRR register
UBRRL = BAUD_PRESCALE; // Load lower 8-bits of the baud rate value into the low byte of the UBRR register
while (1) // Loop forever
{
while ((UCSRA & (1 << UDRE)) == 0)
; // Do nothing until UDR is ready for more data to be written to it
UDR = SentByte; // Echo back the received byte back to the computer
}
}