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  [ 9 posts ] 
Author Message
 Post subject: PIO configuration on AT91SAM7L
PostPosted: Thu Jan 06, 2011 5:56 pm 
Offline

Joined: Wed Jan 05, 2011 10:10 am
Posts: 11
Hi,
with an AT91SAM7L, I use PIOA, PIOB and PIOC.
I can configure and set/clear pins of PIOC and I have action on electrical lines.
I also configure and set/clear pins of PIOA and PIOB but I have no action on electrical lines !!
my code :
int main(void)
{
const Pin pins[] = {
{1 << 8, AT91C_BASE_PIOA, AT91C_ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT},
{1 << 0, AT91C_BASE_PIOC, AT91C_ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT}
};
// Configure pins
PIO_Configure( pins, PIO_LISTSIZE(pins) );
// pins ouput
AT91C_BASE_PIOA->PIO_OWER = AT91C_PIO_PA8;
AT91C_BASE_PIOC->PIO_OWER = AT91C_PIO_PC0;
// PIN_DBGU_ENcfg à 0
AT91C_BASE_PIOA->PIO_ODSR ^= AT91C_PIO_PA8; // nothing
AT91C_BASE_PIOC->PIO_ODSR ^= AT91C_PIO_PC0; // ok
...
Have I forgotten something ?
Please have an idea ;)


Top
 Profile  
 
 Post subject: Re: PIO configuration on AT91SAM7L
PostPosted: Thu Jan 06, 2011 6:20 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
>>Have I forgotten something ? Please have an idea ;)

The peripheral clocks, or the pin power supplies?


Top
 Profile  
 
 Post subject: Re: PIO configuration on AT91SAM7L
PostPosted: Thu Jan 06, 2011 6:47 pm 
Offline

Joined: Wed Jan 05, 2011 10:10 am
Posts: 11
I tried to begin with
PMC_EnablePeripheral( AT91C_ID_PIOA );
PMC_EnablePeripheral( AT91C_ID_PIOC );
without success.
What do you mean with "pin power supplies" ? there is no controler to modify pin power ?


Top
 Profile  
 
 Post subject: Re: PIO configuration on AT91SAM7L
PostPosted: Thu Jan 06, 2011 7:12 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Assume I know nothing about your board or how you have it wired, beyond what you have described in your post.

VDDIO1 Powers PIOC
VDDIO2 Powers PIOA and PIOB


Top
 Profile  
 
 Post subject: Re: PIO configuration on AT91SAM7L
PostPosted: Fri Jan 07, 2011 9:58 am 
Offline

Joined: Wed Jan 05, 2011 10:10 am
Posts: 11
I don't use LCD, so Charge Pump and LCD Regulator are not used. My hardware correspond to figure 5-5 of AT91SAM7L128 datasheet
VDDIO1 and VDDIO2 are tied together to 3.0 V
VDDOUT and VDDCORE are tied together
VDDLCD to 3.0 V, VDDINLCD to GND
TST is tied to GND
ERASE to GND and can be pull up to 3.0 V by strap
FWUP to GND
CLKIN to GND
JTAGSEL to GND
NRST to JTAG-RESET
TDI, TDO to JTAG


Top
 Profile  
 
 Post subject: Re: PIO configuration on AT91SAM7L
PostPosted: Fri Jan 07, 2011 2:50 pm 
Offline

Joined: Tue Feb 08, 2005 1:56 pm
Posts: 48
Hi,

You need to set LCDMODE to 2 (SUPC_MR) in your case in order to use PIOA and PIOB.

Regards,
bdenis


Top
 Profile  
 
 Post subject: Re: PIO configuration on AT91SAM7L
PostPosted: Fri Jan 07, 2011 3:15 pm 
Offline

Joined: Wed Jan 05, 2011 10:10 am
Posts: 11
I already try this at the beginning of main() before PIO_Configure :
AT91C_BASE_SUPC->SUPC_MR = ((0xa5 << 24) & AT91C_SUPC_MKEY) | AT91C_SUPC_LCDMODE_EXTERNAL;
but the program no longer runs !!!


Top
 Profile  
 
 Post subject: Re: PIO configuration on AT91SAM7L
PostPosted: Fri Jan 07, 2011 5:17 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
This might be less invasive

AT91C_BASE_SUPC->SUPC_MR = (AT91C_BASE_SUPC->SUPC_MR & ~(AT91C_SUPC_MKEY | AT91C_SUPC_LCDMODE)) | (0xA5 << 24) | AT91C_SUPC_LCDMODE_EXTERNAL;

or

SUPC_EnableSlcd(AT91C_SUPC_LCDMODE_EXTERNAL);


Top
 Profile  
 
 Post subject: Re: PIO configuration on AT91SAM7L
PostPosted: Mon Jan 10, 2011 12:31 pm 
Offline

Joined: Wed Jan 05, 2011 10:10 am
Posts: 11
ok, everything works fine now :)
thank you CptTitanic


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

All times are UTC + 1 hour [ DST ]


Who is online

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