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  [ 4 posts ] 
Author Message
 Post subject: related to write and read data into port
PostPosted: Tue Nov 29, 2011 3:36 pm 
Offline

Joined: Tue Nov 29, 2011 7:56 am
Posts: 10
Hi!
i have problem in writing and reading data on port E in at91sam9g45.
Data is not writing properly on port by following function.
at91_sys_write(AT91_PIOE, data);

Data is not properly reading from port pin by following function.
data = at91_sys_read(AT91_PIOE);

what is the function to read data from the port's latch?

are there any problem in any of the function please reply thanks in advance.


Top
 Profile  
 
 Post subject: Re: related to write and read data into port
PostPosted: Tue Nov 29, 2011 10:14 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
In what context? driver/kernel/user/uboot ?

Have you enabled the PMC clock for bank GPIOE ?

Can you access it from code running in AT91BootStrap, or from the console in uBoot?


Top
 Profile  
 
 Post subject: Re: related to write and read data into port
PostPosted: Wed Nov 30, 2011 2:57 pm 
Offline

Joined: Tue Nov 29, 2011 7:56 am
Posts: 10
yes, if i access using physical address of port and then using ioremap convert into virtual address and directly write or read port.

virtualAddr = ioremap(physicalAddr);
*virtualAddr = data;

above case is working in driver but in uboot i am not able to find file to include for ioremap function for at91sam9g45. if you have any idea which file to include for ioremap then please reply.


Top
 Profile  
 
 Post subject: Re: related to write and read data into port
PostPosted: Wed Nov 30, 2011 6:10 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
>>but in uboot i am not able to find file to include for ioremap function for at91sam9g45. if you have any idea which file to include for ioremap then please reply.

uBoot does not initialize the MMU, you do not have virtual memory until the kernel starts.

The registers will appear at their physical addresses as described in the manuals/documentation.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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: