Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

LPC 2138 pin togling problem

Status
Not open for further replies.

pratheeshprm143

Newbie level 6
Joined
Oct 14, 2010
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,440
LPC 2138 pin toggling problem

hai
I have a development board of LPC2138 (from rhydolabz)
All the programs with the kit are perfectly working in it, but when I try to load my program for pin toggling it will not work.

Here is my program




#include<lpc21xx.h>
long int i;
int main(void)
{
PINSEL0=0X00000000;
PINSEL1=0X00000000;

IO0DIR=0XFFFFFFFF;
IO1DIR=0XFFFFFFFF;
while(1)
{
IO0SET=0XFFFFFFFF;
IO1SET=0XFFFFFFFF;
for(i=10000;i>0;i--)
{
IO0CLR=0XFFFFFFFF;
IO1CLR=0XFFFFFFFF;
}
for(i=10000;i>0;i--)
{
IO0SET=0XFFFFFFFF;
IO1SET=0XFFFFFFFF;
}
}
}


I am using flash magic to load the program.
I think it is the delay problem.
plz help me.................................
 

Have you tried to use a longer delay, for example for(i=1000000;i>0;i--)
 

hai

thanks for your replay

my current problem is that, my board only works when i am editing the source file given by Rhydolabz.
When I copy the same program for my new project, it will not work in the board and the same is work in proteus.
This is the source file
I cannot understand the problem.
I doubt about the configuration bits in keil.(I am using keil mdk400 supplied by rhydolabz)

thanks
 

Attachments

  • LED.zip
    78.6 KB · Views: 70

I think there might be come problems coming from compilation configuration etc. Maybe you are compiling program in debug mode or something? Look at ready and workibng examples which you've got and compare compilation configuration files with Keil defaults. Maybe target device type is set inapropriately or something like that?
 

Thanks for your replay..
The vendor says that it is better to use default config. settings in keil and I have followed it.
But the hex file that have developed by the vender having a size of 3K and my code is in 2K only(same program of the vendor but new project).
These are the projects. Both the programs are working in proteus but the vendor's program only works on board. Can you please help me if any configuration differences there.

Thanks
 

Attachments

  • projects.zip
    185.6 KB · Views: 71

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top