Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | Re: UART - printf - keil

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

Re: UART - printf - keil - Petrescu - Nov 20 5:59:28 2007

One method (not a single one):
use sprintf() to fill up a buffer and then use a suitable UART1 routine
to output the data from this buffer.
Yoan

niraj_chavda14 wrote:
> - printf() is a library routine provided by keil library.
> So whenever we use printf in our code I assume what it
> might be doing is calls a routine which places characters
> of the printf statement in the UART buffer to get it
> transmitted from there.
>
> Now in LPC2000 we have two UARTs UART0 and UART1. So the
> routine called for printf must be placing characters in one
> of these UART buffers. Now I dont find any method to force the
> printf tatement to place characters in buffer of specific UART
> of our choice.
>
> SO I assumed keil printf statement may be using UART1 data
> buffer as default. Because it works fine with UART1 but not
> with UART0.
>
> While testing in our code I configured UART0 to transmitte
> the data and than used printf statement to send the data. Than I
> connected RS232 port of the PC with UART0 of our controller and
> observed that it was receiving no data at all.
>
> But when I connected the port to UART1 it was receving garbej
> data. Data was garbej because I didnt configure UART1(I assume)
>
> Code and other configuration was same in both the cases except
> connection of the PC Rs232 port with UART1 instead of
> UART0.
>
> So I am Concluding that keil uses UART1 as default for printf
> statments. AM I CORRECT?
>
> Plz guide me if my conclusion is wrong and plz suggest some method
> to use UART0 with printf statements because I cant use UART1 in
> my project.
>
>



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )