Problems with the UART (LPC1114 /301)

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

Problems with the UART (LPC1114 /301)

3,181 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amelendez@dibal.com on Fri Dec 16 03:13:42 MST 2011
I have used the LPC1114 /302 UART in the LPCXpresso Board without problems executing the 'uart' project example.
Trying to do the same in my target board (LPC1114 /301) I got none data at the UART output, should I change any configuration for working with the 301 instead of the 302?.

Thank
0 Kudos
Reply
17 Replies

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by angelma on Fri Dec 16 14:43:55 MST 2011
I meant PIO1_0, PIO1_1. If any signal enters by these pins if programmed for JTAG could interfer in  the UART
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Dec 16 11:22:50 MST 2011

Quote: angelma
Review if other pin is interferring on your app. Perhaps PIO1_ or PIO_1 are configured as JTAG


What's [COLOR=Red]PIO1_ [COLOR=Black]? Wireless ? :rolleyes:[/COLOR][/COLOR]
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by angelma on Fri Dec 16 08:21:20 MST 2011
Review if other pin is interferring on your app. Perhaps PIO1_ or PIO_1 are configured as JTAG
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Dec 16 06:27:05 MST 2011

Quote: amelendez@dibal.com
SYSPLLCTRL = 0x23
SYSPLLSTAT = 0x1 (lock)



SYSPLLCTRL = 0x23 is standard setup and generating
main clock = 4 * crystal = 4* 12MHz = 48MHz

Of course this setting is [COLOR=Red]not[/COLOR] working with 25 MHz and [COLOR=Red]not[/COLOR] generating a 100MHz main clock :rolleyes:
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Dec 16 06:22:56 MST 2011

Quote: amelendez@dibal.com
Please, how can I read it when debugging?

The project was created modifying the 'uart' project example. This project (changing only the MCU target) works properly over the LPCXpresso board.



Use 'Suspend' button after you've started debugging and then use Peripherals View:


Quote:

4.1.2.1
Peripheral views
LPCXpresso includes full, annotated and interactive debug views of all the peripherals. Access to the views is found on the Peripherals View (click the Peripherals tab) behind the Core Registers view. Each peripheral can be selected, and it is displayed in the ‘Memory’ view which is located behind the ‘Console’ view at the bottom of the LPCXpresso desktop.

as described in LPCXpressoGettingStarted.pdf in your lpcxpresso folder :eek:

If this project is working with a LPCXpresso target board and not with your own 12MHz board your hardware is faulty :eek: Then kick your hardware engineer in the ...
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amelendez@dibal.com on Fri Dec 16 06:18:26 MST 2011
SYSPLLCTRL = 0x23
SYSPLLSTAT = 0x1 (lock)
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Fri Dec 16 06:15:19 MST 2011
RTFM :confused:

It's in the Getting Started with LPCXpresso.
I know there is not that much documentation but this is shown there.

Rob
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amelendez@dibal.com on Fri Dec 16 06:11:02 MST 2011
Please, how can I read it when debugging?

The project was created modifying the 'uart' project example. This project (changing only the MCU target) works properly over the LPCXpresso board.
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Dec 16 05:58:51 MST 2011
Sorry, I can't help you if you don't answer my questions :)

Is this

SYSPLLCTRL = SYSPLLCTR_val = 0x00000023

your actual debugger reading?


How did you generate your new project? Did you copy the old sample?

Did you try to run the old working sample with your new (own ?) board?
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amelendez@dibal.com on Fri Dec 16 05:48:37 MST 2011
I have repplaced the XTAL and I put 12MHz. The problem remains, none signal at the uart output.

Once changed the XTAL to 12MHz
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#define [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]__XTAL (12000000UL) [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Oscillator frequency */[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#define [/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]__SYS_OSC_CLK ( __XTAL) [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Main oscillator frequency */[/COLOR][/SIZE][/COLOR][/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#define[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] __IRC_OSC_CLK (12000000UL) [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Internal RC oscillator frequency */[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]

[LEFT]Also:
SSYSCTL = 0x40048000
SYSPLLCTRL = SYSPLLCTR_val = 0x00000023[/LEFT]
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Dec 16 05:34:45 MST 2011

Quote:

I have not changed neither PLL nor all the registers regarding to the clock



Then use your debugger to check you actual SYSPLLCTRL value in Peripheral View / SSYSCTL :eek:

Why did you change your crystal to 25MHz?
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amelendez@dibal.com on Fri Dec 16 05:20:18 MST 2011
From the 'uart' example I have only changed:

[SIZE=2][B][COLOR=#7f0055]#define[/COLOR][/B] __XTAL (25000000UL) [COLOR=#3f7f5f][COLOR=#3f7f5f]/* Oscillator frequency */[/COLOR][/COLOR][/SIZE]

[COLOR=black]in the System_LPC11xx.c file.[/COLOR]

and Target LPC1114/301 in MCU settings.

I have not changed neither PLL nor all the registers regarding to the clock
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Dec 16 05:04:33 MST 2011
#1 Don't init UART as modem for test purposes :eek:

#2 Use you debugger to check in Peripheral view / IOCON if you IOCON->PIO1_6 is really UART_TxD as configured :rolleyes:
 
#3 If you've changed you crystal from 12 to 25MHz, did you change the main clock setting? Are you using PLL?

#4 Did you change
#define SYSPLLCTRL_Val 0x00000023
in system_LPC11xx.h already?
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amelendez@dibal.com on Fri Dec 16 04:25:18 MST 2011
Thanks.
With other example, I have checked that I can move up (3V3) and down (0V) both PIO1_6 and PIO1_7. So the connection from the LPC1114 and the UART connector is tested and it is good.
Then, I have modified the 'uart' example as follows:

[SIZE=2]UARTInit(UART_BAUD);[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#if[/COLOR][/SIZE][/COLOR][/SIZE][/B]
[LEFT][SIZE=2]MODEM_TEST[/SIZE]
[SIZE=2]ModemInit();[/SIZE]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#endif[/COLOR][/SIZE][/COLOR][/SIZE][/B][/LEFT]

[LEFT][SIZE=2]UARTCount1=10;[/SIZE]
[SIZE=2]UARTBuffer1[1] = 10;[/SIZE][/LEFT]

[LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]while[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] (1) [/SIZE][/LEFT]

[LEFT][SIZE=2]{ [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Loop forever */[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]UARTSend( ([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]uint8_t[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] *)UARTBuffer1, UARTCount1 );[/SIZE]
[SIZE=2]}[/SIZE][/LEFT]

[LEFT][SIZE=2][SIZE=3][COLOR=black]Without connectig any UART port to my board (PIOs pins opened) and I don't get (in the oscilloscope)any signal neither at PIO1_6 neither PIO1_7 (both 0V)[/COLOR][/SIZE][/SIZE][/LEFT]

[LEFT]PIO1_6 and PIO1_7 are configurated for UART when the application executes: [SIZE=2]UARTInit(UART_BAUD);[/SIZE][/LEFT]

[LEFT][SIZE=2]LPC_IOCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PIO1_6[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &= ~0x07; [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* UART I/O [U]config[/U] */[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
[SIZE=2]LPC_IOCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PIO1_6[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= 0x01; [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* UART RXD */[/COLOR][/SIZE][/COLOR][/SIZE]
[LEFT][SIZE=2]LPC_IOCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PIO1_7[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &= ~0x07; [/SIZE]
[SIZE=2]LPC_IOCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]PIO1_7[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] |= 0x01; [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* UART TXD */[/COLOR][/SIZE][/COLOR][/SIZE][/LEFT]
0 Kudos
Reply

3,127 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Dec 16 04:11:07 MST 2011

Quote:

I got none data at the UART output

What does that mean :confused: Did you scope TxD and there's nothing while debugger shows transmitting ? If there's really nothing it's no clock or baudrate problem.

I would suggest to check you pin configuration (is it really TxD/ RxD or still GPIO):eek:

Is your project using semihosting?
0 Kudos
Reply

3,126 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amelendez@dibal.com on Fri Dec 16 04:02:51 MST 2011
Thanks.
I had already done your recommendation but the problems remains.
Is there another pin than Rx and Tx  involved in the UART (in my design RTS is not connected)?
My design is using a Xtal of 25MHz but I have already changed:

[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#define[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] __XTAL (25000000UL) [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Oscillator frequency */[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f][/COLOR][/SIZE][/COLOR][/SIZE]
[COLOR=black]in the System_LPC11xx.c file. Is this enough?[/COLOR]
0 Kudos
Reply

3,126 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Dec 16 03:23:40 MST 2011

Quote:
should I change any configuration

No, just changing MCU (301-302) setting should work :)

I'm using UART with both versions without problems :rolleyes:
0 Kudos
Reply