UART with LPC1343 LPCXpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UART with LPC1343 LPCXpresso

916 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by smkuls on Wed Nov 13 05:49:23 MST 2013
I need to transmit and receive data using UART. This is my first project and I have no clue whatsoever so as to how to proceed, any suggestions?
I tried reading the example but looks like it is interrupt based. I couldn't understand it.

I have the datasheet and I know the RX and TX port locations.

PS - Also where would I receive the data?
Do I have to print it?
(Arduino has a "comport" to view the values) - Is there a similar feature in LPC Xpresso.
Labels (1)
0 Kudos
6 Replies

850 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Nov 20 23:43:52 MST 2013
Check the user manual again and start from the beginning of the UART chapter.

There you will find a step by step instruction of what to do: enable the UART, select the IP clock to use, set the pins to the correct functions, setup uart.

You need to have your UART pins setup properly through the PINSEL registers. That connects the UART lines to the selected pins.

As LabRat already pointed out: the examples that come with the LPCXpresso tools should be working straight out of the box.
Of course you need to use the hardware as used with the examples.

What hardware do you have, did you use a scope (or any other means) to verify if there is data coming from your TX pin, did you try to debug your program - what happened.

You need to figure out how your hardware works and how you initialize the peripherals - this is similar for all peripherals in the chip so try to get the hang of this other wise you'll be stuck forever.

Rob
0 Kudos

850 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Wed Nov 13 06:49:20 MST 2013
I've no idea which hardware you are using and I've still no idea which sample you are using...

Usually samples are working out of the box and debugging can help you to understand what's happening.

Good luck.
0 Kudos

850 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by smkuls on Wed Nov 13 06:33:56 MST 2013
I have shorted the RX and TX pins, so now whatever I would send - I will receive the same as output.

There is no external hardware as such.

And by that I meant, how can I access the RX pin (the command) - like you have GPIOSetDir to enable a particular GPIO pin - is there any similar way in which I have to enable the RX and TX pins and then send and receive the data.
0 Kudos

850 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Wed Nov 13 06:30:44 MST 2013
Could be useful if you describe which sample you are using and what you are trying to do...


Quote:
how to select the pins

??

Which hardware are you using? What is connected to your UART?

0 Kudos

850 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by smkuls on Wed Nov 13 06:21:40 MST 2013
I tried the blinky example and then I tried with 4 LEDs. I have an experience with Arduino as well as programming!

I looked in the User Manual as well, still stuck!
I can't seem to figure out how to select the pins and transmit or receive the data.

As in what are the various commands.
0 Kudos

850 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Wed Nov 13 06:06:09 MST 2013

Quote: smkuls
any suggestions?



- Read the 'User manual'

- Use examples to get familiar with hardware, programming & debugging

- Don't expect easy solutions, there's a lot stuff to learn (M3 is a complex thing)
0 Kudos