EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Reg:AT91SAM9263 UART RECeiver and transmitter

Started by "just.rish" November 10, 2010
I have to operate UART receiver such that the program not waits to read the uart but when RX_ready signal turns high it should genrate an interrupt which calls a subroutine and exits the normal sequence of the program receives receives the character and then exits the subroutine the executes the program normally
Please reply if anybody could help.....

You should be able to create an isr handler to take care of this, on
interrupt have the isr read the character and then acknowledge or reset the
interrupt so that you can go back to what you were doing before the
interrupt was triggered.

_____

From: A... [mailto:A...] On Behalf Of
just.rish
Sent: Wednesday, November 10, 2010 8:55 AM
To: A...
Subject: [AT91SAM] Reg:AT91SAM9263 UART RECeiver and transmitter

I have to operate UART receiver such that the program not waits to read the
uart but when RX_ready signal turns high it should genrate an interrupt
which calls a subroutine and exits the normal sequence of the program
receives receives the character and then exits the subroutine the executes
the program normally

Please reply if anybody could help.....
Here's some rough code for the 9261 that I wrote and works for me.
Interface below.

You call initialize, which makes calls to my code (not supplied, but
very similar to BSP) to configure the PMC, AIC, and PIO.

You call set_rx_handler to set a function pointer of type [void
foo(char)] to handle incoming characters. This will be called from an
ISR, so keep it tight.

"sendchar" and "sendchars" self-explanatory.

As an aside, I was pretty frustrated that I couldn't find sample code
that accomplished this (interrupt-based USART on 9261), pretty much had
to work it out myself. There's just not many resources out there, is
there?

*****

#define PORT_USART_0 0
#define PORT_USART_1 1
#define PORT_USART_2 2

enum e_usart_stop_bits
{
USART_STOP_BITS_1,
USART_STOP_BITS_1_POINT_5,
USART_STOP_BITS_2
};

unsigned char USART_initialize(unsigned int port, unsigned int
baud_rate, enum e_usart_stop_bits stop_bits);
unsigned char USART_set_rx_handler(unsigned int port, void( *handler )(
char ));

void USART0_sendchar(const char c);
void USART0_sendchars(const char * data, unsigned int count);
void USART1_sendchar(const char c);
void USART1_sendchars(const char * data, unsigned int count);
void USART2_sendchar(const char c);
void USART2_sendchars(const char * data, unsigned int count);

------------
Chris Rice
MPR Associates, Inc.
www.mpr.com
703-519-0409 (direct)
571-228-3177 (mobile)
------------

-----Original Message-----
From: A... [mailto:A...]
On Behalf Of Kamal
Sent: Wednesday, November 10, 2010 1:04 PM
To: A...
Subject: RE: [AT91SAM] Reg:AT91SAM9263 UART RECeiver and
transmitter

You should be able to create an isr handler to take care of
this, on interrupt have the isr read the character and then acknowledge
or reset the interrupt so that you can go back to what you were doing
before the interrupt was triggered.

________________________________
From: A... [mailto:A...]
On Behalf Of just.rish
Sent: Wednesday, November 10, 2010 8:55 AM
To: A...
Subject: [AT91SAM] Reg:AT91SAM9263 UART RECeiver and transmitter

I have to operate UART receiver such that the program not waits
to read the uart but when RX_ready signal turns high it should genrate
an interrupt which calls a subroutine and exits the normal sequence of
the program receives receives the character and then exits the
subroutine the executes the program normally

Please reply if anybody could help.....
By the way, I was generous with my source code in order to (a) establish a new precedent, elevate the helpfulness of this group (which is low, I don't know why people don't share source or snippets more often), and (b) start a conversation: what resources are out there, so I could hear about new ones or confirm the lack thereof.

If you have just used my source code and disappeared w/o even a thank you and ignoring my attempt at conversation, then (a) that's pretty rude and you won't be getting any more help from me and (b) you've confirmed for me that this group is deader than disco.
--- In A..., "Rice, Christopher" wrote:
>
>
> Here's some rough code for the 9261 that I wrote and works for me.
> Interface below.
>
> You call initialize, which makes calls to my code (not supplied, but
> very similar to BSP) to configure the PMC, AIC, and PIO.
>
> You call set_rx_handler to set a function pointer of type [void
> foo(char)] to handle incoming characters. This will be called from an
> ISR, so keep it tight.
>
> "sendchar" and "sendchars" self-explanatory.
>
> As an aside, I was pretty frustrated that I couldn't find sample code
> that accomplished this (interrupt-based USART on 9261), pretty much had
> to work it out myself. There's just not many resources out there, is
> there?
>
> *****
>
> #define PORT_USART_0 0
> #define PORT_USART_1 1
> #define PORT_USART_2 2
>
> enum e_usart_stop_bits
> {
> USART_STOP_BITS_1,
> USART_STOP_BITS_1_POINT_5,
> USART_STOP_BITS_2
> };
>
> unsigned char USART_initialize(unsigned int port, unsigned int
> baud_rate, enum e_usart_stop_bits stop_bits);
> unsigned char USART_set_rx_handler(unsigned int port, void( *handler )(
> char ));
>
> void USART0_sendchar(const char c);
> void USART0_sendchars(const char * data, unsigned int count);
> void USART1_sendchar(const char c);
> void USART1_sendchars(const char * data, unsigned int count);
> void USART2_sendchar(const char c);
> void USART2_sendchars(const char * data, unsigned int count);
>
> ------------
> Chris Rice
> MPR Associates, Inc.
> www.mpr.com
> 703-519-0409 (direct)
> 571-228-3177 (mobile)
> ------------
>
> -----Original Message-----
> From: A... [mailto:A...]
> On Behalf Of Kamal
> Sent: Wednesday, November 10, 2010 1:04 PM
> To: A...
> Subject: RE: [AT91SAM] Reg:AT91SAM9263 UART RECeiver and
> transmitter
>
>
>
>
>
>
> You should be able to create an isr handler to take care of
> this, on interrupt have the isr read the character and then acknowledge
> or reset the interrupt so that you can go back to what you were doing
> before the interrupt was triggered.
>
>
>
>
> ________________________________
> From: A... [mailto:A...]
> On Behalf Of just.rish
> Sent: Wednesday, November 10, 2010 8:55 AM
> To: A...
> Subject: [AT91SAM] Reg:AT91SAM9263 UART RECeiver and transmitter
>
>
>
>
>
> I have to operate UART receiver such that the program not waits
> to read the uart but when RX_ready signal turns high it should genrate
> an interrupt which calls a subroutine and exits the normal sequence of
> the program receives receives the character and then exits the
> subroutine the executes the program normally
>
> Please reply if anybody could help.....
>

On Fri, Nov 12, 2010 at 1:23 AM, riceman0 wrote:

>
> By the way, I was generous with my source code in order to (a) establish a
> new precedent, elevate the helpfulness of this group (which is low, I don't
> know why people don't share source or snippets more often), and (b) start a
> conversation: what resources are out there, so I could hear about new ones
> or confirm the lack thereof.
>
> If you have just used my source code and disappeared w/o even a thank you
> and ignoring my attempt at conversation, then (a) that's pretty rude and you
> won't be getting any more help from me and (b) you've confirmed for me that
> this group is deader than disco.
>

Disco is dead ???!?!
I am with you on this. On behalf of others and myself thank you.

_____

From: A... [mailto:A...] On Behalf Of
Bogdan Marinescu
Sent: Thursday, November 11, 2010 3:30 PM
To: A...
Subject: Re: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and transmitter

On Fri, Nov 12, 2010 at 1:23 AM, riceman0 wrote:

By the way, I was generous with my source code in order to (a) establish a
new precedent, elevate the helpfulness of this group (which is low, I don't
know why people don't share source or snippets more often), and (b) start a
conversation: what resources are out there, so I could hear about new ones
or confirm the lack thereof.

If you have just used my source code and disappeared w/o even a thank you
and ignoring my attempt at conversation, then (a) that's pretty rude and you
won't be getting any more help from me and (b) you've confirmed for me that
this group is deader than disco.
Disco is dead ???!?!
Hi Terry,

I looked at your company's web site in security products. How do you use the AT91SAM devices? If you are using the 7X part, I would guess you are using the Ethernet interface.

Do you have much interest in the new CM3 parts that are coming out?

Rick
--- In A..., "Terry Densmore" wrote:
>
> I could not agree more, I do not use this group much but I do feel your pain with interaction. The community should engage in more dialog, it can only help things! I can remember working with the SAM7X right as it came out and it was such a bear to get going due to lack of support.
>
> Thanks,
> Terry
>
> ________________________________
>
> From: A... on behalf of Kamal
> Sent: Thu 11/11/2010 6:42 PM
> To: A...
> Subject: RE: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and transmitter
>
>
> I am with you on this. On behalf of others and myself thank you.
>
>
>
> ________________________________
>
> From: A... [mailto:A...] On Behalf Of Bogdan Marinescu
> Sent: Thursday, November 11, 2010 3:30 PM
> To: A...
> Subject: Re: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and transmitter
>
>
>
>
>
>
>
> On Fri, Nov 12, 2010 at 1:23 AM, riceman0 wrote:
>
>
> By the way, I was generous with my source code in order to (a) establish a new precedent, elevate the helpfulness of this group (which is low, I don't know why people don't share source or snippets more often), and (b) start a conversation: what resources are out there, so I could hear about new ones or confirm the lack thereof.
>
> If you have just used my source code and disappeared w/o even a thank you and ignoring my attempt at conversation, then (a) that's pretty rude and you won't be getting any more help from me and (b) you've confirmed for me that this group is deader than disco.
> Disco is dead ???!?!
>

I could not agree more, I do not use this group much but I do feel your pain with interaction. The community should engage in more dialog, it can only help things! I can remember working with the SAM7X right as it came out and it was such a bear to get going due to lack of support.

Thanks,
Terry

________________________________

From: A... on behalf of Kamal
Sent: Thu 11/11/2010 6:42 PM
To: A...
Subject: RE: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and transmitter

I am with you on this. On behalf of others and myself thank you.

________________________________

From: A... [mailto:A...] On Behalf Of Bogdan Marinescu
Sent: Thursday, November 11, 2010 3:30 PM
To: A...
Subject: Re: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and transmitter

On Fri, Nov 12, 2010 at 1:23 AM, riceman0 wrote:

By the way, I was generous with my source code in order to (a) establish a new precedent, elevate the helpfulness of this group (which is low, I don't know why people don't share source or snippets more often), and (b) start a conversation: what resources are out there, so I could hear about new ones or confirm the lack thereof.

If you have just used my source code and disappeared w/o even a thank you and ignoring my attempt at conversation, then (a) that's pretty rude and you won't be getting any more help from me and (b) you've confirmed for me that this group is deader than disco.
Disco is dead ???!?!

It's funny, I chose the 7X because they had both an Ethernet MAC and
128KB RAM. After several years, it's still the only part out there with
that much RAM. None of the Cortex products out there seem to have as
much, so the 7X reigns. I agree, it is hard to support. I've gotten a
lot of hints by reading this group... - Chris
On 11/12/2010 6:59 AM, gnuarm wrote:
>
> Hi Terry,
>
> I looked at your company's web site in security products. How do you
> use the AT91SAM devices? If you are using the 7X part, I would guess
> you are using the Ethernet interface.
>
> Do you have much interest in the new CM3 parts that are coming out?
>
> Rick
>
> --- In A... ,
> "Terry Densmore" wrote:
> >
> > I could not agree more, I do not use this group much but I do feel
> your pain with interaction. The community should engage in more
> dialog, it can only help things! I can remember working with the SAM7X
> right as it came out and it was such a bear to get going due to lack
> of support.
> >
> > Thanks,
> > Terry
> >
> > ________________________________
> >
> > From: A... on
> behalf of Kamal
> > Sent: Thu 11/11/2010 6:42 PM
> > To: A...
> > Subject: RE: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and transmitter
> >
> >
> >
> >
> > I am with you on this. On behalf of others and myself thank you.
> >
> >
> >
> > ________________________________
> >
> > From: A...
> [mailto:A... ] On
> Behalf Of Bogdan Marinescu
> > Sent: Thursday, November 11, 2010 3:30 PM
> > To: A...
> > Subject: Re: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and transmitter
> >
> >
> >
> >
> >
> >
> >
> > On Fri, Nov 12, 2010 at 1:23 AM, riceman0 wrote:
> >
> >
> >
> >
> > By the way, I was generous with my source code in order to (a)
> establish a new precedent, elevate the helpfulness of this group
> (which is low, I don't know why people don't share source or snippets
> more often), and (b) start a conversation: what resources are out
> there, so I could hear about new ones or confirm the lack thereof.
> >
> > If you have just used my source code and disappeared w/o even a
> thank you and ignoring my attempt at conversation, then (a) that's
> pretty rude and you won't be getting any more help from me and (b)
> you've confirmed for me that this group is deader than disco.
> >
> >
> > Disco is dead ???!?!
> >
Hey Rick,

We had moved to the 7X with that intention but we sadly never
implemented it....I haven't put much time into checking out the CM3. We
are looking to move to the 9263 possibly some time next year.

Thanks,

Terry

From: A... [mailto:A...] On Behalf
Of gnuarm
Sent: Friday, November 12, 2010 6:59 AM
To: A...
Subject: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and transmitter

Hi Terry,

I looked at your company's web site in security products. How do you use
the AT91SAM devices? If you are using the 7X part, I would guess you are
using the Ethernet interface.

Do you have much interest in the new CM3 parts that are coming out?

Rick

--- In A... ,
"Terry Densmore" wrote:
>
> I could not agree more, I do not use this group much but I do feel
your pain with interaction. The community should engage in more dialog,
it can only help things! I can remember working with the SAM7X right as
it came out and it was such a bear to get going due to lack of support.
>
> Thanks,
> Terry
>
> ________________________________
>
> From: A... on
behalf of Kamal
> Sent: Thu 11/11/2010 6:42 PM
> To: A...
> Subject: RE: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and
transmitter
> I am with you on this. On behalf of others and myself thank you.
>
> ________________________________
>
> From: A...
[mailto:A... ] On
Behalf Of Bogdan Marinescu
> Sent: Thursday, November 11, 2010 3:30 PM
> To: A...
> Subject: Re: [AT91SAM] Re: Reg:AT91SAM9263 UART RECeiver and
transmitter
>
> On Fri, Nov 12, 2010 at 1:23 AM, riceman0 wrote:
> By the way, I was generous with my source code in order to (a)
establish a new precedent, elevate the helpfulness of this group (which
is low, I don't know why people don't share source or snippets more
often), and (b) start a conversation: what resources are out there, so I
could hear about new ones or confirm the lack thereof.
>
> If you have just used my source code and disappeared w/o even a thank
you and ignoring my attempt at conversation, then (a) that's pretty rude
and you won't be getting any more help from me and (b) you've confirmed
for me that this group is deader than disco.
> Disco is dead ???!?!
>

Memfault Beyond the Launch