UART problem

This forum is used for discussing hardware, software, and technical details of the AVRcam embedded system.

UART problem

Postby arvind » 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:
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...
arvind
 
Posts: 14
Joined: Mon Jul 25, 2005 8:14 am

Return to AVRcam Embedded System

Who is online

Users browsing this forum: No registered users and 16 guests

cron