Sunday, 20 May 2012
 
 
A+ | A- | Reset
Forums Microcontrollers AVR Upload: Interrupt-based UART serial coms (0 viewing) 
Go to bottom Post Reply
TOPIC: Upload: Interrupt-based UART serial coms
#72
spamiam
Posts: 33
graphgraph
User Offline
Upload: Interrupt-based UART serial coms 4 Years, 6 Months ago  
File Attachment:
File Name: OM128_uart.zip
File Size: 10996
Here is a sample program and the support material for interrupt controlled serial USART function.

It uses a circular buffer for both RX and TX. The user can define the buffer size.

It uses interrupts instead of the polled method. This allows the serial communication to occur in the background unless you have run out of buffer space on the transmitter, in which case it will wait until the buffer has space.

The modules were obtailed from various on-line sources and have their author's credits.

I made some mods to the uart2.c subroutines, and it now supports program memory-based strings.

Some of them use rather old syntax, so some support header files are needed to make new compilers happy. This was compiled under WinAVR 2006-0125. GCC version 3.4.5

-Tony
 
Last Edit: 2007/11/14 15:18 By spamiam.
  The administrator has disabled public write access.
#75
Mike
Posts: 82
graph
User Online Now
Re:Upload: Interrupt-based UART serial coms 4 Years, 6 Months ago  
Tony,

I moved this append out of the om128 support forum as the content is of general use to anyone using AVRs.

I think it would be useful to also include a Studio generated Makefile. Some comments in the file header and around the routines will help denote the additional code you wrote.
  The administrator has disabled public write access.
#77
spamiam
Posts: 33
graphgraph
User Offline
Re:Upload: Interrupt-based UART serial coms 4 Years, 6 Months ago  
Good idea re: moving the post.

I will re-work the files to show what I added. I added only a little, and in interest of size, I commented-out some things. I am going to learn how to make a library, and how to include the library so that only the functions that are actually called will be used in the final assembled code.

I can include the studio-generated makefile too. Since I use Studio and do NOT use other compiling/making methods, I forget that the makefile would be nice to have!

-Tony
  The administrator has disabled public write access.
Go to top Post Reply
All Content Copyright 2005-2011 Oak Micros. All Rights Reserved. See Terms and Conditions.
Powered by Joomla and osCommerce.