1769 - Example UART for receive

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

1769 - Example UART for receive

6,941 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Thu Jul 26 13:33:27 MST 2012
Hello,

I did found a example of UART for receive data...

Do I receive for function "UARTSEND"?

Can someone help me?

Thanks..
0 Kudos
34 Replies

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Mon Aug 03 09:49:58 MST 2015
Hello, I think CMSIS2.0 is missed in your project. Include it.

Other suggestion: usw my example in post#9, this includes everything.
https://www.lpcware.com/content/forum/adc-lpc1769-please-help
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dandumit on Mon Aug 03 07:48:09 MST 2015
I have to clarify I am trying to compile for lpc1769...
I have included "chip.h" but it seems that I am missing those definitions .
file : chip_lpc175X_6x.h does not includes those definitions...
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dandumit on Mon Aug 03 07:28:58 MST 2015
@Superfred -  thank you for update / help .
I can't understand why this forum doesn't send notification.

I still cannot compile it.

Probably there are some definitions missing or some project setting. I still have those errors :

../serial.c:349:2: error: 'LPC_PINCON' undeclared (first use in this function)
  LPC_PINCON->PINSEL0 &= ~0x000000F0;
  ^

../serial.c:354:13: error: 'LPC_SC' undeclared (first use in this function)
  pclkdiv = (LPC_SC->PCLKSEL0 >> 6) & 0x03;
             ^
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Tue Jul 14 03:25:37 MST 2015
Hello,

there are two functions in my library:

Serial_write sends out the plain binary value.

Serial_printNumber sends out the value in ASCII format (human readable), the base can be BIN, DEC or HEX.
If you need some spacing between the values, use Serial_printString.

You can also use this example, using FreeRtos (post #9)
https://www.lpcware.com/content/forum/adc-lpc1769-please-help

But maybe LPCOpen is the better choice for a new project....

Fred
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by drvrh on Mon Jul 13 23:28:24 MST 2015
hello

SuperFred

I would like this library for UART sending. I must sending HEX number:

{0x55, 0x00, 0x07, 0x07, 0x01, 0x7A, 0xF6, 0x50, 0x00, 0x11, 0x30, 0x06, 0x30, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x2C, 0x00, 0x9C};


How to send over UART with your library?

Thank you foo answer
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Wed Jun 03 08:30:05 MST 2015
Hello,

I checked it, you can delete this two lines in serial.h (line 41 & 42):

typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;

I use LPCXpresso, this driver needs CMSISv2p00_LPC17xx.
But maybe LPCOpen is the better choice for a new project....



Fred
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by dandumit on Tue Jun 02 13:55:20 MST 2015
Hello All,
I would like to use this library.
What compiler did you used ?
I am trying to compile the library and example using LpcXpresso.
I have managed to fix some environment settings but I still get a lot of error like :

"../serial.h:41:15: error: redeclaration of enumerator 'RESET'"
"../serial.h:41:26: error: redeclaration of enumerator 'SET'"

"../serial.h:41:40: error: conflicting types for 'FlagStatus'"
"../serial.h:42:47: error: conflicting types for 'FunctionalState'"

Could you please give me a hand/help ?

Kind Regards,
Daniel
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Giri Sparrow on Tue Feb 03 05:37:12 MST 2015
i need to clarify following things.

We are going to interface a GPS and a GSM module to LPC82x controller.And we need to Get the GPS data from the GPS module and send it to our server using GSM modem. Will 32KB Flash memory and 8KB RAM will be sufficient for this purpose ?

Or Should I have to go for Any other controllers with higher memory configuration ?

Regards, R.Giritharan
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Irappa on Wed Oct 08 23:49:40 MST 2014
Hi,

I have tested with lpc1769 which you have given the code and zip folder. It is working fine. Thanks for your valuable support.

0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bpolcawich on Tue Sep 16 11:22:29 MST 2014
Does anyone know if this example code will work with the LPC812.  I have one of the Quick Jack demo boards and I am trying to get the uart working.  Thanks
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by baffico on Sat Aug 16 10:38:38 MST 2014
Hello ... do I want to do a query, I need to send a sms via a gprs module, I am using LPC1769 module ..that recommend?, And where I can find code that serves as ejempo me to arm the driver ?.
Also, I have to send images from a webcam via USB and ethernet someone may thereby facilitate ..uso me some code in the cp2102 development board ..thank's
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Pax on Fri Sep 14 04:41:34 MST 2012
[SIZE=2]
Quote: Superfred
...I looked into my UART1 init (which I took from the NXP example), and I think that both versions are correct:
You can choose for TXD1/RXD1 the pins 2.0/2.1 (like in the NXP example) or the pins 0.15/0.16 (like your example), at least this is what I understood fron the User Manual.

I think what confuses is that the NXP examples where made for the MCB1700 board and not for the LPCXpresso board, but even there you can use pins 2.0/2.1 for UART1...


Very interesting, I did not even consider the possibility that one could choose two different sets of pins for UART1 Rx/Tx.
I thought NXP had ported the UART1 init code from some other chip and missed to update the pins. Anyway, to be complete they should have had an option to choose pin sets.

I btw use an Embedded Artists motor control prototype board for my current, early work, and there you are forced to use [/SIZE][SIZE=2][SIZE=2]pins 0.15 and 0.16.[/SIZE]
[/SIZE]
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Fri Sep 14 03:07:38 MST 2012
Hi Pax,

thank you for sharing your findings!

I looked into my UART1 init (which I took from the NXP example), and I think that both versions are correct:
You can choose for TXD1/RXD1 the pins 2.0/2.1 (like in the NXP example) or the pins 0.15/0.16 (like your example), at least this is what I understood fron the User Manual.

I think what confuses is that the NXP examples where made for the MCB1700 board and not for the LPCXpresso board, but even there you can use pins 2.0/2.1 for UART1.

If this is needed, I can insert some #defines on the beginning of my serial driver where you can choose the pins you want to use, but only on request (I don't want to do something nobody uses).

Fred
0 Kudos

1,391 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Pax on Thu Sep 13 13:05:10 MST 2012
Hello Fred,

and thanks for taking the time to write the UART library. I have just spent a number of hours figuring out why UART1 on a LPC1769 did not work with standard, simple NXP example code. I had done some HW work, so a likely cause for problems. I looked there first, but it seemed at least not immediately wrong.

I then noticed that the UART1 pins were set incorrectly in the NXP UART init code(!). Quite surprising to see such bugs in official code, and it makes me worry about the state of the code for the serious things, like the USB stack...

Looking at your change to UART3, I assumed (hoped) the change was as simple for UART1 - and it was.

Here is code that makes UART1 work:

//Enable TxD1 (pin P0.15)
LPC_PINCON->PINSEL0 &= ~0xC0000000; //P0.15 is bits 31:30
LPC_PINCON->PINSEL0 |= 0x40000000;  //TxD1 is 01
//Enable RxD1 (pin P0.16)
LPC_PINCON->PINSEL1 &= ~0x00000003; //P0.16 is bits 1:0
LPC_PINCON->PINSEL1 |= 0x00000001;  //RxD1 is 01
0 Kudos

1,392 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Wed Sep 12 06:45:43 MST 2012
Hi  Bruno,

I inserted UART2 support in my serial library. On my 1769 (100 MHZ) everything works.
UART2 uses P0[10] and P0[11]!

To fix your baudrate problem you can try a
SystemCoreClockUpdate ();
before Serial_begin (see my main.c).
And my library needs CMSISv2p00_LPC17xx.

Please tell me the outcome!
Fred
0 Kudos

1,400 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Mon Sep 10 09:10:12 MST 2012
I modified your code UART2!
The UART2, don't working.

[B]Not Sending and Not receiving.[/B]



, Bruno Braga
0 Kudos

1,400 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Mon Sep 10 05:30:43 MST 2012
Hello Bruno,
[I]
My programme is working perfect!!! Thank you very much .[/I]
Congratulation!

UART2: the example from NXP I used as source of my serial driver contained only UART0, UART1 and UART3.

Do you really need UART2? Cant you use UART0, UART1 or UART3 instead?
On LPC 1769 you have:
P0[2]=TXD0 / P0[3]=RXD0
P2[0]=TXD1 / P2[1]=RXD1
P0[0]=TXD3 / P0[1]=RXD3

If you need UART2: what is the problem in your code? Hardfault? Not Sending? Not receiving?

UART2 is problematic on the LPCXpresso 1769 board because P2[9]= RXD2  is connected to Q3 for USB Pullup .

Fred
0 Kudos

1,400 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bruno on Fri Sep 07 06:46:48 MST 2012
Hello, Fred!!

My programme is working perfect!!! Thank you very much .

Now, I am trying, make UART (2 PORT). I made a code, but he does not works .Could you see my programme?

Because I'm my project i need of UART2

Bruno Braga
0 Kudos

1,400 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Fri Aug 24 08:27:32 MST 2012
Hi Bruno,

I looked into the semihosting document
http://support.code-red-tech.com/CodeRedWiki/UsingPrintf
and on the bottom it says:
[I]Thus if you application uses interrupts, then it is normally advisable to avoid the use of semihosting.
[/I]So I think that is the reason why the UART receive interrupt looses some characters.
So if possible use a second UART port for print debugging info via Hyperterminal.You can use my serial library also for this, it supportsUART Ports 0,1 and 3(NOT 2).
[I]
Fred
[/I]
0 Kudos

1,400 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Superfred on Fri Aug 24 01:16:54 MST 2012
Hi Bruno,

in the moment I cannot test it on my system because I am on holiday, so you have to wait one week.

But I don't think that it is a baudrate problem. Try to minimise the printf commands, they are slow. Use only the printf's I used in my post from 08-12-2012 04:59, this sends out only a debug info after you press return.

Or use my post from 08-08-2012 01:00 PM, this uses no printf at all.

Tell me the outcome.

Fred
0 Kudos