Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

help in arm lpc2124 ?

Status
Not open for further replies.

5282604

Full Member level 4
Joined
Dec 19, 2009
Messages
194
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
egypt
Activity points
2,404
hiii

i use keil for arm

and this code not work
int i;
i=5;
printf("%d",i);

it give me
000000000000000000000

and i use lpc2124
 

Hi yar,

try to write your own functions for serial port read write then test with that will it give correct o/P or not. it shood work bcz u r nt accessing any registers related to the controller.
 
i use keil for arm

and this code not work
int i;
i=5;
printf("%d",i);

it give me
000000000000000000000

and i use lpc2124


Is this the entire code listing? If so, I do not see any register, I/O or UART initialization.

Please post the entire code listing.

If you are using Keil and wish to use printf() in your code, you need to ensure Retarget.c and Serial.c are configured correctly and are recompiled and linked with your code above.

BigDog
 
thank all
Code:
#include <stdio.h>                /* prototype declarations for I/O functions */
#include <LPC21xx.H>              /* LPC21xx definitions                      */


/****************/
/* main program */
/****************/

int i;


         




int main (void)  {                /* execution starts here                    */
    
  /* initialize the serial interface   */
 
  [COLOR=#0000ff]PINSEL0 = 0x00050000;           /* Enable RxD1 and TxD1                     */
  U1LCR = 0x83;                   /* 8 bits, no Parity, 1 Stop bit            */
U1DLL = 97;                     /* 9600 Baud Rate @ 15MHz VPB Clock         */
  U1LCR = 0x03;                   /* DLAB = 0                                 */
              [/COLOR][COLOR=#ff0000]
                i=5;
      printf("%d",i);     [/COLOR]
                        
  
}
 

I just glanced at your code and noticed you have no loop statement to prevent the execution from exiting main().

I would either enclosed the printf() in a while(1) block this will repeat output or insert a while(1); after the printf() to prevent execution from exiting main().

You should never allow execution from exiting main(), due to the fact there is no OS to pass execution to.


BigDog
 
hiii

i want lpc2124 datasheet i can't find it in the internet
 

Here it is:

LPC2114/LPC2124 Datasheet

BigDog

---------- Post added at 12:11 ---------- Previous post was at 12:06 ----------

Download for all documentation for the LPC2124:

LPC2124 Product Page

Click on the "Download all documentation" link in the top left hand corner of the page.
 
Here it is:

LPC2114/LPC2124 Datasheet

BigDog

---------- Post added at 12:11 ---------- Previous post was at 12:06 ----------

Download for all documentation for the LPC2124:

LPC2124 Product Page

Click on the "Download all documentation" link in the top left hand corner of the page.

i can't find the lpc2124 register it's like a Overview datasheet.
i want a complete datasheet
 


The complete description exists but the manual that includes them has a different name, Microchip or Atmel etc call it datasheet but NXP calls it a user manual, everything you need is in there, just download it from the links of my previous post.

As an additional note you might want to try ARMwizard, UART is not included at the moment but you can set many other peripherals https://www.edaboard.com/threads/196143/

Alex

PS. I just checked and your mcu LPC2124 is not incuded in the models that exist in the application so it is probably not usable in your case, sorry
 
Last edited:
The complete description exists but the manual that includes them has a different name, Microchip or Atmel etc call it datasheet but NXP calls it a user manual, everything you need is in there, just download it from the links of my previous post.

As an additional note you might want to try ARMwizard, UART is not included at the moment but you can set many other peripherals https://www.edaboard.com/threads/196143/

Alex

PS. I just checked and your mcu LPC2124 is not incuded in the models that exist in the application so it is probably not usable in your case, sorry

thank you but the nxp user manual Did not benefit me in anything ??????
for examble i want to controle and set gpio ?
 

It is explained throughly in the user manual , what is the exact problem you are having.
Do you want to set the pins or change the output of the pins?

There are two registers, PINSEL which controls the pin function and IODIR (or FIODIR) that controls the direction (input/output) when pin are set as I/O

the pin state can be set or read using IOPIN/FIOPIN
the output can be set by IOSET/FIOSET
or cleared using IOCLR/FIOCLR

Alex

---------- Post added at 18:56 ---------- Previous post was at 17:54 ----------

I think it would be very beneficial for you to download The Insider's Guide To The NXP LPC2000 Based Microcontrollers
from Insiders Guides

you can also download The Insider's Guide To The NXP LPC2300/2400 Based Microcontrollers, it is almost the same book with some additions for the 23xx/24xx and it has an index that the previous version doesn't have.

chapter 4 describes the I/O and peripherals , UART is in section 4.7

Alex
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top