[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] UART
From: |
Keith Gudger |
Subject: |
Re: [Simulavr-devel] UART |
Date: |
Mon, 24 Nov 2003 10:26:51 -0800 (PST) |
On Thu, 20 Nov 2003, Theodore A. Roth wrote:
> > I have some questions about simulavr behavior with my uart code that I'm
> > hoping your experience can help me find the answers.
> >
> > First, it appears that when starting up, simulavr executes the "read"
> > routine passed to vdev_construct. I haven't noticed this before, but
> > maybe it's just the way my code works this time. Is this possible? (It's
> > showing up a message from that function even before I get the "Waiting on
> > port 1212 ... message.)
>
> I need more info. Can you send me the output message in question?
>
Here's what happens at startup:
./simulavr -g -d atmega128
Simulating a atmega128 device.
MESSAGE: file decoder.c: line 3517: generating opcode lookup_table
Enter 9 bits of hex data to read into the uart at address 0x002c:
The new information I have, is that since the mega128's 2nd UART is not in
the I/O space, this does not happen for the 2nd UART. Here is the code
that generates this input request:
if ( offset == UART_UDR_ADDR )
{
uart_t->usr &= ~mask_RXC ; /* clear RXC bit in USR */
return uart->udr_rx = uart_port_rd( addr );
This code is in my uart_read routine. This means that this code gets
called *before* I even connect! Any idea why this happens? As I
mentioned, it only happens for the UART configured in I/O space.
> >
> > Second, the interrupt call-back gets installed as an
> > avr_core_async_cb_add, the same as all the other files I've worked on.
> > However, I notice that the call-back routine gets called *a lot*. Even
> > when it looks like nothings happening. Is this normal? Should I be
> > worried?
>
> The callbacks should get called a lot. Clock callbacks get called for
> _every_ clock cycle, async callbacks for every instruction.
>
Here is what happens next, when I *do* connect:
Waiting on port 1212 for gdb client to connect...
Connection opened by host 127.0.0.1, port 45716.
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 1035: Vectoring to irq at addr:76 offset:0
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
MESSAGE: file avrcore.c: line 826: Raising irq # 29 [IRQ_USART0_UDRE at
0x4c]
Do you think that this is something weird I've put in my code, or should I
expect this?
Thanks.
Keith