Problems LPC1114 software UART

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problems LPC1114 software UART

1,282件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ppx on Fri May 04 09:17:00 MST 2012
I need 2 UARTs so I have tried to use the software UART example on a LPCXpresso board, that little board you can break in 2. The example is using PIO1-5 for RX and PIO0-11 for TX. Transmit works OK if I turn down the speed to 2400 baud, otherwise my Windows terminal program can't handle the speed.

When using receiver I get a string of random character during about 10 seconds . Looking at the scope I can see that the RX pin is pulled down after executing the following code:

/* Some of the I/O pins need to be clearfully planned if you use below module because JTAG and TIMER CAP/MAT pins are muxed. */

    LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 9);

    LPC_IOCON->PIO1_5 &= ~0x07; /*  Timer0_32 I/O config */
    LPC_IOCON->PIO1_5 |= 0x02; /* Timer0_32 CAP0 */
    LPC_IOCON->R_PIO0_11 &= ~0x07;
    LPC_IOCON->R_PIO0_11 |= 0x03; /* Timer0_32 MAT3 */

But this pin should be configured as an input to the timer? After this I can see some random waveform at around half the baudrate for about 10 seconds and the RX pin is than pulled low again. The random waveform is seen as two repeating characters in my terminal window so the reception sort of works. I debug with LPCXpresso, V4.2.0 and via USB.

Any ideas? Collision with the JTAG pins? Should I disable the JTAG somehow?

ref. Id:: lpc_swu.c 4785 2010-09-03 22:39:27Z nxp21346
0 件の賞賛
返信
4 返答(返信)

1,212件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ppx on Wed May 09 05:18:30 MST 2012
I've built an RS232 level converter on Vero and there was a short circuit between the RX and TX pins. Couldn't even see it but my knife found it.:)
0 件の賞賛
返信

1,212件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ppx on Wed May 09 02:31:19 MST 2012
I am using the version from NXP and I believe this is a newer and improved version written by "Arne B". He said: "Please update the sw_uart.c file from the current archive, if you are already using this driver." Could be interesting to look at it.

Where is this archive? Same as NXP?
0 件の賞賛
返信

1,212件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by js-nxp on Tue May 08 16:21:23 MST 2012
Don't know if it helps http://knowledgebase.nxp.com/showthread.php?t=2810
0 件の賞賛
返信

1,212件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ppx on Tue May 08 09:55:49 MST 2012
Anyway the text about JTAG and multitiplexing is not relevant because LPC1114 does not have JTAG. It has SWD and I suppose it would be incorrect to call that JTAG.

And I can't understand why the pin goes low at this particular point. The code looks right. Perhaps the code has not been tested on 1114 and there are some subtle hardware differencies?
0 件の賞賛
返信