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);
}
}