Forums

AT91M55800 UART interrupt + pdc, empty buffer

Started by October 3, 2007
I`m using AT91EB55 eval board. My interrupts rutines are based on
functions which simply configure software buffers in order to store(by
PDC) there data from uart. If I put this functions(send_pdc(char
*out_buff, int length) and recieve_pdc(char *in_buff, int length) )
into main function and send and receive some data then it works
propertly but if i use receive function as a part of uart interrupt
routine then I get no data in input buffer. Is it possible that uart
buffer is being cleared after specific time(interrupt latency) or
after some event occured ??

Regards

<dik@go2.pl> wrote in message 
news:1191447648.279728.308920@d55g2000hsg.googlegroups.com...
> > I`m using AT91EB55 eval board. My interrupts rutines are based on > functions which simply configure software buffers in order to store(by > PDC) there data from uart. If I put this functions(send_pdc(char > *out_buff, int length) and recieve_pdc(char *in_buff, int length) ) > into main function and send and receive some data then it works > propertly but if i use receive function as a part of uart interrupt > routine then I get no data in input buffer. Is it possible that uart > buffer is being cleared after specific time(interrupt latency) or > after some event occured ?? > > Regards >
No the uart buffer is not automatically cleared by time. I would expect a problem in your receive function. You might explain "PDC". Is your buffer a global array? Could it be local and being lost by the change in stacks from normal to interrupt mode? -- Scott Validated Software Corp.
On Oct 3, 10:40?pm, d...@go2.pl wrote:
> I`m using AT91EB55 eval board. My interrupts rutines are based on > functions which simply configure software buffers in order to store(by > PDC) there data from uart. If I put this functions(send_pdc(char > *out_buff, int length) and recieve_pdc(char *in_buff, int length) ) > into main function and send and receive some data then it works > propertly but if i use receive function as a part of uart interrupt > routine then I get no data in input buffer. Is it possible that uart > buffer is being cleared after specific time(interrupt latency) or > after some event occured ?? > > Regards
You cant use a recieve function, that you can call, as part of the uart interrupt because that would imply that your program was determining when data arrives which of course it cant, Generally your recive interrupt should store the data somewhere (a buffer), ready the uart/interrupt system for the next byte and return. You can then use a recive function to retrieve the data from the buffer. You should do a similar thing with the transmitter (although this is not so critical) write your transmit data to a buffer and let the transmitter interrupt send it out.