Hallo zusammen, ich habe folgendes Problem: Ich nutze den ATMega32, Bascom und die Lib AVR-DOS Habe meine SD-Card sowohl an den Hardware SPI als auch über SoftSPI angeschlossen, Config-Datei angepasst und gestartet. (Anleitung Minimalbeschaltung lt. Ulrich Radig) Die Anschlüsse mehrmals geprüft, auch Port-Tausch getestet Der Befehl Driveinit() gibt mir Error 225 zurück. (Error response Byte at Reset command) Die Leitungen habe ich mehrmals geprüft. Ist da ein Fehler erkennbar? hier der Code: $regfile = "m32def.dat" $crystal = 16000000 $baud = 19200 $hwstack = 32 $swstack = 10 $framesize = 40 $include "Config_AVR-DOS.bas" $include "Config_MMC.bas" 'disable JTAG Mcusr = &H80 Mcusr = &H80 Ddrd = &B11000000 Dim Ss As String * 60 , Fl As String * 12 , Ff As Byte '-LCD------------------------------------------------------------------- - Config Portc = Output Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5 , E = Portc.7 , Rs = Portc.6 Config Lcdbus = 4 '----------------------------------------------------------------------- - Declare Sub Init Declare Sub Writecard Dim Sw As Byte Dim I As Byte Dim J As Byte Dim S As String * 2 Dim Tmptime As String * 8 Do If Pind.4 = 1 Then Print "Taste Start (schreiben)" Bitwait Pind.4 , Reset Writecard End If Loop End Sub Writecard Dim Xxx As Byte Print "DriveError: " ; Gbdriveerror If Drivecheck() = 0 Then ' card detected Print "DriceCheck is OK" Xxx = Driveinit() If Xxx = 0 Then Xxx = Initfilesystem(1) If Xxx > 0 Then Print "Error: " ; Xxx Else Print "Filesystem successfully initialized" Open "aa.txt" For Output As #1 Print #1 , "lkjlkjlkjlkj" Close #1 End If Else ' Hier springt er rein und gibt DriveINIT Error: 225 Print "DriveINIT Error: " ; Xxx End If Else Print "Card not inserted, check Card!" End If End Sub Return
Antwort schreiben
Bitte melde dich an, um einen Beitrag zu schreiben.