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  [ 3 posts ] 
Author Message
 Post subject: Sample code for initialization of USART with PDC in SAM9260?
PostPosted: Mon Nov 07, 2011 12:37 pm 
Offline

Joined: Sat Sep 24, 2011 11:33 pm
Posts: 13
Hi,

I'm writing my own optimized driver for USART in AT91SAM9260, working with PDC.
The problem I've faced is that after my initialization procedure (based on atmel_serial.c code from Linux) the USART+PDC does not generate interrupts, even though the external clock is connected to SCK2 and data stream is transmitted to RXD2.
It seems, that my initialization code (posted to viewtopic.php/f,12/t,20486/ ) does not turn on something essential...
Where can I find any sample code showing how to initialize USART (I need only the receiver part) together with PDC?
--
TIA & Regards,
Wojtek


Top
 Profile  
 
 Post subject: Re: Sample code for initialization of USART with PDC in SAM9260?
PostPosted: Mon Nov 07, 2011 4:51 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Try doing it outside of Linux first.

Try doing it as a simple loop-back. You could do this on both the 9260 and PC/realterm, and confirm either is functioning as you expect.

The AT91SAM9M10-EK software release has a package for a synchronous serial port.

The slave configuration (ie taking clock as an input) is :

if(!isMaster){
mode = AT91C_US_USMODE_NORMAL | AT91C_US_CLKS_CLOCK
| AT91C_US_CHMODE_NORMAL
| AT91C_US_SYNC|AT91C_US_MSBF
| AT91C_US_CHRL_8_BITS | AT91C_US_NBSTOP_1_BIT| AT91C_US_PAR_EVEN;
}

Adjust the parity as appropriate


Top
 Profile  
 
 Post subject: Re: Sample code for initialization of USART with PDC in SAM9260?
PostPosted: Mon Nov 07, 2011 10:00 pm 
Offline

Joined: Sat Sep 24, 2011 11:33 pm
Posts: 13
Unfortunately I can work with this board only from Linux.

However I've found the source of the problem:

I have to call:
clk_enable(clk_get(NULL,"usart2_clk"));

to get USART2 working.
--
Thanks & Regards,
Wojtek


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 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: