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

 
8051 microcontroller 8051 microcontroller
Forums

Rickey's World :: Discussion Forums :: Discuss and Learn :: ARM Development
 
<< Previous thread | Next thread >>
arm code not executing
Go to page       >>  
Moderators: Ajay Bhargav, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph, ExperimenterUK, DavesGarage
Author Post
siri
Mon Jun 22 2009, 01:12AM
 User Offline
Registered Member #11938
Joined: Wed Nov 05 2008, 01:18AM

Posts: 24
Thanked 0 times in 0 posts
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 */
}
}

Back to top

Vito.dsk
Mon Jun 22 2009, 02:44AM

 User Offline
Registered Member #18520
Joined: Thu May 14 2009, 03:44AM

Posts: 23
Thanked 0 times in 0 posts
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.
Back to top

siri
Mon Jun 22 2009, 02:53AM
 User Offline
Registered Member #11938
Joined: Wed Nov 05 2008, 01:18AM

Posts: 24
Thanked 0 times in 0 posts
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.
Back to top

Ajay Bhargav
Mon Jun 22 2009, 03:29PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 7567
Thanked 1331 times in 1255 posts
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.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top

siri
Tue Jun 23 2009, 01:06AM
 User Offline
Registered Member #11938
Joined: Wed Nov 05 2008, 01:18AM

Posts: 24
Thanked 0 times in 0 posts
how to configure startup.s file for a proper operation
Back to top

shyam
Tue Jun 23 2009, 11:04PM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 847
Thanked 136 times in 125 posts
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........
Back to top

siri
Wed Jun 24 2009, 01:27AM
 User Offline
Registered Member #11938
Joined: Wed Nov 05 2008, 01:18AM

Posts: 24
Thanked 0 times in 0 posts
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.
Back to top

shyam
Wed Jun 24 2009, 03:26AM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 847
Thanked 136 times in 125 posts
do you have regulators on ur dev board? or using seperate power supply?


lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top

siri
Wed Jun 24 2009, 04:01AM
 User Offline
Registered Member #11938
Joined: Wed Nov 05 2008, 01:18AM

Posts: 24
Thanked 0 times in 0 posts
i am using ld111s33 regualtor,and how can i upload a schematic in this forum
Back to top

shyam
Wed Jun 24 2009, 08:53PM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 847
Thanked 136 times in 125 posts
use some file sharing site like rapidshare /imageshack etc.. upload the images there and post the link here.


lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top

Go to page       >>   

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

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