You can edit the frequency in Flash Magic. What is the crystal frequency used in hardware and Flash magic.
may be your delay is too small for your multimeter to pick up hence so..code not working in real time i checked the port pins with multimeter it shows 2.1v .please help me to rectify the problem ,i am trying for 2 days.
#include <lpc21xx.h>
void delay(void);
int main(void)
{
IO0DIR = 0xFFFFFFFF; // Configure all pins on Port 0 as Output
while(1)
{
IO0SET = 0xFFFFFFFF; // Turn on LEDs
delay();
IO0CLR = 0xFFFFFFFF; // Turn them off
delay();
}
return 0; // normally this wont execute
}
void delay(void)
{
int z,c;
c=0;
for(z=0; z<4000000; z++) // You can edit this as per your needs
{
c++; // something needs to be here else KEIL compiler will remove the for loop!
}
}
i had been through some of the forums on same processor u are using with keil as compiler the header file they had included was:Code:#include <lpc21xx.h>
#include "lpc21xx_keil.h"
void delay(unsigned int );
void main(void)
{
//initialsie here
//set port pins & call delay
delay(9999);
//clear port pins & call delay
delay(9999);
}
void delay(unsigned int y)
{
unsigned int z=0,c=0;
for(;y>0;y--)
{
for(z=0;z<9999;z++)
{
c++;
}
}
}
Code:#include <lpc21xx.h> void delay(void); int main(void) { IO0DIR = 0xFFFFFFFF; // Configure all pins on Port 0 as Output while(1) { IO0SET = 0xFFFFFFFF; // Turn on LEDs delay(); IO0CLR = 0xFFFFFFFF; // Turn them off delay(); } return 0; // normally this wont execute } void delay(void) { int z,c; c=0; for(z=0; z<4000000; z++) // You can edit this as per your needs { c++; // something needs to be here else KEIL compiler will remove the for loop! } }
#include <lpc21xx.h>
void delay(void);
int main(void)
{
IO0DIR = 0xFFFFFFFF; // Configure all pins on Port 0 as Output
while(1)
{
IO0SET = 0xFFFFFFFF; // Turn on LEDs
delay();
IO0CLR = 0xFFFFFFFF; // Turn them off
delay();
}
return 0; // normally this wont execute
}
void delay(void)
{
int z,c;
c=0;
for(z=0; z<4000000; z++) // You can edit this as per your needs
{
for(c=0;c<100;c++);
}
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?