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: Help the simplest problem!!I can't drive the LED,why??
PostPosted: Fri Jul 29, 2011 2:53 am 
Offline

Joined: Fri May 06, 2011 4:07 am
Posts: 17
I want to use AT91SAM9M10 to control 2 LEDS connected to PB[5:4],but I don't know how to config those resgisters.I tried the programe as lists,which assumed that it has already included all the head files,but failed.Could you help me ?If you know the result,please write to
armboy@sohu.com,and if you need the AT91SAM9M10 handbook ,also plaese write to me,I would like to send a copy to you.
Thank you for your attention.

void main()
{
unsigned int number = 20;

while(PIO_PSR & (3 << 4) != (3 << 4))
{
PIO_PER = 3 << 4;
PIO_PDR = ~(3 << 4);
}

PIO_PUER = 3 << 4;

while(PIO_OSR != (3 << 4))
{
PIO_OER = 3 << 4;
PIO_ODR = ~(3 << 4);
}

while(PIO_OSR != (3 << 4))
{
PIO_OER = 3 << 4;
PIO_ODR = ~(3 << 4);
}
while(1)
{
PIO_ODSR = 0;
while(number--);
PIO_ODSR = 0xff;
while(number++ < 20);
}
}


Top
 Profile  
 
 Post subject: Re: Help the simplest problem!!I can't drive the LED,why??
PostPosted: Fri Jul 29, 2011 2:31 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Directly on the 9M10 or running under Linux?

You need to enable PIOB clocks in the PMC, and configure the PIO output settings/mux, before toggling/setting the PIOs to the LEDs.

Isn't all the documentation directly downloadable?
http://www.atmel.com/dyn/resources/prod ... /6355s.pdf
http://www.atmel.com/dyn/resources/prod ... oc6355.pdf


Top
 Profile  
 
 Post subject: Re: Help the simplest problem!!I can't drive the LED,why??
PostPosted: Sat Jul 30, 2011 2:17 am 
Offline

Joined: Fri May 06, 2011 4:07 am
Posts: 17
[quote="CptTitanic"]Directly on the 9M10 or running under Linux?

You need to enable PIOB clocks in the PMC, and configure the PIO output settings/mux, before toggling/setting the PIOs to the LEDs.

Isn't all the documentation directly downloadable?
http://www.atmel.com/dyn/resources/prod ... /6355s.pdf
http://www.atmel.com/dyn/resources/prod ... oc6355.pdf[/quote]

If I in linux,how to config PIOB?please tell me the needed head files and program.I'm working with AT91SAM9M10-G45-EK board,which running LINUX 2.6.30.


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: Google [Bot] and 8 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: