simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] SerialRX and feedback example


From: Joel Sherrill
Subject: Re: [Simulavr-devel] SerialRX and feedback example
Date: Wed, 8 Apr 2009 10:23:59 -0500
User-agent: Thunderbird 2.0.0.21 (X11/20090320)

address@hidden wrote:
On Tue Apr  7 18:35 , Joel Sherrill  sent:

address@hidden wrote:
On Tue Apr  7 16:23 , Joel Sherrill  sent:
By inserting debug prints, I have confirmed that
the hwuart is shifting the correct data out the
TXD pin.  The TXD pin is connected to the RX pin
of a SerialRX instance.  All data sampled at the
RX pin is 0 (BAD).  Thus all data in the feedback.tcl
display is 0.
From the description, the pins are not connected.
Is the connection done with a Netlist?
If so, perhaps its methods deserve debugging statements.

   Net ser_rxD0
   SerialRx mysrx $ui "serialRx0" ".x"
   SerialRxBasic_SetBaudRate mysrx 9600
   ser_rxD0 Add [SerialRxBasic_GetPin mysrx "rx"]
   ser_rxD0 Add [AvrDevice_GetPin $dev1 "E1"]

I can't read tcl well enough to tell.
This is a rough translation to C++.  The binding is very close
once you get a handle on reading it.

ser_rxD0 = new Net()
mysrx = new SerialRx( ui, "serialRx0, ".x )
mysrx->SetBaudRate(9600)
ser_rxD0->Add( mysrx->GetPin( "rx" ) )
ser_rxD0->Add( dev1->GetPin( "E1" ) )

Where dev1 is an atmega128 instance.
Any suggestions on how I learn to do that?
Did K&R write a tcl book?

I have an old Tcl book which is quite good but the online
docs are excellent.
I think E1 is the atmega128 TXD from reading the code.
And "rx" is the only pin in the SerialRx pin.

More precisely, TXD0.
An atmega128 also has TXD1.

Right.  examples/feedback/uart.c is using UART0 so TXD0
and that seems right.
You might want to put printf's in the Netlist methods.

I don't see how to get info on the pin names but I did
put a print in Pin::SetInState (const Pin &p) and the
state is going H/L in what appears to be a reasonable
pattern. SerialRx just somehow isn't seeing it.
My net may not be 100% right but if I hook up an external
pin via Tcl, then I start seeing high/low transitions in
the simfeedback.tcl. But SerialRx always gives 0. I don't want to have to reconstruct bits into bytes when
there is a class already supposed to do it.  But I can't
seem to make it work.

This is deep in the bowels and I don't know what else
to check.  The code in CVS demonstrates the problem
but doesn't have any debug prints.

:( frustrated :(
--
Michael Hennebry
address@hidden
"War is only a hobby."
---- Msg sent via CableONE.net MyMail - http://www.cableone.net


--
Joel Sherrill, Ph.D.             Director of Research & Development
address@hidden        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
  Support Available             (256) 722-9985






reply via email to

[Prev in Thread] Current Thread [Next in Thread]