Showing posts with label z80. Show all posts
Showing posts with label z80. Show all posts

Thursday, November 12, 2037

About the projects // О проектах

68k project (under construction)
Idea:here
Read by tag:68kavr

Z80 project (considered complete, but will be updated sometimes)
Idea here
Read about Searle Grant's SBC SD interface (and generally CP/M SD implementation) by tag sgsbcsd

Note, that the early records were imported from Livejournal and should be edited by me sometimes later (I bet that will never happen).
Also, some early records may contain some weird letters - that's russian, but it is always translated, do not be afraid.
Also, sometimes I write about some unrelated (even PC!) but weird hardware, some unrelated but weird network technologies, and some weird things. May be even I'll attempt to write a big post about butterflies. If I ever got interested in butterflies.

Wednesday, November 15, 2017

Tiny AVR based project to reset Z80 (or any other CPU) by a serial line

For the modern DIY computers that's normal to be connected by serial port. And in most of cases that's the only way how the communication is made.

But all that Z80 and MC68000 CPUs sometimes HANGS! (Well, do not blame them, blame yourself for a buggy code). But no matter - we have to reset them. And to do that remotely.

So this tiny tool does that: it uses 2 lines from your DIY computer - the reset line and TTL-level RX line of the console. To initiate /RESET, just send break.

You need ATTINY2313, avr-gcc compiler, mm...avrdude and (probably) to edit 2 lines of code in main.c:
#define F_CPU 12000000L
#define BAUD 57600

First is the freq of yours' quarts, the second is the baudrate of your console.

And all that work for me.

Get it all here

Friday, September 5, 2014

Some more news on SGSBCSD

Looks like I have the code working with SDHC. I'll test in in a few days and release 0.00.04/2491.
So my future plans to port it to m68k code and update 68kavr project. UPD: 2491 version of Searle Grant SBC SD interface released. It works!

Wednesday, September 3, 2014

Huge SGSBCSD update - 2490

A lot of bug fixes for my SD interface for Searle Grant's SBC. A loot! If anyone have it installed - update it now

Friday, August 29, 2014

In a few days I plan to release a significant SGSBCSD [SD interface for Z80] code upgrade. At least a lot of bugfixes.
If anyone cares. Or otherwise, I do not care.

Friday, June 27, 2014

QooltermII at version 0.00.02 - first time update scince 1999!

Well
QoolTermII is [partitial] vt52 terminal emulator for Robotron PC 1715 now gets an updated version - 0.00.02. I bet it is the rarest updated software ever!
Now works with IOByte as well (saying, as bad) as with direct SIO.
Get it here

Tuesday, April 23, 2013

Searle Grant's BIOS v1.0 and IOBYTE

Yesturday I've found that at Jan '13 Searle Grant released BIOS v 1.0 with IOBYTE support. And more - that my SGSBCSD is based on previous version. So today I've synced my code and v 1.0 and got something which will be named sgsbcsd2340 or 2350. I have a working code, but I have to ensure it works stable.

Sunday, February 24, 2013

Some notes on accessing track 0 on SGSBCSD

Well, I've told that C000h TPA (strictly speaking, not TPA, but start of CCP) based CP/M image starts from track 0 / sector 0, the C200h system should start from SD offset 200h - i.e. track 0 / sector 1,D000h TPA - from track 0 / sector 8 That leads to a significant problem: everything works until you do not try to rewrite/regenerate CP/M itself inside of SBC, because the changes will we written to track 0 / sector 0 which will led to unusable boot image. So, if you want to do system change inside of SBC - use C000h based systems for now. In future I plan to change the algorythm of accessing track 0. Saying we have C800h TPA system starting from sector 4 and trying to write track 0/sector 0. I will add 4 to sector number so you'll access sector 4 as expected. That will lead to the situation you will not be able to access track 0 sector 0-3 at all. I think this is not a significant loss.

Tuesday, February 5, 2013

Bugfix release 2322

I had an awfull error writing sector. I waited just 255 times for non-zero byte after SD_CMD24 command.
It was wrong. Now I wait for FFFF ticks max - that works with my Apacer 1G card.

I hope next weekend I'll go to the Mitino market and buy a pocket of the most strange SD and MMC cards to test.
The release, as usually, here

UPD: I've attached c-kermit (version 2.2/IOBYTE) on the disk image inside of distribution. And it's even possible to transmit something.
On the CP/M side, tell kermit
set port tty
On unix side, tell your local kermit
set streaming off
and something somehows transmits, but with a huge number of errors. That's a topic to be explored.

Saturday, February 2, 2013

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 после этого заработал в этой схеме.

Monday, December 10, 2012

Searle's Z80 SBC up!

During this winter evenings I've assembled a pure Searle's SBC.
Here is the foto.
It lacks CF card interface still.

It was not so hard - the only thing I had to test all the connections seven times.
I ran it on 2.7Mhz, while it starts on 7, but unstable (I blame the power lines).

Sharps are great processors, Zilogs and even U880 MME (1989, made in DDR) are cool too.
If you have a choice, start with Sharp.

My changes are minimal: I use one quater on one 7432 instead another, I have no soft reset button, extra led on power, reset pullup resistor on 4.7k or 10k and currently playing with resistor on INT leg. And yes, I used Soviet 1533 instead of 74ALS because I have them ;-)

Many thanks to Searle who consulted me via mail!


Зима на дворе, так что я тупо взял и собрал Searleов компутер.
Фотки тут . CFку я туда пока не присобачил.

Это оказалось весьма несложно, только надо все тестером протыкать до посинения, сейчас я гоняю это на 2.7Mhz, оно правда и на 7 заводится, но глючит, я думаю что проблемы с power.

Sharpы крассавы как процы, так что если будете паять - мучайте именно шарпея. У меня также есть родные Zigolи и аж U880 MME сделанный в 1989 году в ГДР .

Изменения в схеме - минимальны: вместо одной половинки 7432 я юзаю другую, на софт ресет забил, led на power, reset через резюк привесил, и чо-та у меня не так с подвешивающим резюком на INT ноге. И насувал туда 1533/555 вместо 74ALS.

Пообщался мыльцем с Searle, он крутой чувак и отвечал по делу.

Sunday, November 18, 2012

Today I've made Z80 to execute the first command. And used Atmega as Z80 debug processor ;-)

First, the idea: burn flash rom (described below) with the trivialest program one can image, install cpu,
install flash, feed the processor with a clock source from ATmega, and install ATmega
as data bus spy - write all the data bus to RS232.

It's easy.


Сегодня Z80 у меня выполнил первую осмысленную программу. И попользовал Atmega как Debug Processor. Надо этот термин запатентовать ;-)
Прожигаем флешку (рассказывал как), и суем туда наипростейшую программулину, суем Z80, сум флешку, кормим ее тиканьем от ATmegавой ноги, и пользуем саму AtMegу как сниффер шины данных.

First, burn flash (AT29C256) with the following :
C3 00 00 FF FF FF FF to the end of chip (JP 0 ; NOP; NOP; NOP ...)

Next, connect data bus from CPU to ROM and port B of the atmega.
Here are legs (Atmega, Z80, 29C256) in triplets:
(14,15,11)(15,15,12)(16,12,13)(17,8,15)
(18,7,16)(19,9,17)(9,10,18)(10,13,19).

Connect address bus from CPU to flash.
Flash: leg 1 - +5, 20 - gnd, 22 OE - to CPU's RD(leg 21);
Cpu: 21 - RD to flash 22 OE and to INT0 of Atmega (leg 4),
22 - WR to INT1 of Atmega (leg 5).
It means that if Z80 reads, it reads from ROM (and causes interrupt on ATmega to read
the data bus, filled by flash), and if it writes, it writes to ATmega by interrupting it on INT1
That also means that *no* address decoding is performed, and no IO/MEM decoding is
performed, too.
So if you do OUT 0x7F,A or LD (0x1488),A - no matter - you write to ATmega.

Burn atmega with the program (attached here somewhere aroud (UPD: at the end of this post!)) and lets try to read it.
It install 4 Interrupt vectors:
ISR(USART_RXC_vect) - doing nothing in this project, do not care.
ISR(TIMER1_COMPA_vect) - blinks led on PORTC 0 and provides clock to Z80
ISR (INT0_vect) - external interrupt, catches RD from Z80.
ISR (INT1_vect) - external interrupt, catches WR from Z80 (I do not care about it, BTW)

But lets start from main().
DDRC = _BV(PC0) ; // Enabling output for LED on leg 23 of atmega
TIMSK = _BV(OCIE1A); // Timer stuff
TCCR1B = _BV(CS12) // 256 prescale
| _BV(WGM12); // CTC mode, TOP = OCR1A
// OCR1A = 825; // count up to TOP 1hz with 8 meg system clock BLINK FAST
OCR1A = 25; // count up to TOP 1hz with 8 meg system clock BLINK FAST
//Install timer of atmega to blink. I do not remember where I got this code - but it works.
/* Com port settings */
USART_Init(MYUBRR);
UCSRB |= (1 << RXCIE); // enable UDRempty intr.

/* Setting IRQ0 handling - read data bus on read */
DDRD &= ~(1 << DDD2); // Declare INT0/PortD 2 as input
PORTD |= (1 << PORTD2); // turn On the Pull-up
MCUCR &= ~(1 << ISC00); // Tell the interrupts to cause on falling edge only
MCUCR |= (1 << ISC01);
GICR |= (1 << INT0); // Turns on INT0
/* Setting IRQ1 handling - read data bus on write */
DDRD &= ~(1 << DDD3); // Clear the PD3 pin
PORTD |= (1 << PORTD3); // turn On the Pull-up
MCUCR &= ~(1 << ISC10); // Oh no, falling edge only
MCUCR |= (1 << ISC11);
GICR |= (1 << INT1); // Turns on INT0
DDRB = 0b00000000; // Configure as input for data bus
static unsigned PROGMEM char b[] = "\n\r**SP: RESETTED**\n\r";
USART_PUTS_my(b);
while(1) {}

And after all we get:
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
That's means the Z80 CPU is working! (if not - short the reset pin on Z80)
And, more, that means we assembled the computer.

Note: it's a very slow computer. It runs around ~10hz, saying because ATmega has to send several bytes over a serial link (4800 baud in this example) while Z80 executes ONE command.
UPD: the code



Шьем флешку (AT29C256) следущим:
C3 00 00 FF FF FF FF to the end of chip (JP 0 ; NOP; NOP; NOP ...)
Распаиваем data bus - триплеты ног (Atmega,Z80,29C256)
(14,15,11)(15,15,12)(16,12,13)(17,8,15)
(18,7,16)(19,9,17)(9,10,18)(10,13,19).

Распаиваем адресную шину от Z80 до флешки.
Далее:
Флешка: нога 1 - +5, 20 - gnd, 22 OE - на CPU's RD(нога 21);
Cpu: 21 - RD к флешкиной 22 OE и на INT0 Atmegи (нога 4),
22 - WR на INT1 Atmegи (нога 5).

Понятно из этого что если проц что-то читает - то из флешки (и дергает ATmegу за INT0, которая радостно читает в этот момент данные которые родила фешка), а если пишет - то вообще безусловно попадает в ATMegа, дергая ее за INT1.

Заливаем а ATMegу программулину (где-то тут надо ее залить (UPD: залил, в конце!)) и давайте читать программулю.
Она устанавливает 4 вектора прерываний:
ISR(USART_RXC_vect) - это щаз нам пох
ISR(TIMER1_COMPA_vect) - моргает ledом на PORTC 0 и клочит Z80на CLK (нога 6)
ISR (INT0_vect) - внешнее перывание, ловит RD от Z80.
ISR (INT1_vect) - внешнее перывание, ловит WR от Z80

Давате почитаем от main()
DDRC = _BV(PC0) ; // Нога 23 - это LED моргалка и клоки для Z80
TIMSK = _BV(OCIE1A); // Timer stuff
TCCR1B = _BV(CS12) // 256 prescale
| _BV(WGM12); // CTC mode, TOP = OCR1A
// OCR1A = 825; // count up to TOP 1hz with 8 meg system clock BLINK FAST
OCR1A = 25; // count up to TOP 1hz with 8 meg system clock BLINK FAST
// Это инициализация таймера. Спер откуда-то, работает.

/* Это ком порт - сеттинги */
USART_Init(MYUBRR);
UCSRB |= (1 << RXCIE); // enable UDRempty intr.

/* Натравливаем INT0 на падение уровня на ноге INT0 */
DDRD &= ~(1 << DDD2); // Declare INT0/PortD 2 as input
PORTD |= (1 << PORTD2); // turn On the Pull-up
MCUCR &= ~(1 << ISC00); // Tell the interrupts to cause on falling edge only
MCUCR |= (1 << ISC01);
GICR |= (1 << INT0); // Turns on INT0
/* То же самое про INT1 */
DDRD &= ~(1 << DDD3); // Clear the PD3 pin
PORTD |= (1 << PORTD3); // turn On the Pull-up
MCUCR &= ~(1 << ISC10); // Oh no, falling edge only
MCUCR |= (1 << ISC11);
GICR |= (1 << INT1); // Turns on INT0
DDRB = 0b00000000; //Объявлем регистр B - вводом, и все его 8 бит будут тырить наш Data Bus

static unsigned PROGMEM char b[] = "\n\r**SP: RESETTED**\n\r";
USART_PUTS_my(b);
while(1) {}

Должны увидеть
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3
READS: 00
READS: 00
READS: C3

Это значит что проц работает - читает комманду JP 0000. (а если нет - то коротните reset на ноге 26 у Z80)
А так же это значит что мы собрали компьютер ;-)

Кстати, заметим, что при этом достаточно тормозной (герц 10). Например потому что atmega должна перекинуть пару байт по rs232 на скорости 4800.

UPD: the code

Saturday, November 17, 2012

Running Z80 in no-nothing mode

Well, it's time to run Z80 in do-nothing mode.
The great news (oh, well, maybe for someone that's really news) that NOP operator in Z80 is exactly FF [UPDATE: FF IS RST38!] since at least Intel i8080 times (4040? 4004? I do not know.).
It means that if we put FF on data bus via pull-up resistors- the CPU will execute NOP, then take the following address, execute NOP, etc, blinking LED on the address bus.
[UPD: It's all wrong. It will execute RST 38, but will blink, yeah. That's because it refreshes memory]
And here is idea.
What I changed:
1) they use 8 resistors from +5 to data bus. Actually, I used one - one side to +5, the other to shorded data bus.
2) they used some weird chip as clock source (what's this? 555 clone? to lazy to find it out), but I used... You know - ATmega8!

The photos: 1, 2

Continued under cut


Ну чо, самая тема запустить Z80 который будет делать нихуя. (кстати это - мое любимое занятие).
Для некоторых может и новость - но это для кого как - что команда Нихуя - NOP - еще со времен как миниум i8080 имеет код FF, за что большое спасибо компании Intel. [UPD: А аффтор-то лошок! FF - это RST 38] То есть если повесить легкий плюс на весь data bus - CPU будет перебирать адресной шиной. Куда я повесил светодиод.
[UPD: Боже, какой я кретин. Но моргать адресными шинами все равно будет - потому что будет рефрешить память]
Основная идея - тут
Разница:
1) у них 8 резюков, я на них сэкономил - повесил один от +5 на всю шину данных, ее замкнул нахуй
2) хрен поймет что у них там за чип в качестве тактового генератора, я, естественно, взял Atmega8.

А теперь - СИСЬКИ! фотки: 1, 2

I assume you have Atmega8 or smth like that on your's breadboard.
On the photo that's a 28 pin chip. It has 2 leds near it, one on leg 23 (PC0 port) via 1kohm resistor to +5, the other is just gnd-to-power via resistor, too.
It has resistor on reset leg 1 to +5. 10kohm, I suppose.
The white/grey cable is (usbasp) programmer. It connect via 10 pin standard connector to MOSI/RESET/SCK/MISO and provides power.
On my board you also see MAX232 (ADM232L) actually, surrounded by capacitors, not used while blinking Z80 bus, but connected to a standard atmega's legs 2/RXD & leg 3/TXD leading to DB9 RS232 socket, and yellow led - connected to address line (leg 30) of the Z80 via transistor.
The scheme of transistor: Z80 leg30 -[resistor 1kohm] - base of pnp transisor. Transistor emitter on gnd, collector to led, the other leg of led on +5.

You can also see an empty 28 pin socket and two red resistors with smth wht looks like a transistor. 20 pin socket will be used for flash ROM later, and the transistor is not a transistor at all but ds18s20 temperature sensor. I just made an thermometer on atmega8, if you are interested - it's here, but not going ds18s20 in Z80 project in the nearest future.

Z80 is connected the following way: leg 11 power, leg 29 gnd, data bus - 7-8-9-10-12-13-14 shorted and via the resistor (10k?) to +5 - YOU *MUST* INSTALL THE RESISTOR, leg 6 to atmega8's leg 23, +5 on 24,16,17,25, leg 30 as described.

The firmware of atmega follows, but it's very simple firmware.


Ну atmega8 у вас на макетке распаяна конечно, у меня это 28 ногий чип. Там 2 светодиода рядом, один на 23 ноге (порт PC0) через килоомный резистор на +5, второй - просто земля-резюк-led-+5.
На ноге 1 (reset) на +5 висит резистор. Наверное 10k.
Серобелый кабель это программатор avrки (usbasp). Там 10 пиновый коннектор на MOSI/RESET/SCK/MISO и с него идет +5 и gnd.
Также на плате у меня видно MAX232 (на самом деле ADM232L, но не ссуть), окруженная кондерами, но в данный момент нас это не интересует. Ну там ноги 2 и 3 atmega8 идут на MAX232, к нему прихерачен ком-порт, а дальше торчит желтый светодиод, который влючен так: Z80 нога30 -[резюк 1kohm] - база 3107. Его эмиттер на земле, коллектор-LED-+5.

Ну там еще кровать на 28 пин неюзанная пока и 2 красных резюка с чем-то похожим на транзюк, хотя это нифига не транзюк, а ds18s20 температурный сенсор. Я его в обозримом будущем в Z80 сувать не собирался, я просто собирал на atmega термометр - получилось такое, кстати.

Z80 соединен так: нога 11 +5, 29 - земля, датабас вся закорочена, нахуй, как я и обещал, от нее торчит резюк (тоже наверное 10k) на +5 и ОН ПРАВДА НУЖЕН БЕЗ НЕГО НИЧЕГО РАБОТАТЬ НЕ БУДЕТ, 6 нога на atmegaвскую 23, +5 на 24,16,17,25,про 30ую я уже сказал.

Фирмваря под atmega, но как бы это совсем простенько.

/*
File: main.c
Version: 1.0.0
Date: May. 12, 2006

AVR Tutorial #1 - Toggle and LED on PC0

Schematic available at http://www.micahcarrick.com.

****************************************************************************
Copyright (C) 2006 Micah Carrick

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#define F_CPU 1000000UL /* 1 MHz Internal Oscillator */

#include <avr/io.h>
#include <inttypes.h>
#include <util/delay.h>

/* function for long delay */
void delay_ms(uint16_t ms) {
while ( ms )
{
_delay_ms(1);
ms--;
}
}

int main (void)
{
/* PC0 is digital output */
DDRC = _BV (PC0);

/* loop forever */
while (1)
{
/* clear PC0 on PORTC (digital high) and delay for 1 Second */
PORTC &= ~_BV(PC0);
delay_ms(200);
PORTC |= _BV(PC0);
delay_ms(200);
}
}

Monday, November 12, 2012

The Aim // Цели

I am going to implement a modern Z80 computer.

The other aim is to learn soldering and gaining practical microelectronics skills

That's how I see it:

The real Z80 chip. Serial only, no video. No floppies or HDD - only flash (CF or MMC). Using avr where it's possible. CP/M.

Plan maximum:
USB hub. TCP via slip or ENC28J60. Optional terminal on avr and LCD.

My limitations:
Only DIP. No EPROM programmer. I'd like to use single-side handmade PCB's

References:
http://searle.hostei.com/grant/ - is not exactly what I want, but very cool.



Почесав седые муди я таки решил забабахать нормальный чоткий современный копм на настоящем проце типа такого:

Реальный Z80.  Только ком-порт. Если у вас нет ком порта - то вы лох! Никаких флоппов и винтов, только CF или MMC. Сувать avrки куда только можно.  Засунуть туда CP/M.

План максимум:
USB hub. TCP через slip или ENC28J60. Может залабаю терминал на avrке и LCDшке.

Ограничения:
Только DIPы и никаких 27xx и РФок - у меня нет программатора и возиться с ним я не хочу. Односторонние (не двух) платы с соплями.

Ссылки:
http://searle.hostei.com/grant/ - тут сидит очень крутой чувак который схерачил почти то что я хочу.


А, ну еще: по ходу я хочу научиться паять и сделать что-то руками, а то я пиздец какой теоретик на попиздить, а рученки кривые. Опять же, хочется похвастаться чем-нибудь.