Code:
'SD CARD ROUTINES
    SD_WRITE:
    CIU = 1
    SDINIT:
    ' FSInit initializes the card and reads all the preliminary information from it
    GOSUB FSInit
    IF (FAT_error != 0) THEN STOP
Create a BLINK routine to blink an LED.
Change the above THEN STOP to THEN BLINK.
We need to see if you are getting an error. Better yet, send the error to a display to see what it is.