Forum: Mikrocontroller und Digitale Elektronik Error 61 Lable not found


von Thomas I. (Gast)


Lesenswert?

Guten Abend,

bin gerade dabei mein externes Sram an einem ATmega 32 anzusteuern aber 
ich
habe arge Probleme mit den Unterprogrammen ich hab mich schon auf den 
Kopf gestellt aber ich versteh nicht warum der Kompiler den Fehler Label 
not found
ausgibt vll könnt ihr meinen fehler erkennen.
Mfg Thomas I.


$regfile = "m32def.dat"
$crystal = 16000000
$hwstack = 50
$swstack = 50
$framesize = 80
$baud = 19200

'Sram Adresse
Config Porta = Output

'Sram Port
Config Portc = Output

'Latch Pin
Config Portb.0 = Output

'Befehlspins
Config Portb = Output
Config Portd.4 = Output
Config Portd.5 = Output
Config Portd.6 = Output
Config Portd.7 = Output

Latchpin Alias Portb.0
Chipselect Alias Portb.3
Sramout Alias Portb.2
Sramwrite Alias Portb.1

Declare Sub Wbyte(byval Var As Byte , Byval Adresse As Word)
Declare Function Rbyte(byval Adresse As Word) As Byte

Dim Zahler As Word
Dim Bufferbyte As Byte
Dim Taste As Byte

Print "S-ram Programm"
Print "Weiter mit Taste"
Taste = Waitkey()

Do
   Bufferbyte = 1
   For Zahler = 1 To 100
      Gosub Wbyte(bufferbyte , Zahler)
      Bufferbyte = Bufferbyte + 2
   Next

Print "Gespeichert"
Wait 1
Print "Lesen"

   For Zahler = 1 To 100
      Bufferbyte = Rbyte(zahler)
      Print Bufferbyte
      Waitms 200
   Next

Print "Gelesen"
Taste = Waitkey()

Loop
End

Sub Wbyte(byval Var As Byte , Byval Adresse As Word)
Local Hnibble As Byte
Local Lnibble As Byte
Config Portc = Output
Latchpin = 0
Chipselect = 0
Sramout = 1
Sramwrite = 1
Lnibble = Lnibble + Adresse
Shift Adresse , Right , 8
Hnibble = Hnibble + Adresse
Porta = Lnibble
Latchpin = 1
Porta = Hnibble
Portc = Var
Sramwrite = 0
Sramwrite = 1
End Sub

Function Rbyte(byval Adresse As Word)
Local Hnibble As Byte
Local Lnibble As Byte
Config Portc = Input
Latchpin = 0
Chipselect = 0
Sramout = 1
Sramwrite = 1
Lnibble = Lnibble + Adresse
Shift Adresse , Right , 8
Hnibble = Hnibble + Adresse
Porta = Lnibble
Latchpin = 1
Porta = Hnibble
Sramout = 0
End Function

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.