free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems
hello, i have designed a lpc2138 board and able to porgram it using philips flash utility.But the program is not running. iam using keil comiler and 12 mhz crsystal.or should i use vpbdiv and pll register for correct operating frequency.
void delay (void) { /* Delay function */ unsigned long cnt; unsigned long val=10000000;
for (cnt = 0; cnt < val; cnt++); /* Delay */ } int main(void) {
IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */ while(1) { IOSET1 = 0x00ff0000; /* Turn on LED */ delay(); /* Delay */ IOCLR1 = 0x00FF0000; /* Turn off LEDs */ } }
did you use an assembly file like boot.s to map the processor memory and/or a linker script ? --------------------------------------------------------------------------------- -------------------------------------------------- ------------------------ Exchanging knowledge makes it possible to keep wonderful this world.
i am using startup.s in the keil environment and one more strange thing i noticed is that even when i power off the board, opan a serial port press any character i can see echo of junk characters on serial port,db9 connector it showing me pin 3 and 4 shorted.
and did you do the configuration of startup.s file? selecting right multiplier and divider for your controller?
PLL setup is must for every ARM, to make its peripheral functional. www.rickeyworld.info If you feel satisfied with the user's forum reply please click on the thank button.
you should configure the pll in the code itself rather than rely on the startup.s
try the following init sequence
CODE:
// --- enable and connect the PLL (Phase Locked Loop) --- // a. set multiplier and divider
PLL0CFG = MSEL |(0<<PSEL1)|(1<<PSEL0); // b. enable PLL
PLL0CON =(1<<PLLE); // c. feed sequence
PLL0FEED = PLL_FEED1;
PLL0FEED = PLL_FEED2; // d. wait for PLL lock (PLOCK bit is set if locked) while(!(PLL0STAT &(1<<PLOCK))); // e. connect (and enable) PLL
PLL0CON =(1<<PLLE)|(1<<PLLC); // f. feed sequence
PLL0FEED = PLL_FEED1;
PLL0FEED = PLL_FEED2;
// --- setup and enable the MAM (Memory Accelerator Module) --- // a. start change by turning of the MAM (redundant)
MAMCR =0x02; // b. set MAM-Fetch cycle to 3 cclk as recommended for >40MHz
MAMTIM = MAM_FETCH; // c. enable MAM
MAMCR = MAM_MODE;
// --- set VPB speed ---
VPBDIV = VPBDIV_VAL;
lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
hello, thank for ur reply, i solved the problem by using ur code but a new problem has arrived for me, i am unable to reset the controller porperly , every tiime i have to switch off ad switch on the supply to work it properly. and because of that i thought it program was not running and also if i dump through philips flash utility ,code is getting dumped but file compare is geting failed.
8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems