Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

ARM7(LPC2148TDMI) port pin progrmming bug

Status
Not open for further replies.

bikas.bikun

Junior Member level 3
Joined
Nov 22, 2010
Messages
25
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
pune
Activity points
1,443
i have done the following program to toggle port0 in Keil4 evaluation version but i observe pins P0.28,P0.29,P0.30 are not blinking. could any body tell me why so ?

here is my program :

#include <LPC214x.H>

void delay(unsigned int a)
{
int i;
for (i=0;i<a;i++)
{;;}
}
int main(void)
{
PINSEL0=0x00000000;
IODIR0 = 0x8fffffff;
while(1)
{
IOSET0 = 0x8fffffff;
delay(1000);
IOCLR0 = 0x8fffffff;
delay(1000);
}
}
 

ckshivaram

Advanced Member level 5
Joined
Apr 21, 2008
Messages
5,070
Helped
2,146
Reputation
4,298
Reaction score
2,087
Trophy points
1,393
Location
villingen (Germany) / Bangalore
Activity points
30,097
Does it run on Keil's simulator?

---------- Post added at 16:17 ---------- Previous post was at 16:16 ----------

if you use 12Mhz crystal then the delay is absolutely negligible

make delay as 50000 or something like that.. and declare it properly with proper datatype...
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,020
Reputation
4,156
Reaction score
2,031
Trophy points
1,393
Location
Greece
Activity points
64,377
Yes your code is fine it is just executing too fast for you to see it, use a delay of 1000000 (about 130ms delay @60MHz) to be able to see the toggle.

Alex
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top