- LiFePO4 Speicher Test         
Ergebnis 1 bis 10 von 22

Thema: lichtleiste progrmmieren

Hybrid-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #1
    Benutzer Stammmitglied
    Registriert seit
    27.10.2008
    Beiträge
    50
    Danke für Eure Hilfe.

    Also das ich den Zustand des Ports immer nur neu setze, dem war ich mir bewusst.

    Mein erster Versuch für einen Atmel sieht so aus:
    Code:
    $regfile "m8def.dat"
    $crystal = 1000000
    
    Config Portc = Output
    
    Do
      Portc.0 = 1 : Portc.1 = 0 : Portc.2 = 0 : Portc.3 = 0 : Portc.4 = 1
      Waitms 1000 :
      Portc.0 = 0 : Portc.1 = 1 : Portc.2 = 1 : Portc.4 = 0
      Waitms 1000
      Portc.2 = 0 : Portc.3 = 1
      Waitms 1000
      Portc.0 = 1
      Waitms 1000
      Portc.0 = 0 : Portc.2 = 1 : Portc.3 = 0 : Portc.4 = 1
      Waitms 1000
      Portc.2 = 0 : Portc.4 = 0
      Waitms 1000
      Portc.1 = 0 : Portc.3 = 1
      Waitms 1000
      Portc.1 = 1
      Waitms 1000
      Portc.3 = 0 : Portc.4 = 1
      Waitms 1000
      Portc.0 = 1 : Portc.4 = 0
      Waitms 1000
      Portc.0 = 0 : Portc.2 = 1 : Portc.3 = 1
      Waitms 1000
      Portc.2 = 0
      Waitms 1000
      Portc.0 = 1 : Portc.1 = 0 : Portc.3 = 0 : Portc.4 = 1
      Waitms 1000
      Portc.0 = 0 : Portc.1 = 1 : Portc.2 = 1 : Portc.4 = 0
      Waitms 1000
      Portc.0 = 0 : Portc.1 = 1 : Portc.2 = 1 : Portc.4 = 0
      Waitms 1000
      Portc.2 = 0 : Portc.3 = 1 :
      Waitms 2000
      Portc.3 = 0 : Portc.4 = 1
      Waitms 1000
      Portc.4 = 1
      Waitms 1000
      Portc.0 = 1 : Portc.1 = 0 : Portc.3 = 1
      Waitms 1000
      Portc.0 = 0 : Portc.1 = 1 : Portc.2 = 1 : Portc.4 = 0
      Waitms 1000
      Portc.2 = 0 : Portc.3 = 0 : Portc.4 = 1
      Waitms 1000
      Portc.0 = 1 : Portc.4 = 0
      Waitms 1000
      Portc.0 = 0 : Portc.2 = 1 : Portc.3 = 1
      Waitms 1000
      Portc.3 = 0
      Waitms 1000
      Portc.1 = 0 : Portc.3 = 0 : Portc.4 = 1
      Waitms 1000
      Portc.1 = 1 : Portc.4 = 0
      Waitms 1000
      Portc.3 = 1
      Waitms 1000
      Portc.0 = 1
      Waitms 1000
      Portc.0 = 0 : Portc.2 = 1 : Portc.3 = 0 : Portc.4 = 1
      Waitms 1000
      Portc.2 = 0 : Portc.4 = 0
      Waitms 1000
      Portc.0 = 1 : Portc.1 = 0 : Portc.3 = 1
      Waitms 1000
      Portc.0 = 0 : Portc.1 = 1 : Portc.2 = 1
      Waitms 1000
      Portc.2 = 0 : Portc.3 = 0 : Portc.4 = 1
      Waitms 1000
      Portc.4 = 0
      Waitms 1000
      Portc.3 = 1
      Waitms 2000
    
    Loop
    ich habe also nur den erstzutsand definiert und habe dann nur die Veränderungen Programmiert.

    Dieses sind aber nur 5 der 9 Ports und der 7,5 sekunden ist auch nicht dabei. das sind 36 Takte. Hier sagt mir Bascom ich hätte bereits 6 % des Speichers benötigt. Da es aber nur 1/10 der Takte eigentlich sogar nur 1/20 der Takte(halbsekundentakte sind ja auch dabei) und auch nur für 5 statt für 9 Ports ist konnte ich also Hochrechnen, das ich mit dem Speicher nicht klarkomme.

    Zu den Takten selbst
    Es sind zwei unterschiedliche Takte a 15 Sekunden 3 unterschiedliche a 4 Sekunden , einer mit 5, einer mit 6, einer mit 7,5 und einer mit 9 Sekunden

    also ist die Taktfolge für einen Durchlauf aller Takte
    Code:
    Sekunde	C-4	C-3	C-2	C-1	C-0	c-5	c-6	c-7	b-0
    0,5	1	0	0	0	1	1	0	1	1
    1	1	0	0	0	1	1	0	1	1
    1,5	0	0	1	1	0	0	1	0	1
    2	0	0	1	1	0	0	1	0	1
    2,5	0	1	0	1	0	0	1	0	0
    3	0	1	0	1	0	0	1	0	0
    3,5	0	1	0	1	1	0	1	1	0
    4	0	1	0	1	1	0	1	1	0
    4,5	1	0	1	1	0	0	1	0	0
    5	1	0	1	1	0	0	1	0	0
    5,5	0	0	0	1	0	0	0	0	1
    6	0	0	0	1	0	0	0	0	1
    6,5	0	1	0	0	0	0	1	0	1
    7	0	1	0	0	0	0	1	0	1
    7,5	0	1	0	1	0	1	1	1	0
    8	0	1	0	1	0	1	1	1	0
    8,5	1	0	0	1	0	0	1	0	0
    9	1	0	0	1	0	0	1	0	0
    9,5	0	0	0	1	1	0	1	0	0
    10	0	0	0	1	1	0	1	0	0
    10,5	0	1	1	1	0	0	0	0	0
    11	0	1	1	1	0	0	0	0	0
    11,5	0	1	0	1	0	0	1	0	0
    12	0	1	0	1	0	0	1	0	0
    12,5	1	0	0	0	1	0	1	0	0
    13	1	0	0	0	1	0	1	0	0
    13,5	0	0	1	1	0	0	1	0	0
    14	0	0	1	1	0	0	1	0	0
    14,5	0	1	0	1	0	0	1	0	0
    15	0	1	0	1	0	0	1	0	0
    15,5	0	1	0	1	0	1	0	1	1
    16	0	1	0	1	0	1	0	1	1
    16,5	1	0	0	1	0	0	1	0	1
    17	1	0	0	1	0	0	1	0	1
    17,5	0	0	0	1	0	0	1	0	0
    18	0	0	0	1	0	0	1	0	0
    18,5	0	1	0	0	1	0	1	1	0
    19	0	1	0	0	1	0	1	1	0
    19,5	0	1	1	1	0	0	1	0	0
    20	0	1	1	1	0	0	1	0	0
    20,5	1	0	0	1	0	0	0	0	1
    21	1	0	0	1	0	0	0	0	1
    21,5	0	0	0	1	1	0	1	0	1
    22	0	0	0	1	1	0	1	0	1
    22,5	0	1	1	1	0	1	1	1	0
    23	0	1	1	1	0	1	1	1	0
    23,5	0	1	0	1	0	0	1	0	0
    24	0	1	0	1	0	0	1	0	0
    24,5	1	0	0	0	0	0	1	0	0
    25	1	0	0	0	0	0	1	0	0
    25,5	0	0	0	1	0	0	0	0	0
    26	0	0	0	1	0	0	0	0	0
    26,5	0	1	0	1	0	0	1	0	0
    27	0	1	0	1	0	0	1	0	0
    27,5	0	1	0	1	1	0	1	0	0
    28	0	1	0	1	1	0	1	0	0
    28,5	1	0	1	1	0	0	1	0	0
    29	1	0	1	1	0	0	1	0	0
    29,5	0	0	0	1	0	0	1	0	0
    30	0	0	0	1	0	0	1	0	0
    30,5	0	1	0	0	1	1	0	1	1
    31	0	1	0	0	1	1	0	1	1
    31,5	0	1	1	1	0	0	1	0	1
    32	0	1	1	1	0	0	1	0	1
    32,5	1	0	0	1	0	0	1	0	0
    33	1	0	0	1	0	0	1	0	0
    33,5	0	0	0	1	0	0	1	1	0
    34	0	0	0	1	0	0	1	1	0
    34,5	0	1	0	1	0	0	1	0	0
    35	0	1	0	1	0	0	1	0	0
    35,5	0	1	0	1	0	0	0	0	1
    36	0	1	0	1	0	0	0	0	1
    Die Darstellung hier finde ich nicht sehr vorteilhaft, daher habe ich Sie noch als Excel-Tabelle angefügt.

    Wobei ich dazu sagen muss dieses Projekt ist mein erstes dieser Art und meine Programmiererfahrung ist ein halbes Jahr Programmierung eineml die Woche 90 Minuten in der Schule in Turbopascal vor 15 Jahren und noch länger her die Programmierung in Basic vor 18 Dort haben wir aber auch zum Beispiel Lauflichter direkt an der paralelen Schnittstelle programmiert.

    mit mikroControllern ist das die erste Berührung.

    Eigentlich sollte das ganze über NE 555 gebaut werden, aber den takt C-7 habe ich damit nicht geschafft. Daher die Sache mit dem Controller zumal dder Platinenbedarf hinter dem Bild so nur ein bruchteil beträgt.[/code]

    Edit ich musste den Code etwas einkürzen, da ich über die Zeichenbegrenzug des Postes gekommen bin
    Angehängte Dateien Angehängte Dateien

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

fchao-Sinus-Wechselrichter AliExpress