UART problem
Posted: Wed Mar 29, 2006 11:58 am
I tried sending data to the hyper terminal from micro.Am using peter fleury's uart library.The micro is atmega8535 running at 8Mhz.This is the code:
This is working only upto a baudrate of 38400. Beyond this baud rate, instead of "ok" some other junk data is getting displayed. Am following the schematic given in this website except that am using mega8535 instead at908515.
http://homepage.hispeed.ch/peterfleury/avr-uart.html
Please help me out..am new to avr...
- Code: Select all
#include <stdlib.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
#include <avr/pgmspace.h>
#include <string.h>
#include <inttypes.h>
#include "uart.h"
#ifndef F_CPU
#define F_CPU 8000000UL
#endif
#define UART_BAUD_RATE 115200
int main(void)
{
uart_init( UART_BAUD_SELECT(UART_BAUD_RATE,F_CPU) );
sei();
uart_puts("ok");
for(;;)
{
}
}
This is working only upto a baudrate of 38400. Beyond this baud rate, instead of "ok" some other junk data is getting displayed. Am following the schematic given in this website except that am using mega8535 instead at908515.
http://homepage.hispeed.ch/peterfleury/avr-uart.html
Please help me out..am new to avr...