Reply by Santos Kumar Das●December 19, 20082008-12-19
Dear All,
I'm having problem to use "fast" GPIO on my LPC2103. I need to set GPIO
pin
P0.8 and P0.9 to high and low, but couldn't make it.
Following are several ways, which I tried but can't see the high or low
at
the pins.
1.
PINSEL0 = (PINSEL0 && 0xFFFFFEFF) || 0x00000100;
FIODIR = (FIODIR && 0xFFFFFEFF) || 0x00000100;
FIOCLR = (FIOCLR && 0xFFFFFEFF) || 0x00000100;
FIOSET = (FIOSET && 0xFFFFFEFF) || 0x00000100;
FIOCLR = (FIOCLR && 0xFFFFFEFF) || 0x00000100;
2.
IODIR = 0x00000100 ;//pin P0.7 configured as output
IOCLR = 0x00000100 ;//P0.7 goes LOW
IOSET = 0x00000100 ;//P0.7 goes HIGH
IOCLR = 0x00000100 ;//P0.7 goes LOW
3.
IODIR |= (1<<8) ;//pin P0.8 configured as output
delay_10us(3);
IOPIN |= (1<<8) ;
delay_10us(3);
IOSET |= (1<<8) ;//P0.8 goes HIGH
delay_10us(3);
IOCLR |= 0x00000100 ;//P0.8 goes LOW
delay_10us(3);
IOSET |= (1<<8) ;//P0.8 goes HIGH
delay_10us(3);
IOCLR |= (1<<8) ;//P0.8 goes LOW
3.
FIOMASK |= (unsigned char)(1<<8);
FIODIR |= (unsigned char)(1<<8);
FIOSET = (unsigned char)(1<<8);
delay_10us(100);
FIOCLR = (unsigned char)(1<<8);
delay_10us(100);
FIOSET = (unsigned char)(1<<8);
delay_10us(100);
FIOCLR = (unsigned char)(1<<8);
delay_10us(100);
4.
FIOMASK0 |= (unsigned char)0x00000100;
FIODIR0 |= (unsigned char)0x00000100;
FIOSET0 = (unsigned char)0x00000100;
delay_10us(100);
FIOCLR0 = (unsigned char)0x00000100;
delay_10us(100);
FIOSET0 = (unsigned char)0x00000100;
delay_10us(100);
FIOCLR0 = (unsigned char)0x00000100;
delay_10us(100);
5.
FIODIR0 = (unsigned char)0x00000100));
PINSEL0 = (unsigned char)0x00000100));
No. 5 is seems to be woking, but the pin can't make it to be off.
I'm not able to find the problem.
Could anybody please help me out for any other solution?
Thank you.
Santos
s...@actatek.com
Best Regards,
Santos Kumar Das (s...@actatek.com)
Software Engineer
skype: santos-hectrix
ACTAtek Pte Ltd/ Hectrix Ltd
18, Boon Lay Way, #09 - 96/97/98
TradeHub 21, Singapore 609964
Tel: (65) 65154520
HP: 91165950
Fax: (65) 65154521
Skype: hectrix-santos
E-mail: s...@actatek.com
Website: www.hectrix.com
Secure Access Control/Time Attendance & Advertising/Information Systems
New Company Achievement Award:
August 5, 2008 - ACTAtek Pte Ltd is pleased to know that Network Products
Guide a Silicon Valley Communications publication and a world leading
publication on technologies and solutions has named ACTAtek2, a winner of
the 2008 Best Products and Services Award (Best in Integrated Security
Appliance)