FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [May 2013 Threads] Weird characters coming from UART0Posted by mcufan on May 1, 2013 Hi,
I am trying to use comtest.c and/or comtest_strings.c on an LPC2138 to send and receive bytes via UART0. I modified the Rx task to accept any string and receiving characters seems to work, at least when I type something in the hyperterminal the LED flashes. However if I check whether the received byte is eg. 'A' then toggle a LED, then it won't light up. It means somehow it received something else than what was sent from my PC. I think I have the same problem with the Tx task: although I set it to transmit the 'ABC' string it seems to transmit some garbage to my PC's COM port: mostly the following bytes: 0xC3 and 0xBE but sometimes something else. I have 19200 baud rate, 8-N-1 configured on both my PC and in FreeRTOS. The hardware clearly works, because when I download a demo firmware it nicely transmits strings and can even echo my typed characters back. What do you think can cause such strange behaviour? I also have a higher priority task running: it periodically resets an external watchdog hardware. But I don't think that would interfere as it runs only ever second.
RE: Weird characters coming from UART0Posted by Richard Damon on May 2, 2013 My guess is that you have the baud rate set wrong, perhaps because you have the clock rate set wrong. I bet if you look at the serial port for transmit with a scope the bit time is off.
RE: Weird characters coming from UART0Posted by mcufan on May 2, 2013 Hi richard_damon,
It was indeed the frequency which was set incorrectly. I forgot to change it. I checked the XTAL frequency on the board, multiplied it by 4 (due to PLL) and set this value to configCPU_CLOCK_HZ in FreeRTOSConfig.h. Now it is working like a charm. Thank you very much for your help!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|