Close

Tried new SDHC card and it works

A project log for OSI SD Card Operating System (OSISDOS)

Ohio Scientific / UK101 SD Card based Operating System under Multicomp FPGA Computer

land-boards.comland-boards.com 07/26/2020 at 01:470 Comments

Not sure if there's something wrong with the other SD card, but I tried a couple of other cards and they worked fine. Here's the capture from the BASIC program.

BASIC Code:

 100 REM OSISDOS PROTOTYPE READ SD CARD IN BASIC
 110 SAVE:REM TURN ON LOGGING TO SERIAL PORT
 120 REM SDCARD BASE ADDRESS = $F010 (61456 DEC)
 130 DT=61456:REM SDDAT
 140 ST=61457:REM SDSTATUS/SDCONTROL
 150 A0=61458:REM SDLBA0
 160 A1=61459:REM SDLBA1
 170 A2=61460:REM SDLBA2
 180 DIM MA(512):REM RESERVE ARRAY SPACE FOR SD CARD DATA
 200 REM INPUT THE LBA VALUES AND WRITE TO SD CTRLR REGISTERS
 210 INPUT "LBA0 ";L0
 220 POKE A0,L0
 230 INPUT "LBA1 ";L1
 240 POKE A1,L1
 250 INPUT "LBA2 ";L2
 260 POKE A2,L2
 300 REM CHECK SD CTRLR STATUS, S/B 128
 310 SC=PEEK(ST)
 320 PRINT "SD CTRLR STAT =";SC
 330 IF SC<>128 GOTO 310
 350 REM WRITE 0 TO CONTROL REG FOR READ BLOCK
 360 POKE ST,0
 400 REM WAIT FOR READ VALUE READY
 410 REM READ SD CARD INTO ARRAY
 420 FOR MO=0 TO 511
 430 SV=PEEK(ST)
 440 IF SV <> 224 GOTO 430
 450 MA(MO)=PEEK(DT)
 460 NEXT MO
 500 REM DUMP ARRAY TO SCREEN
 510 FOR I=0 TO 31
 515 SA=(I*16)
 520 FOR J=0 TO 15
 530 DV=MA(SA+J)
 540 GOSUB 600
 560 NEXT J
 570 GOSUB 800 
 580 NEXT I
 590 END
 600 REM PRINT DECIMAL NUMBER AS TWO HEX DIGITS
 610 NB=(DV AND 240)/16
 620 GOSUB 670
 630 NB=DV AND 15
 640 GOSUB 670
 650 PRINT " ";
 660 RETURN
 670 IF NB>9 GOTO 710
 680 VL=NB+48
 690 PRINT CHR$(VL);
 700 RETURN
 710 VL=NB+55
 720 PRINT CHR$(VL);
 730 RETURN
 800 PRINT " ";
 810 FOR OF=SA TO (SA+15)
 820 IF MA(OF)<32 THEN PRINT ".";
 830 IF MA(OF)>126 THEN PRINT ".";
 840 IF MA(OF)>31 AND MA(OF)<127 THEN PRINT CHR$(MA(OF));
 850 NEXT OF
 860 PRINT
 870 RETURN

Discussions