# ATMEGA-128 UART issue

**URL:** <https://forums.freertos.org/t/atmega-128-uart-issue/292>\
**Category:** Kernel\
**Created:** [February 21, 2006, 2:46pm UTC](https://forums.freertos.org/t/atmega-128-uart-issue/292 "2006-02-21T14:46:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 21, 2006, 2:46pm UTC](https://forums.freertos.org/t/atmega-128-uart-issue/292/1 "2006-02-21T14:46:49Z")

</div>

**[baiangel](https://sourceforge.net/u/baiangel/)** wrote on [Tuesday, February 21, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/0c444cd2/#aefe):

Hi!

I am trying to use both UARTS in ATMEGA128 port of the kernel (compiled with GCC). I have the following&nbsp; situation: in one task, I send a message through UART0 to one node and I use xQueueReceive with timeout to receive an answer from the node. While this task is blocked on the queue, another task is sending a message to another node through UART1. The reception on both UARTS is done in an ISR. The problem is, that in this configuration the ISR is not always being entered. I have checked this using the following method: on evey entrance/exit of the ISR, I am toggling a pin of the MCU, thus counting the received symbols. With one channel of the scope I am tracing the received data (at the RX pin of the MCU) and with another channel I am tracing the toggling of the above mentioned pin. I found, that&nbsp; not on evey byte I get an interupt. Also, when I disable one of the tasks, transmitting through the USART, the picture is just fine. I have 4 additional tasks, so the problem is not in the count of tasks. Do you have any idea where this problem comes from? Thank you!

P.S.  
I have tried this without the kernel (sending through UART0 in the main() and receiving through UART1 in an ISR). There was no such problem.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 21, 2006, 3:42pm UTC](https://forums.freertos.org/t/atmega-128-uart-issue/292/2 "2006-02-21T15:42:31Z")

</div>

**nobody** wrote on [Tuesday, February 21, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/0c444cd2/#aefe/2f44):

How are you sending to UART1?&nbsp; Is this also using a Q?&nbsp; A Q sounds good for the receive as it can be used to wake the task.&nbsp; For Tx maybe the overhead is too much and as you don’t need to automatically wake a task a simply buffer could be used instead?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 22, 2006, 7:24am UTC](https://forums.freertos.org/t/atmega-128-uart-issue/292/3 "2006-02-22T07:24:39Z")

</div>

**[baiangel](https://sourceforge.net/u/baiangel/)** wrote on [Wednesday, February 22, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/0c444cd2/#aefe/c001):

I am sending to UART1 in a task, whcich is woken periodicaly (at about 100ms). The transmitting and the receiving in none of the UARTS occurs at the same time.
