Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[SOLVED] Working in LPC Xpresso

Status
Not open for further replies.

PRABAKARDEVA

Full Member level 2
Joined
Sep 16, 2013
Messages
127
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Location
Chennai
Activity points
2,167
Hi

I am newbie to work with LPC 1313 Microcontroller.Already I had Worked in 8 bit controllers.
i have written a code to toggle a led.That code was compiled without any errors and hex file also generated.


But thats not working in my board.So i suspect on hex file generation and in my coding..i will post my code.
Is there any procedure for generating hex file.?

Thanks in advance


Code:
#include "LPC13xx.h"
#include <cr_section_macros.h>

/*----------------------------------------------------*/

int main(void) {

	LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 6);	/* Enable clock to the GPIO peripheral */

	LPC_GPIO1->DIR |= (1 << 5);				/* Set pin direction of PIO1_5 as output */


	int i;

    while(1) {								/* Until power is available */

    	LPC_GPIO1->DATA |= (1 << 5);		/* Set the output of PIO1_5 as one */

    	for(i = 0; i < 1000000; i++) {		/* Wait (500ms approx.) */
    	}

    	LPC_GPIO1->DATA &= ~(1 << 5);		/* Set the output of PIO1_5 as zero */

    	for(i = 0; i < 1000000; i++) {		/* Wait (500ms approx.) */
    	}

    }
    return 0 ;
}
/*----------------------------------------------------*/
 

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,528
Helped
540
Reputation
1,078
Reaction score
523
Trophy points
1,393
Activity points
0
To test it will be better if you zip and post the complete LPC Xpresso project files.
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,273
Trophy points
1,413
Location
Southwest, USA
Activity points
62,486
Is this a development board with the LED already incorporated in the design?

If so, do you have a schematic of the board? Or link where it can be downloaded?

If not, what are the specs of the LED and how is it specifically attached to the port pin?

Also, what is the frequency of the external crystal or oscillator?

BigDog
 

PRABAKARDEVA

Full Member level 2
Joined
Sep 16, 2013
Messages
127
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Location
Chennai
Activity points
2,167
yeah..this is a development board which was designed by us.i will upload the snap of the board.It is attached to the Port pin through 2.7k.we are not using any external oscillator.
 

Attachments


bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,273
Trophy points
1,413
Location
Southwest, USA
Activity points
62,486
Typically the LPC1313 can only sink or source 2-3mA per pin and if an internal pullup is active, the VOH drops to about 2.7V.

What are the current requirements and VF of those LEDs?


BigDog
 

PRABAKARDEVA

Full Member level 2
Joined
Sep 16, 2013
Messages
127
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Location
Chennai
Activity points
2,167
vf is 1.7v and 0.6A..

- - - Updated - - -

Actually i don't have problem in hardware....i suspect in software itself...so i need your help.
 
Last edited:

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top