Hi,
Your RX/TX ISR is pretty straight forward (PS : I prsume your PIOA pins are
set
properly for UxTXD ?) :
1. Read US0_CSR/US1_CSR into a local buffer, clears the
INT, let's call it 'status'.
2. Check if 'status' has US_TXRDY set. If set,
getdata from ring TX buffer, and write it to
US0_THR.
If you've sent the last
char, clear bit US_TXRDY in US0_IDR (clear TX Interrupt)
3. Check for errors (I just write US_RSTA to get rid of
them - if there at all)
4. Check if US_RXRDY is set in 'status'.
If so buffer read an RX char from
US0_RHR/US1_RHR to say, 'ch'.
Now can process on
'ch' eg. whether to store or not etc.
5. Manage the wrapping, depth of RX ring buffer like
handshaking etc.
That's it for a function you can call seprately from an ISR.....
B rgds
Kris
> > I am trying to use the AT92SAM7 library to
implement a uputs to > USART0, but I am having a hard time getting the
transmit interrupt > going. All the samples I can find on the
AT91 CD trigger output when > a receive character comes in (I get
interrupts when I receive), but > there is no documentation on how do I
start transmit, and handle hte > interupt until my buffer is
transmitted. > > Am I ment to use hte FRAMING - I can find no
detailed documentation > on the libraty to describe this. > > Any input would be helpful. > > Thanks!> >
> >
>
> > -------- > Yahoo! Groups Links > > a.. To |