User manual
myEthernet Technische Beschreibung / technical description 29/48
www.myAVR.de © Laser & Co. Solutions GmbH – 06/2009 www.myAVR.com
5.2 Zustandsabfragen der Pins am myEthernet
Im Einstiegsbeispiel wurden vorrangig Kommandos an
den Webserver gesendet, welche nur die Ausgabe von
Signalen steuern. Da aber auch die Zustände und
Konfigurationen der Pins interessant sind, gibt es noch
weitere Ersetzungen, die mehr Details ausgeben.
Für die Pins 0 bis 23 existieren noch die Ersetzungen
°v*° °c*° °C*°. Dabei kann der * als Parameter für
alle Pins angegeben sein, es erfolgt dann eine
Rückgabe von 24 Werten, die mit einem Semikolon
getrennt sind. Anstatt dem * ist es natürlich möglich,
eine Zahl von 0 bis 23, entsprechend eines einzelnen
Pins, zu benutzen.
Beispiel einer Rückgabe zum Parameter °v*° (Pin 0 bis
Pin 23):
4;3;3;2;1;1;1;1;0;0;0;0;0;0;0;0;0;0;0;
0;1;1;0;1
Beispiel einer Rückgabe zum Parameter °c20° und
°c21°:
0x1 0x1 entspricht der aktuellen Konfiguration an
Pin 20 und Pin 21, hier „digital out“
Beispiel einer Rückgabe zum Parameter °C0°:
0x1C7 entspricht allen möglichen Konfigurationen an
Pin 0,
hier: „digital out“, „digital in“, „digital in mit Pullup“,
„analog input“ sowie einige pinübergreifende
Einstellungen
Rückgaben der Parameter c und C erfolgen hier
hexadezimal und können dabei eine Kombination von
Konfigurationswerten darstellen.
5.2 State enquiry of the pins on the myEthernet
Mainly commands were sent in the example to the
server which control only the output of signals. But the
states and configurations of the pins are also
interesting. So there are more replacements which
output more details.
For the pins 0 – 23 there are replacements like
°v*°
°c*° °C*°. The character * can be specified for all
pins. There is a return of 24 values which are apart of a
semicolon. It’s also possible to use a number from 0 to
23 instead of the * according to a separate pin.
Example of a return to the parameter °v*°(pin 0 to pin
23):
4;3;3;2;1;1;1;1;0;0;0;0;0;0;0;0;0;0;0;
0;1;1;0;1
Example of a return to the parameter °c20°and
°c21°:
0x1 0x1 relates to the actually configuration on pin 20
and pin 21 is here “digital out”
Example of a return to the parameter °C0°:
0x1C7 relates to all configurations which are possible
on pin 0.
it’s here “digital out”, “digital in”, “digital in with
pullup”, “analog input” as well as some pin settings
across.
The returns of the parameter c and C are hexadecimal
and can present a combination of configuration values.
Liste der Konfigurationswerte und ihre Bedeutung:
0x1 = "digital out"
0x2 = "digital in" optional mit 0x100
= "Pullup"
0x4 = "analog input"
0x8 = "uart"
0x10 = "twi"
0x20 = "spi"
0x40 = "ByteOut"
0x80 = "ByteIn" optional mit 0x100
= "Pullup"
Wie kann jetzt in einer laufenden Webanwendung eine
fortlaufende Ausgabe von Werten für z. B. analoge
Signaleingänge realisiert werden?
Für diesen Anwendungsfall wird ein Aufbau des
myEthernets mit dem myAVR Board MK2 wie im Menü
der „Bsp-Anwendungen“ der myEthernet-Webseite
angenommen.
Dort ist ein Potentiometer am Pin 12/13 angeschlossen,
der manuell geregelt werden kann. Die
Signalumwandlung geschieht mit einer Genauigkeit von
10bit. Der Eingangswert von 0V bis 5V wird dann auf
einen digitalen Wert von 0 bis 1023 umgerechnet.
Das Grundprinzip der Datenaufnahme besteht im
wiederholten Abfragen des myEthernet mit einer
Webseite, welche eine Liste von Ersetzungen enthält.
List of the configuration values and there meaning:
0x1 = "digital out"
0x2 = "digital in" optional mit
0x100 = "Pullup"
0x4 = "analog input"
0x8 = "uart"
0x10 = "twi"
0x20 = "spi"
0x40 = "ByteOut"
0x80 = "ByteIn" optional mit 0x100
= "Pullup"
How can you realize the continously output of values
during a current web e.g. for analogue signal inputs?
For this application we take a building of the myEthernet
with the myAVR Board MK2 like it’s demonstrates in
the menu “Examples of use” of the myEthernet website.
There is connect a potentiometer on pin 12/13 which
can be regulated manual. The signal conversion is done
with an accuracy of 10 bits. The input value from 0 volt
to 5 volt will be converted to a digital value from 0 to
1023.
The basic principle of the data acquisition is in the re-
peated query of the myEthernet with a website which
contains a list of replacements.