chamanlatapankaj
Newbie level 5
- Joined
- Jul 25, 2015
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 66
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #include<LPC214x.h> // Define LPC2148 Header File #define led IOPIN1 // Define LED to Port1 #define tled IO1DIR // Define Port1 as output void delay(int x); int main() { PINSEL1= 0x00000000; // Define port lines as GPIO tled = 0x00FF0000; // Define P1.16 – P1.23 as O/P led = 0x00000000; // Define P1.16 – P1.23 as zero while(1) // Loop forever { led = 0x00FF0000; // Turn ON P1.16 – P1.23 delay(20000); led = 0x00000000; // Turn OFF P1.16 – P1.23 delay(2000); } } void delay(int x) { unsigned int k,l; for(k = x;k > 0;k--) for(l = 0;l < x;l++); }
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #include<LPC214x.h> // Define LPC2148 Header File #define led IOPIN1 // Define LED to Port1 #define tled IO1DIR // Define Port1 as output void delay(int x); int main() { PINSEL1= 0x00000000; // Define port lines as GPIO tled = 0x00FF0000; // Define P1.16 – P1.23 as O/P led = 0x00000000; // Define P1.16 – P1.23 as zero while(1) // Loop forever { led = 0x00FF0000; // Turn ON P1.16 – P1.23 delay(20000); led = 0x00000000; // Turn OFF P1.16 – P1.23 delay(2000); } } void delay(int x) { unsigned int k,l; for(k = x;k > 0;k--) for(l = 0;l < x;l++); }
#include<LPC214x.h> // Define LPC2148 Header File
#define led IOPIN0 // Define LED to Port1
#define tled IO1DIR // Define Port1 as output
void delay(unsigned int x);
void initialise(void)
{
PLL0CFG &= 0xE0; // Reset MSEL0:4
PLL0CFG |= 0x04; // MSEL(PLL Multiply) = 3
PLL0CFG &= 0x9F; // Reset PSEL0:1
PLL0CFG |= 0x20; // PSEL(PLL Devide) = 2
PLL0CON &= 0xFC; // Reset PLLC,PLLE
PLL0CON |= 0x01; // PLLE = 1 = Enable PLL
PLL0FEED = 0xAA; // Start Update PLL Config
PLL0FEED = 0x55;
while (!(PLL0STAT & 0x00000400)); // Wait PLL Lock bit
PLL0CON |= 0x02; // PLLC = 1 (Connect PLL Clock)
PLL0FEED = 0xAA; // Start Update PLL Config
PLL0FEED = 0x55;
VPBDIV &= 0xFC; // Reset VPBDIV
VPBDIV |= 0x01; // VPB Clock(pclk) = cclk / 1
// End of Initial PLL for Generate Processor Clock
// Start of Initial MAM Function
MAMCR = 0x00; // Disable MAM Function
MAMTIM = 0x03; // MAM Timing = 3 Cycle of cclk
MAMCR = 0x02; // Enable MAM = Full Function
}
int main()
{
PINSEL2 = 0x00000000; // Define port lines as GPIO
tled = 0x00FF0000; // Define P1.16 – P1.23 as O/P
led = 0x00000000; // Define P1.16 – P1.23 as zero
initialise();
while(1) // Loop forever
{
led = 0x00ff0000; // Turn ON P1.16 – P1.23
}
}
void delay(unsigned int x)
{
unsigned int k,l;
for(k = 0;k<x;k++)
{
for(l = 0;l <8002;l++);
}
}
#include<LPC214x.h> // Define LPC2148 Header File
[COLOR="#FF0000"]#define led IOPIN0[/COLOR] // Define LED to Port1
[COLOR="#FF0000"]#define tled IO1DIR[/COLOR] // Define Port1 as output
...
...
int main()
{
PINSEL2 = 0x00000000; // Define port lines as GPIO
tled = 0x00FF0000; // Define P1.16 – P1.23 as O/P
led = 0x00000000; // Define P1.16 – P1.23 as zero
initialise();
while(1) // Loop forever
{
led = 0x00ff0000; // Turn ON P1.16 – P1.23
}
}
#define led IOPIN0 // Define LED to Port1
#define tled IO1DIR // Define Port1 as output
#define led IOPIN0 // Define LED to Port0
#define tled IODIR0 // Define Port0 as output
#include<LPC214x.h> // Define LPC2148 Header File
#define led IOPIN1 // Define LED to Port1
#define tled IO1DIR // Define Port1 as output
void delay(unsigned int x);
void initialise(void)
{
PLL0CFG &= 0xE0; // Reset MSEL0:4
PLL0CFG |= 0x04; // MSEL(PLL Multiply) = 3
PLL0CFG &= 0x9F; // Reset PSEL0:1
PLL0CFG |= 0x20; // PSEL(PLL Devide) = 2
PLL0CON &= 0xFC; // Reset PLLC,PLLE
PLL0CON |= 0x01; // PLLE = 1 = Enable PLL
PLL0FEED = 0xAA; // Start Update PLL Config
PLL0FEED = 0x55;
while (!(PLL0STAT & 0x00000400)); // Wait PLL Lock bit
PLL0CON |= 0x02; // PLLC = 1 (Connect PLL Clock)
PLL0FEED = 0xAA; // Start Update PLL Config
PLL0FEED = 0x55;
VPBDIV &= 0xFC; // Reset VPBDIV
VPBDIV |= 0x01; // VPB Clock(pclk) = cclk / 1
// End of Initial PLL for Generate Processor Clock
// Start of Initial MAM Function
MAMCR = 0x00; // Disable MAM Function
MAMTIM = 0x03; // MAM Timing = 3 Cycle of cclk
MAMCR = 0x02; // Enable MAM = Full Function
}
int main()
{
PINSEL2 = 0x00000000; // Define port lines as GPIO
tled = 0x00FF0000; // Define P1.16 – P1.23 as O/P
led = 0x00000000; // Define P1.16 – P1.23 as zero
initialise();
while(1) // Loop forever
{
led = 0x00ff0000; // Turn ON P1.16 – P1.23
}
}
void delay(unsigned int x)
{
unsigned int k,l;
for(k = 0;k<x;k++)
{
for(l = 0;l <8002;l++);
}
}
yes i am using MDK KEIL ARM.This is the code right now i m testing on kit. i am sending you the images ofmy development board.
View attachment 119699View attachment 119700
this is the link of my development board i found.if this can help then let me know.there is no other detail i found on the internet.
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?