Monday, January 28, 2013

Searle Grant's SBC and SD - current status

I have good news. I've implemented read sector, write sector and looks like things work. I haven't implemented reload CCP yet, but this is just a question of time and work - everything is clear for me, currently I have to reload CCP by full reload. Not so good news. TPA will be as low as 48K for the first public version. Only SD (up to 2GB) and MMC will be supported (MMC is unclear; I do not have one, but it should) - I mean no SDHC and SDXC support, bit I think at least SDHC will be added soon. The initial loader will be distributed in .HEX file to be load from terminal from $5000; ROM image - in the nearest future (but after SDHC code)

Sunday, January 13, 2013

Searle Grant's SBC - lets boot from SD

That's easy


Это просто

First, assemble a scheme I described here .
Next, get the file.
Then, let's write something to SD card, saying

org $D000 ; this is the place program will load from the card - do not be confused with $5000!
start:
ld a,'*'
rst 8
jp start
org $FFFE
db $00,$0D ; this is a jump vector address

Assemble, move it to sd card the way ld a,'*' will be the first two bytes, and 00 0D should locate at 2FFE offset.
Under linux, dd is your's friend.
And - type test.out into terminal window and run it by G5000.
You should see how the card is booted and get a lot of *'s.
Warning: the program (loader) generates a HUGE debug info.


Собираем это .
Берем файлец .
Далее, напишем что-нибудь на SD карту, например

org $D000 ; это куда мы будем грузить с карты
start:
ld a,'*'
rst 8
jp start
org $FFFE
db $00,$0D ; это собственно ровно вектор куда прыгать

Ассемблите, пишите на SDшку так что ld a,'*' будут двумя первыми байтами, а 00 0D должны находиться по оффсету 2FFE.
Под linux это делается командой dd.
Далее грузим из терминала test.out и запускаем его командой G5000.
Далее будет видно как оно будет грузится (там КУУУУЧА дебага) и потом должны увидеть кучку звездочек.

Sunday, January 6, 2013

Searle Grant's SBC - lets start with SD

I tried. Trust me, I tried.
But I am unable to make CF interface to work properly.
So I started to implement fn SD interface


Я честно старался, но опять нихуя не вышло!
Короче CF интерефейс компа Searle Grantа у меня нормально не работает, поэтому я решил начать имплементить SD.

The Idea: lets' try to build it.
The Scheme:

The software: here
The results: at least, CF answers properly to "GO IDLE STATE" command
The note: by a strange reason, Z84C0006 (CMOS one) does not hear open collector (yes, inverted) input (at least in my cheme), SHARP LH0080A does. At least for now. And I use 1K resistors instead of 680 ohm resistors - I have no 680 resistors around.
Testing it all:
Plug off SD/MMC, load basic, say
OUT 16,0
check zeroes on triggers.
Repeat OUT 16,7 and OUT 16, anything and check for triggers
Then, shorten data out line to ground and
PRINT INP(16)
Lower bit should be 1 (this is an inverted data)
Leave data NC or plug it somewhere to +5 and repeat, you should get lower bit 0.
If it does not, change CMOS CPU to NMOS.... At least that's what I do for now, that's weird, but I'll think about it later.

As for CF interface, yes, it was very hard to solder it, and ONCE it even loaded, but I mostly got a strange hang after reading sector $38 (I wrote a debug program showing me how does it loads). I've tried to change all the logic chips to HCT, make my wires shorter - same result.

UPD 20130108: The purpose of the led (that should be a RED led) is to drop voltage from +5 to somewhere from +2.8 to 3.3. I saw this recipe in inet, but I do not remember where. Note: before CS goes down, this led will not be turned on.
Keep in mind I run SBC at 2.7 Mhz // 38400 baud, I do not know if this is significant for now
UPD 20130108.2: That's a proper scheme! I'm able to read 512 block from an SD card, but that will be in the other post
UPD 20130114: Install 8 pullup resistors on data bus (4.7k to 5). That's a right idea. After that, Z84C00 works.


Схема:

Софт: тут
Результат: как минимум, CF загоняется в SPI mode командой "GO IDLE STATE" и отвечает правильно
Соображения: Какого то хуя Z84C0006 не слышит моего (да-да, инвертированного) открытого коллектора, а вот SHARP LH0080A - легко и непринудженно. Как минимум в ходе текущих исследований. А, еще я сунул 1k резисторы вместо 680, у меня их прям щаз нет.
Тестирование:
Не суйте СFку, грузаните BASIC, пишите
OUT 16,0
На выходах триггеров ясный пень должны быть нули.
Суньте туда вместо нулей 255, 7 или еще чего-нибудь и посмотрите что там на триггерах.
Теперь закоротите data out (у нас инверсный вход),
PRINT INP(16)
должен в младшем бите показать 1. Выдерните или коротните на +5 - в младшем бите должен быть 0.
Если ничего не получается - поменяйте проц на nmosный, старье какое-нибудь. Ну во всяком случае я сейчас так делаю, потом подумаю как делать не так.

А CFка не работает следующим образом. Кроме того что я заебался ее распаивать, (и, кстати, разочек она так таки загрузилась), она стабильно виснет при чтении сектора $38. Я налабал программку с дебагом чтобы она показывала что она делает - так вот, она показывает именно это. Я менял все чипы на HCTшные, делал провода короткими насколько можно - хуев мне лукошко, а не работающий CF.

UPD 20130108: Светодиод на power линии - это не просто так светодиод (он обязан быть красным), эта штука жрет так чтобы на CFке оказалось от +2.8 до +3.3. Это я спер [как собственно и 90% всего что я делаю] у каких-то чуваков в сети, но забыл где. Кстати, пока не переведете CS вниз, то оно ничего и не жрет.
Еще кстати - я на 2.7Mhz // 38400, не уверен что это все не будет работать на 7Mhz, проверю - отпишу.

UPD 20130108.2: Схема кстати правильная - я смог прочитать блок из 512 байт с SDшки. Но об этом - в следущем посте.
UPD 20130114: 8 резисторов дата - 4.7k - +5 - очень правильная идея. Z84C00 после этого заработал в этой схеме.