avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Serial communication


From: Niklas Brogden
Subject: Re: [avr-gcc-list] Serial communication
Date: Sat, 31 Jul 2004 19:14:43 +0200

----- Original Message ----- 


> Hello, I have to communicate an AVR Mega8 microcontroller with a Java
program. I
> am not sure about use SPI or USART. The program have to send synchronous
data
> and receive the data asynchronous thought a interrupt handler.
> Please, could someone to explain me the advantages and drawback of use
USART or
> SPI??

An easy method of atmega8-PC communication is by UART with RS-232. Though
you will need a MAX-232 or 202 connected to the RX/TX pins on the Mega8.
Software is easy to find also.
There is a communications package available for java but released
separately(comm.jar from Sun as commapi). The package contains examples of
code etc. Installation instructions are not correctly updated but if the
main files are installed also in the 'lib' directories of your java tree,
they will work very well. Although I only use serial port routines, there
seem to be support for parallel ports also. I've appended a simple interrupt
driven UART driver I've found somewhere and adapted for the ATmega8. It must
be initialised and then the global interrupts must be enabled for it to
work...

Also, the input / output buffer size in the driver should be adjusted to
your needs or a buffer overrun might occur...

\Nik

reply via email to

[Prev in Thread] Current Thread [Next in Thread]