Hallo Leute ich brauche mal etwas Hilfe von den Programmieren unter
euch.
Ich bin gerade dabei mir einen DMX Demultiplexer aufzubauen.
Projekt habe ich im Netz gefunden allerdings möchte ich das ding etwas
modifiziert haben. Und zwar ist das ein Analog Demux Spannung am Ausgang
von 0-5V je nach DMX Wert. Ich möchte es aber so haben das der Ausgang
TTL wird dh. ab dem DMX wert 127 einfach an dh. auf den Ausgang 5V.
Dafür müsste der Code umgeschrieben werden bzw angepasst. Der Code ist
offiziell verfügbar und darf auch geändert werden.
1
;**** A P P L I C A T I O N N O T E ************************************
2
;*
3
;* Title : 8ch DMX512 Demultiplexer
4
;* Version : v1.2
5
;* Last updated : 02.11.07
6
;* Target : Transceiver Rev.3.01 [ATmega8515]
7
;*
8
;* written by hendrik hoelscher, www.hoelscher-hi.de
Der Code in diesem Projekt ist optimierter Assemblercode und dafür
ausgelegt an PORTA die Soft-PWM zu machen. Als Anfangspunkt nicht ideal.
Wenn es nur um das "geht irgendwie" geht, dann kann man die PWM-Funktion
unterdrücken indem man dem "dimm_count" register einen festen
Schwellwert (127) zuweißt anstatt es zu inkrementieren.
Die "saubere" Lösung wäre allerdings den Code entsprechend neu zu
schreiben.
Wenn du das Gesamtkonzept verstehen willst, dann würde ich dir empfehlen
ein komplett eigenes Projekt zu basteln. DMX ist von den Ansprüchen ja
relativ überschaubar.
Komplett neu schreiben wäre sicherlich die beste Lösung und auch um es
zu verstehen. Das würde ich im zweiten schritt machen. Im moment geht es
mir erstmal darum zu testen ob das was ich mit dem Demux vor habe so
überhaupt läuft. Darum würde mir für den Anfang hauptsache geht erstmal
reichen.
Dann würde ich wie gesagt einfach dimm_count mit 127 laden und die
increment routine rausschmeißen.
Ist aber wie gesagt etwas pfuschig, aber sollte funktionieren.
Hallo,
bin beim Suchen auf diesen Beitrag gestoßen, da ich das gleiche machen
will um Relais für ein Switchpack damit anzusteuern.
Mit den Denkanstößen von hier bin ich am Ende drauf gekommen. Die
Änderungen sind ziemlich übersichtlich.
Vieleicht ist das Problem hier ja noch aktuell ;)
Im Bereich "PWM-Ausgabe" Unterprogramm pwm:
Für alle Känle Die Zeilen "cp tempL, dimm_count" (vergleiche DMX Wert
mit PWM Counter) auskommentieren oder löschen und "cpi tempL, 0x80"
(vgl. DMX mit Konstante) an der gleichen Stelle einfügen. Die Konstante
kann für jeden Kanal unterschiedlich, je nachdem wo der Schaltpunkt hin
soll, angepasst werden (0 bis 255; hier im Beispiel 128)
ld tempL, Z+ ;1
;cp tempL, dimm_count
cpi tempL, 0x80
ror status
Zusätzlich kann zum Umschalten aller Kanäle zwischen low/high aktiv die
Zeile "com status" aus-/einkommentiert werden.
Viele Grüße