Hello
I bought this module and it doesn’t work!!!
- I use an Atmega1284 (UART0, 9600 Baud) to control the module
- When I insert an SD card, the DISK LED does not light up
- I don’t get feedback from the module when I send a command, but the PROT LED lights up for a short time
- I use CRC16-CCITT as a checksum, okay?
Can the module be defective?
Or what am I doing wrong?!
Pic01|690x366
'±-----------------------------------------------------
'| Titel : SDCard_UART.luna
'±-----------------------------------------------------
'| Funktion : Test-Programm AK-SDFS-UART
'| SD-Karte mit RS232
'| Schaltung : SG4CTRL
'±-----------------------------------------------------
'| Prozessor : ATmega1284
'| Takt : 20MHz
'| Sprache : LunaAVR 2018r2
'| Erstellt am : 02.08.2019
'| Änderung am : 03.08.2019
'| Version : 1.0
'| Autor : Wolfgang Zindler, Haan
'±-----------------------------------------------------
avr.Device = atmega1284p
avr.Clock = 20000000
avr.Stack = 128
'-------------------------------------------------------
’ Library
'-------------------------------------------------------
#library “Library/CRC16.interface”
'-------------------------------------------------------
’ I/O-Konfigurationen
'-------------------------------------------------------
Uart.Interface = Uart1 'SD-Card
Uart1.Baud = 9600
Uart1.Recv.Enable
Uart1.Send.Enable
'-------------------------------------------------------
’ Variable
'-------------------------------------------------------
Dim SD_Dat(10) As Byte
Dim CRC As Word
'-------------------------------------------------------
’ Main-Programm
'-------------------------------------------------------
SD_Dat(1) = &H41 '“A”
SD_Dat(2) = &H4B '“K”
SD_Dat(3) = &H0C 'FATInfo
SD_Dat(4) = 0
SD_Dat(5) = 0
SD_Dat(6) = 0
CRC16.Start
For i = 1 To 6
CRC16.AddByte SD_Dat(i)
Next
CRC = CRC16.Value
For i = 1 To 6
SD_Print SD_Dat(i)
Next
SD_Print CRC
Halt()