- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
can me somebody help with uart - speed?
When I set up the speed of uart to 19200bd, all is ok.
When I set up the speed of uart to 115200, I have a problem with receiving the characters. When I send characters from PC, uart interrupt detects twice more character.
For example:
Send from PC: HELLO
Receive in processor: H, null,E,null,L,null,L, null, O, null. Between characters is received the character: 0 (dec). I use the interrupt:RX FIFO not empty.
But in 19200bd, processor does not receive the character 0(dec).
The uart actual speed is 115196bd (The CLK of processor is 48MHz).
I tried to change Oversampling, CLK of processor, Stop bits, but everything does not work.
Thank you for help:)
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I find the problem...I call:
source = UART_GetRxInterruptSourceMasked();
UART_ClearRxInterruptSource(source);
in the beginning of interrupt function. But it has to be in the end of this function...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
I am sending a project...There is CLK 47MHz a speed of uart 115196bd..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Set UART "Byte mode" (UART advanced properties)
When you set the Rx and Tx Buffers to 260 and remove your interrupt handling you can use the internal routines. Check for RxBufferSize() > 0 to see whether a character has been received.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But it is strange...When I delete interrupt, I need to change logic of receiving datagrams...Sendig in 115200bd works good but receiving not...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Probably you are spending too much time in your receiver interrupt handler. Use memset() instead of your for-loop, compile the module with code optimization (Do not forget to declare global vars changed in an interrupt handler as "volatile")
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But I use for-loop only, when the array is full. When I send 10 char, these characters are inserted in array without for loop...(Read char -> insert to array -> increase array pointer -> end)
I used very slow processor - ATmega8 and it has not any problem with speed:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I find the problem...I call:
source = UART_GetRxInterruptSourceMasked();
UART_ClearRxInterruptSource(source);
in the beginning of interrupt function. But it has to be in the end of this function...