[Top][All Lists]
[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 12:01:34 -0500 |
User-agent: |
Thunderbird 2.0.0.21 (X11/20090320) |
address@hidden wrote:
On Wed Apr 8 10:23 , Joel Sherrill sent:
address@hidden wrote:
On Tue Apr 7 18:35 , Joel Sherrill sent:
address@hidden wrote:
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" ) )
What happens if Add or GetPin fails, e.g.
"rx" or "E1" is spelled wrong?
:) Good thought. I had wondered this earlier and copied
the error checking code from avrdevice.cpp to here just
in case.
Not is aborts on the spot with a message if "Q1" or "lx"
is tried. I tried adding an instance of ExtPin to the net
and now I see all the bit transitions in Tcl but SerialRx
is still missing things.
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'll try using them again.
I tried another experiment. Adding this to the top the SerialRX Step
method:
int SerialRxBasic::Step(bool &trueHwStep, SystemClockOffset
*timeToNextStepIn_ns){
if (rx) cerr << "H";
else cerr << "L";
It isn't a matter of being mismatched on time -- the rx pin is
ALWAYS low according to that. Hacking a bit more I learned
it is in enumerated state #4 which is PULLUP. Did I miss
something in the configuration somewhere?
Hmm.. even weirder is that PinStateHasChanged() in serialrx.cpp
is getting called and it is showing the pin toggle but when the Step
is called, it is always in PULLUP state.
FWIW I verified that the pointer to the pin used had the same value
in both cases.
I have a meeting but will try to probe into this further. Looks like
something is fishy. But I don't know what.
- [Simulavr-devel] SerialRX and feedback example, Joel Sherrill, 2009/04/07
- Re: [Simulavr-devel] SerialRX and feedback example, address@hidden, 2009/04/07
- Re: [Simulavr-devel] SerialRX and feedback example, Joel Sherrill, 2009/04/08
- Re: [Simulavr-devel] SerialRX and feedback example, Knut Schwichtenberg, 2009/04/09
- Re: [Simulavr-devel] SerialRX and feedback example, Joel Sherrill, 2009/04/09
- Re: [Simulavr-devel] SerialRX and feedback example, Knut Schwichtenberg, 2009/04/09
- Re: [Simulavr-devel] SerialRX and feedback example, Joel Sherrill, 2009/04/09
- Re: [Simulavr-devel] SerialRX and feedback example, Knut Schwichtenberg, 2009/04/09
- Re: [Simulavr-devel] SerialRX and feedback example, Joel Sherrill, 2009/04/09
Re: [Simulavr-devel] SerialRX and feedback example, address@hidden, 2009/04/08
- Re: [Simulavr-devel] SerialRX and feedback example,
Joel Sherrill <=