Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: SAM7S256 Send Data during USART ISR
PostPosted: Fri Jan 21, 2011 11:44 pm 
Offline

Joined: Wed Aug 18, 2010 11:12 pm
Posts: 21
Hello,
I have a problem with my SAM7S256.
I am using one UART Port to communicate with my Software. It is interrupt controlled.

Now I am trying to send debug information through the other UART Interface.
This is not interrupt controlled.

Inside the ISR I have a state machine, that jumps based on the received bytes. Message format is ESC STX MSG.... CRC CRC ESC ETX.

I send current state and received byte out through the debug interface.
I would expect to receive.

1. IDLE ESC
2. PRE_RUNNING - STX
3. RUNNING - MSG ...
4. RUNNING - ESC
5. ESC_IN_MSG - ETX

But I only receive
IDLE - ETX

The state machine stays at IDLE state all the time.
Without the debugging the state machine jumps through all states.

Looks like the receiver buffers are overwritten faster than the interrupt can check for the content.

Is there any way that I can deal with this? I would guess flow control could fix my problem, but sadly CTS and RTS are not available on my development board.

Regards


Top
 Profile  
 
 Post subject: Re: SAM7S256 Send Data during USART ISR
PostPosted: Sat Jan 22, 2011 2:18 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Buffer the debug telemetry data in a software FIFO rather than sending it directly to the DBGU, and check the empty flag and stuff a byte out on the regular USART ISR. OR you could check/send bytes from the debug FIFO buffer in a foreground loop.

Absent CTS/RTS, you could always implement a software XON/XOFF type protocol for flow control.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: