simulavr-devel
[Top][All Lists]
Advanced

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

Re: [Simulavr-devel] connecting pins


From: Klaus Rudolph
Subject: Re: [Simulavr-devel] connecting pins
Date: Tue, 08 Jul 2008 15:47:20 +0200
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Michael Hennebry schrieb:
On Tue, 8 Jul 2008, Klaus Rudolph wrote:
Suppose I am simulating two processors with simulavrxx.
I'll want to connect a pin on one processor to a pin on the other.
How do I do that?
I get the impression that I need Net,
but I don't know what to do with it.

Likewise, what do I need to connect
pins to custom simulated hardware?

Please take a look to the example code (anacomp)

Thank you.
I've added comments that might need correcting.

  38 #create some external pins
  39 ExtAnalogPin pain0 0 $ui "ain0" ".x"
# create an interface to an analog gui pin
# name it pain0
# label it ain0
# ".x"?
.x is the name of the window in tk. All tk objects must have a name which starts with a dot for the top level window. A button (b) in a frame (f) which is in the toplevel window will be: .f.b for example.


  40 ExtAnalogPin pain1 0 $ui "ain1" ".x"
  41 ExtPin epb $Pin_TRISTATE $ui "->BO" ".x"
# create an interface to a digital gui pin
# epb? $Pin_TRISTATE? ".x"?
  42
  43
  44 #create some nets which connect the pins
  45 Net ain0              # start a "wire" named ain0
  46 ain0 Add pain0        # add gui pin pain0 to it
  47 ain0 Add [AvrDevice_GetPin $dev1 "D6"]   # add pin D6 of $dev1 to it
  48

Here you see avr pins and also pins from the ui. Connecting multiple cpu
pins is simply done by connecting them with an Add to the net.

One of the custom hardware devices I have in mind
is an LED display multiplexed by cooperating AVRs.
I think that I will have to write that myself,
but I don't know even what to put in a header
file or to what to feed said header file.

LED Display? You mean a multiplexed 7 segment 4 digit thing for example?

You can "draw" such things without any c/cpp code also in tcl/tk. There are already elements which show the state of a net. So you can simply start with the code. If you have the led in rows/cols, you simple have to compare that p1 is high and p2 is low and change the color of the drawing to red from gray or something. That are the things tk is made for :-)

Regards
 Klaus





reply via email to

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