Live! Status-Telemetrie aus der C-Control

Ein Interrupt-Programm sendet periodisch die Inhalte aus 24 Anwendervariablen, die Pegel der Analog- und Digitalports, den Status von DCF-, Run-, und Active-LED, Autostart-Jumper/Taste, Stand der Echtzeituhr, Stand des BASIC-Programmcounter...


Zur Darstellung des Datenstroms kann das Programm "Telemet" verwendet werden.

Animation mit Messdaten

Instrumentenanordnung für Telemet, C-Control Assemblermodul und BASIC-Programm zur Parametrierung.


Es ähnelt schon fast einem Echtzeit-Debugger, ein "Blick unter die Haube" des Mikrokontrollers sozusagen, während dieser das Anwenderprogramm und reale Eingangsgrößen aus der Umwelt verarbeitet. Das Anwenderpogramm braucht hierfür nicht einmal verändert zu werden. Allerdings wird die Serielle Schnittstelle belegt.

Theoretisch ist auch Erweiterung zum Einzelschrittbetrieb machbar, hier aber noch nicht implementiert. Im Einzelschritt könnte das BASIC- oder CCPLUS- Anwenderprogramm Schritt-für-Schritt unterbrochen werden um die jeweiligen Variablen und Portzustände in Abhängigkeit vom Programmcounter noch feiner analysieren zu können.


Es bringt Spaß, den Vorgängen in der C-Control während der Abarbeitung des Anwenderprogramms zuzusehen!



Aktivierung des Moduls

unter CC-Plus:


Möglichkeit 1:
 
Zuerst das  BASIC-Programm hochladen und 1x starten.

Anschließend das CC-Plus Programm hochladen und starten. Dabei NICHT den Reset-Taster betätigen!

Mit dem RANDOMIZE-Befehl kann die Wiederholrate der automatischen Meßwertübertragung eingestellt werden. Das ist auch wiederholt
 im Programm möglich. Als Parameter sind nur die geradzahligen Werte von  2 bis 250 erlaubt:


CCPLUS-Beispiel Bild 1: Datenausgabe mit mittler Wiederholgeschwindigkeit (100) beginnen. Der Variablenmonitor muß bereits aktiviert sein.


Bei
aktiviertem Variablenmonitor darf im Anwenderprogramm nicht mehr die RAND-Funkiton benutzt werden, da es zu Störungen kommen kann.

CC-Plus Beispiel



Bild2: Ausgabe über die Serielle Schnittstelle beenden. Der Variablenmonitor bleibt jedoch weiterhin aktiv!


Format der Datenausgabe


Stand dieser Bearbeitung: 8.Feb.2009 01:34 (Wiedergefunden am 18.Februar 2020)


Es werden 56 mit gleichbleibender Pause aufeinander folgende Bytewerte gesendet, welche zusammen einen sogenannten Superframe bilden.



-----------------
Beginn Superframe     (Jeder Superframe ist in 4 Subframes unterteilt)
-----------------

  -----------
  1. Subframe   Enthaelt: A/D 1,2 und 3, BASIC-Port P1 bis P4, BASIC-Byte 1 bis 5, FREQ1 & 2 Flags.
  -----------
  Byte Nr.    Inhalt

     1    A/D-Wert (Kanal 1)        Debug Modus:    A/D-Wert (Kanal 1)
     2    A/D-Wert (Kanal 2)        Debug Modus:    A/D-Wert (Kanal 2)
     3    A/D-Wert (Kanal 3)        Debug Modus:    A/D-Wert (Kanal 3)
     4    BASIC-Byte 1              Debug Modus:    A/D-Wert (Kanal 4)
     5    BASIC-Byte 2              Debug Modus:    A/D-Wert (Kanal 5)
     6    BASIC-Byte 3              Debug Modus:    A/D-Wert (Kanal 6)
     7    BASIC-Byte 4              Debug Modus:    A/D-Wert (Kanal 7)
     8    BASIC-Byte 5              Debug Modus:    A/D-Wert (Kanal 8)

     9    Bit 7 = 0 (Pruefbit #1 im 1. Subframe)
                Bit 6 = 0 (Pruefbit #2 im 1. Subframe)
                Bit 5 = x  I/O Port A Bit# 5 (Autostart-Jumper)      7  ( RS232-Eingang CTS )
                Bit 4 = x  I/O Port A Bit# 4 (DCF-LED)               6  ( RS232-Ausgang RTS )
                Bit 3 = x  I/O Port A Bit# 3 (ACT-LED)               BASIC I/O P4
                Bit 2 = x  I/O Port A Bit# 2 (RUN-LED)               BASIC I/O P3
                Bit 1 = x  BASIC I/O P2
                Bit 0 = x  BASIC I/O P1

    10    FREQ1 (Hi-Byte)
    11    FREQ1 (Lo-Byte)

    12    Bit 7 = 1  (Pruefbit #3 im 1. Subframe)
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()
                Bit 3 = x  ()    Minuten des Timercompare
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()


    13    Bit 7 = 0  (Pruefbit #4 im 1. Subframe)
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()
                Bit 3 = x  ()    Sekunden des Timercompare
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()



    14    Bit 7 = x  (reserviert)
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()
                Bit 3 = x  ()    1/100-Sekunden des Timercompare
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()




  -----------
  2. Subframe   Enthaelt: A/D 1,2 und 4, BASIC-Port P5 bis P8, BASIC-Byte 6 bis 10, FREQ2, Echtzeituhr & 2 Flags.
  -----------
  Byte Nr.    Inhalt

     1    A/D-Wert (Kanal 1)     Debug Modus:  BASIC-Byte 1
     2    A/D-Wert (Kanal 2)     Debug Modus:  BASIC-Byte 2
     3    A/D-Wert (Kanal 4)     Debug Modus:  BASIC-Byte 3
     4    BASIC-Byte 6           Debug Modus:  BASIC-Byte 4
     5    BASIC-Byte 7           Debug Modus:  BASIC-Byte 5
     6    BASIC-Byte 8           Debug Modus:  BASIC-Byte 6
     7    BASIC-Byte 9           Debug Modus:  BASIC-Byte 7
     8    BASIC-Byte 10          Debug Modus:  BASIC-Byte 8

     9    Bit 7 = 0 (Pr鴠#1 im 2. Subframe)
                Bit 6 = 1 (Pr鴠#2 im 2. Subframe)
                Bit 5 = x  I/O Port A Bit# 5  ( frei )  Besser: TIME-SET Bit ( #4,$7b )
                Bit 4 = x  I/O Port A Bit# 4  ( DCF OK LED )

                Bit 3 = x  BASIC I/O P8
                Bit 2 = x  BASIC I/O P7
                Bit 1 = x  BASIC I/O P6
                Bit 0 = x  BASIC I/O P5

    10    FREQ2 (Hi-Byte)
    11    FREQ2 (Lo-Byte)

        12    Bit 7 = 1  (Pruefbit #3 im 1. Subframe)
                Bit 6 = x  (reserviert)
                Bit 5 = x  (reserviert)
                Bit 4 = x  (RTC Stunde)
                Bit 3 = x  (RTC Stunde)
                Bit 2 = x  (RTC Stunde)
                Bit 1 = x  (RTC Stunde)
                Bit 0 = x  (RTC Stunde)


    13    Bit 7 = 1  (Pr鴠#4 im 1. Subframe)
                Bit 6 = x  (reserviert)
                Bit 5 = x  (RTC Minute)
                Bit 4 = x  (RTC Minute)
                Bit 3 = x  (RTC Minute)
                Bit 2 = x  (RTC Minute)
                Bit 1 = x  (RTC Minute)
                Bit 0 = x  (RTC Minute)



    14    Bit 7 = x  (reserviert)
                Bit 6 = x  (reserviert)
                Bit 5 = x  (RTC Sekunde)
                Bit 4 = x  (RTC Sekunde)
                Bit 3 = x  (RTC Sekunde)
                Bit 2 = x  (RTC Sekunde)
                Bit 1 = x  (RTC Sekunde)
                Bit 0 = x  (RTC Sekunde)


  -----------
  3. Subframe   Enthaelt: A/D 1,2,5,7 und 8, BASIC-Port P9 bis P12, BASIC-Byte 11 bis 15,21,22 & 2 Flags.
  -----------
  Byte Nr.    Inhalt

     1    A/D-Wert (Kanal 1)           Debug Modus:  BASIC-Byte 9
     2    A/D-Wert (Kanal 2)           Debug Modus:  BASIC-Byte 10
     3    A/D-Wert (Kanal 5)           Debug Modus:  BASIC-Byte 11
     4    BASIC-Byte 11                Debug Modus:  BASIC-Byte 12
     5    BASIC-Byte 12                Debug Modus:  BASIC-Byte 13
     6    BASIC-Byte 13                Debug Modus:  BASIC-Byte 14
     7    BASIC-Byte 14                Debug Modus:  BASIC-Byte 15
     8    BASIC-Byte 15                Debug Modus:  BASIC-Byte 16

     9    Bit 7 = 1 (Pr鴠#1 im 3. Subframe)
                Bit 6 = 0 (Pr鴠#2 im 3. Subframe)
                Bit 5 = x  I/O Port A Bit# 3  ( ACTIVE LED )
                Bit 4 = x  I/O Port A Bit# 2  ( RUN LED )
                Bit 3 = x  BASIC I/O P12
                Bit 2 = x  BASIC I/O P11
                Bit 1 = x  BASIC I/O P10
                Bit 0 = x  BASIC I/O P9

    10    A/D-Wert (Kanal 7)          oder  Byte 50
    11    A/D-Wert (Kanal 8)          oder  Byte 60

        12    Bit 7 = 1  (Pr鴠#3 im 3. Subframe)
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()
                Bit 3 = x  ()
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()


    13    Bit 7 = 1  ()
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()      Byte 21
                Bit 3 = x  ()
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()



    14    Bit 7 = x  ()
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()     Byte 22
                Bit 3 = x  ()
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()



  -----------
  4. Subframe   Enthaelt: A/D 1,2 und 6, BASIC-Port P16 bis P20, BASIC-Byte 16 bis 20,23,24 & 2 Flags.
  -----------
  Byte Nr.    Inhalt

     1    A/D-Wert (Kanal 1)          Debug Modus:  BASIC-Byte 17
     2    A/D-Wert (Kanal 2)          Debug Modus:  BASIC-Byte 18
     3    A/D-Wert (Kanal 6)          Debug Modus:  BASIC-Byte 19
     4    BASIC-Byte 16               Debug Modus:  BASIC-Byte 20
     5    BASIC-Byte 17               Debug Modus:  BASIC-Byte 21
     6    BASIC-Byte 18               Debug Modus:  BASIC-Byte 22
     7    BASIC-Byte 19               Debug Modus:  BASIC-Byte 23
     8    BASIC-Byte 20               Debug Modus:  BASIC-Byte 24

     9    Bit 7 = 1 (Pr鴠#1 im 4. Subframe)
                Bit 6 = 1 (Pr鴠#2 im 4. Subframe)
                Bit 5 = x  I/O Port A Bit# 1  ( I2C SCL )     Besser: Flag Einzelschritt-Modus
                Bit 4 = x  I/O Port A Bit# 0  ( I2C SDA )     Besser: Flag BASIC-Ausfuehrung
                Bit 3 = x  BASIC I/O P16
                Bit 2 = x  BASIC I/O P15
                Bit 1 = x  BASIC I/O P14
                Bit 0 = x  BASIC I/O P13

    10    BASIC-Programmcounter beim Aufruf von Interrupt, Hi-Byte.  (Fuer Debugging im Einzelschritt-Modus)
    11    BASIC-Programmcounter beim Aufruf von Interrupt, Lo-Byte.  (Fuer Debugging im Einzelschritt-Modus)

    12    Bit 7 = 1  (Pr鴠#3 im 4. Subframe)
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()
                Bit 3 = x  ()
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()


    13    Bit 7 = x  ()
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()
                Bit 3 = x  ()       Byte 23
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()




    14    Bit 7 = x  ()
                Bit 6 = x  ()
                Bit 5 = x  ()
                Bit 4 = x  ()      Byte 24
                Bit 3 = x  ()
                Bit 2 = x  ()
                Bit 1 = x  ()
                Bit 0 = x  ()


---------------
Ende Superframe
---------------



 Zur Anpassung an die Geschwindigkeit des ݢertragungs- und Empfangssystems kann der zeitliche Abstand fuer alle
 aufeinander folgenden Bytewerte gemeinsam eingestellt werden.


 Informationen zur Abwaertskompatibilitaet mit dem Windows-Programm 'Telemet 2.09':
 ----------------------------------------------------------------------------------

Die Pause zwischen dem Ende des vorausgehenden und dem Beginn des nachfolgenden SF entspricht der Pause zwischen zwei Bytewerten.


 Bit 7 und Bit 6 enthalten die Nummer des Subframes gemaess nachfolgender Tabelle:
                ---------------
                00 = Subframe 0
                01 = Subframe 1
                10 = Subframe 2
                11 = Subframe 3
                ---------------

 Verwender des Programms Telemet kﯥn ⡤ie Funktion "Senderkennung" die Inhalte der 4 Subframes ausw婬en.



 Die Werte der A/D Kanaele 1 & 2 werden 4 x je Superframe gesendet.



    10    High-Byte des Z婬er-/Frequenzmesserwertes
    11    Low-Byte des Z婬er-/Frequenzmesserwertes

    12    Minuten-/Stundenwert der Stoppuhr


    13    Sekunden-/Minutenwert der Stoppuhr
    14    Hundertstel-/Sekundenwert der Stoppuhr



Byte 12 enth孴 im MSB das Stopflag (kennzeichnet den letzen Datenrahmen
und die Stoppzeit nach dem Low-High-ݢergang am Triggereingang).

Byte 13 enth孴 im MSB das Zeitformatflag der Stoppuhr:

    0 = Minuten:Sekunden:Hundertstel
    1 = Stunden:Minuten:Sekunden



Idee: Einzelschrittausfuehrung des BASIC-Programms (Debugger / Monitor).

      Dazu mittels Timer-Interrupt _moeglichst haeufig_ das Hauptprogramm unterbrechen und in einer Assemblerroutine den
      auf $bb:$bc gespeicherten BASIC-PC mit dem im letzten Durchlauf gespeicherten vergleichen. Wenn PC unveraendert -> RETURN INTERRUPT.
      Wenn PC veraendert -> Dump der Variablen und Portwerte ueber RS232 oder LCD -> $bb:$bc speichern -> Warte auf Taste -> RETURN INTERRUPT.

Nachteil (oder Vorteil, je nach Sichtweise) : Die BASIC-Interruptroutine kann so nicht im Einzelschritt analysiert werden.