Discussion in "ARM Development" started by    siri    Jun 22, 2009.
Mon Jun 22 2009, 01:42 pm
#1
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 */
}
}
Mon Jun 22 2009, 03:14 pm
#2
did you use an assembly file like boot.s to map the processor memory and/or a linker script ?
Mon Jun 22 2009, 03:23 pm
#3
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.

i am using max232.
Tue Jun 23 2009, 03:59 am
#4
make sure you have connected ground properly...

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.
Tue Jun 23 2009, 01:36 pm
#5
how to configure startup.s file for a proper operation
Wed Jun 24 2009, 11:34 am
#6
you should configure the pll in the code itself rather than rely on the startup.s


try the following init sequence
// --- 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;

Wed Jun 24 2009, 01:57 pm
#7
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.
Wed Jun 24 2009, 03:56 pm
#8
do you have regulators on ur dev board? or using seperate power supply?
Wed Jun 24 2009, 04:31 pm
#9
i am using ld111s33 regualtor,and how can i upload a schematic in this forum
Thu Jun 25 2009, 09:23 am
#10
use some file sharing site like rapidshare /imageshack etc.. upload the images there and post the link here.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Clydehet
Wed May 01 2024, 06:44 pm
Davidoried
Wed May 01 2024, 06:11 pm
KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am