Pesquisar este blog

quinta-feira, 12 de fevereiro de 2015

Computador Nestor 2

NESTOR 2

Faltava eu colocar mais informações e fotos sobre o Nestor 2, projeto de microcomputador com Z80 da revista Nova Eletrônica, com repaginação do Victor Trucco e firmware adaptado pelo Fábio Belavenuto.

Inicialmente eu até tentei montar e testar em protoboard, mas não funcionou a tentativa. Além de ficar muito confuso e sujeito a falhas e mau contato. Vejam a bagunça:
Começou a faltar fiozinho pra fazer as ligações e meu protoboard não foi suficiente para colocar as teclas, portanto o que me levou a montar o Nestor 2 na placa de circuito impresso.

As fotos a seguir são da sequência de montagem:
 
 Placa com os resistores soldados.

Com os botões colocados.

 
Colocação dos soquetes de cis e para os displays e jacks do cassete.

Com os displays de sete segmentos (vermelhos).


 
Quase no final, com os transistores.

Com o conector de força e o cristal (soquetado).
Cristal de 4MHz.


Placa toda montada, com os integrados e ligada com os displays vermelhos. Na verdade, eles ficaram muito fracos na luminosidade, então substitui pelos verdes que vieram no kit, e que são de brilho mais intenso.


A seguir, mostro algumas das funções e como funciona o teclado:
Existem 24 teclas: 16 com os dígitos hexadecimais de 0 a F, e 7 teclas para funções. A primeira tecla é a "P" de permissão. Ela serve para entramos com dados de endereço. Ao apertarmos P, os quatro dígitos da esquerda e os dois da direita se apagam e podemos entrar com um endereço de 4 dígitos hexadecimais ($0000 a $FFFF, ou 0 a 65535 decimal, que é o máximo de endereços de memória que o Z80 pode acessar). Digitando 0000, e em seguida apertamos "L" de leitura, podemos ver o dado nessa posição de memória.


Nestor com displays verdes e mostrando o conteúdo do endereço $0000, que tem $31 (EPROM). Podemos alterar o conteúdo da posição de memória (desde que seja RAM), apenas digitando-se os novos dados no teclado. As informações digitadas correm da direita para esquerda continuamente, de forma que não é necessário se apagar se houver erro na digitação.

As teclas -1 e +1 apenas decrementam ou incrementas a posição de memória em uma posição. 
Apertando +1, o endereço aumenta de 1.





A tecla "R" faz rodar o programa em assembly que estiver no endereço de memória mostrado no display. Esse é um programa na EPROM que mostra uma palavra.

 A tecla "ER" faz com que o conteúdo dos registradores internos do Z80 sejam mostrados.
Inicialmente o valor do registrador A (acumulador).

Apertando ER novamente, mostra o registrador B.

Mais uma vez o ER, e aparece o registrador C. Em sequência serão apresentados os registradores D, E, H, L, F (flags) e I, depois retornando ao acumulador.

 Por fim, a tecla IV, é para definir uma interrupção vetorizada.


Quem precisa de Raspberry Pi ou Arduino ? Isso é para os fracos. Os fortes programam em assembly,  digitando diretamente os opcodes em hexadecimal na mão (he he he).


Até é possível fazer montagens experimentais e interligação com protoboard (como fazem com Arduino e Raspberry Pi) graças ao conector em barra com os sinais do Z80 disponíveis.

Aqui os esquemas do Nestor:
Circuito de geração de clock, circuito de reset e pullups de alguns pinos do Z80. Como eu coloquei um soquete para o cristal, isso permite que eu mude a frequência do clock apenas trocando o cristal. Eu coloquei um cristal de 2MHz para testar alguns Z80 (de 2,5MHz de clock máximo) e com o Z80A deixei com cristal de 4MHz (o original da revista era um de 3,58MHz).

As memórias usadas foram uma 2732 de 4kbytes em EPROM e uma RAM estática 62256 de 32 kbytes.

Circuito de decodificação e seleção de memórias e entrada e saída. O 74LS138 decodifica e seleciona quais chips de memória serão acessados. Os sinais de entrada são: endereços de A13 a A15 e MREQ (pedido de memória). Isso significa que o 74LS138 aciona blocos de memória de 8kbytes em cada saída. A primeira saída aciona a EPROM de 4kbytes ($0000 a $0FFF) sendo que a EPROM fica espelhada nos endereços de $1000 a $1FFF). A RAM fica no espaço de endereços de $2000 a $9FFF, para isso 4 saídas do 74LS138 são combinadas com portas E do 74LS08.

A habilitação de entrada e saída é feita combinado os sinais IORQ (pedido de entrada e saída) com os sinais WR e RD (write e read).

Circuitos de portas de entrada e saída, habilitadas pelos sinais combinados no esquema anterior. Para isso as entradas passam por buffers tri state 74LS126 e os dados de saída ficam disponíveis e guardados em latches 74LS75. Existem dois barramentos de acesso na placa.

Circuito do teclado matricial, acionado por portas de entrada semelhantes ao esquema anterior e usando buffers tri state 74LS126.

Circuito dos displays de catodo comum multiplexados.

Circuito da interface de cassete (gravação e leitura) e do alto falante.

E aqui o firmware a ser gravado na EPROM com o programa monitor básico e de cassete.
:1000000031009CC5D5E5F521E69B36192169001123
:10001000E79B010600EDB031E49B21E79B06001E43
:10002000063E01CD960079871DC2230078FE00CAE6
:10003000170021E79BCDA2007AD303DB01FE00C2AB
:100040003200CDC300CDDE00FE17C25000C3000851
:10005000FE15CA7D00FE10DA8900CDF60021E69B70
:100060007EC36F000000C3F29BC8869287C0CE217A
:100070003203856F7E4F3E0A856F6E61E921E69BF4
:100080007EFE15CAF601C35A0021E69B7EFE15CA04
:10009000070200C35D004FCDAF00DB01FE00C84783
:1000A00051C90E063E01CDAF00870DC8C3A600F5AD
:1000B000D3037ED301D91100011B7AB3C2B900D991
:1000C00023F1C90E003E01BACADC00870E08BACA85
:1000D000DC00870E10BACADC00C3170051C91E0825
:1000E0000E003E01B8CAF1000C871DC2E400C31720
:1000F0000079824700C921E69B70C90E0621E69B64
:10010000361721E79B36FF230DC205013600233643
:1001100000233600C3170021EE9B78ED6F23ED6FAF
:10012000CD5A01C31700CD480121E69B361821EFB7
:100130009BCD5A01C31700CD480178ED6F7E122187
:10014000EF9BCD5A01C3170021EE9B5E23561A2B5D
:100150002B77E521E69B3618E1C901E79BCD7601B7
:100160002BCD76012BCD7601C921EE9B7323722B0B
:100170002B1A77C9FFFF7EE521F09B77AFED6FCD9E
:100180008E010203AFED6FCD8E010203E1C9D511DF
:100190009701835F1AD1C9C0F9A4B0999282F880FF
:1001A000908883C6A1868ECD480113CD690121EFC9
:1001B0009BCD5A01C31700CD48011BCD690121EF2A
:1001C0009BCD5A01C31700FFFFFF3EFFD3033E7FC5
:1001D000D30121ED9B36C331F89BF5E5D5C531E45C
:1001E0009BC3ED9B21E59B36FEC3F60121E79B36C1
:1001F000FF2336FF23C911060321E59B34347B8698
:100200005F1A6F131A67E921E59B111D037B86C3F3
:100210000002CDEC0136882336B721F99BC32002BA
:1002200001EB9BCD7601C3170021F99B78ED6FC3DD
:100230002002CDEC0136832336B721FF9BC3200279
:1002400021FF9B78ED6FC32002CDEC0136C623362B
:10025000B721FE9BC3200221FE9B78ED6FC32002D5
:10026000CDEC0136A12336B721FD9BC3200221FD31
:100270009B78ED6FC32002CDEC0136862336B72183
:10028000FC9BC3200221FC9B78ED6FC32002CDECC8
:100290000136892336B721FB9BC3200221FB9B78C3
:1002A000ED6FC32002CDEC0136C72336B721FA9B90
:1002B000C3200221FA9B78ED6FC32002CDEC0136FA
:1002C0008E2336B721F89BC3200221F89B78ED6F6F
:1002D000C32002ED5721F79B77CDEC0136F9233689
:1002E000B721F79BC3200221F79B78ED6F7EED4786
:1002F000C3200201F29B3EC3020321EE9B7E020358
:10030000237E02C317001202320249026002770202
:100310008E02A502BC02D3021A03C3E401290240E3
:100320000257026E0285029C02B302CA02E702FF74
:10033000FFFF0000000000000000000000000000BF
:10034000000000010101010102010100FB26B7A725
:10035000CAE4F31737170000000000000000000097
:10036000000000000000000000000000000000008D
:10037000000000000000000000000000000000007D
:10038000000000000000000000000000000000006D
:10039000000000000000000000000000000000005D
:1003A000000000000000000000000000000000004D
:1003B000000000000000000000000000000000003D
:1003C000000000000000000000000000000000002D
:1003D000000000000000000000000000000000001D
:1003E000000000000000000000000000000000000D
:1003F00000000000000000000000000000000000FD
:1004000000000000000000000000000000000000EC
:1004100000000000000000000000000000000000DC
:1004200000000000000000000000000000000000CC
:1004300000000000000000000000000000000000BC
:1004400000000000000000000000000000000000AC
:10045000000000000000000000000000000000009C
:10046000000000000000000000000000000000008C
:10047000000000000000000000000000000000007C
:10048000000000000000000000000000000000006C
:10049000000000000000000000000000000000005C
:1004A000000000000000000000000000000000004C
:1004B000000000000000000000000000000000003C
:1004C000000000000000000000000000000000002C
:1004D000000000000000000000000000000000001C
:1004E000000000000000000000000000000000000C
:1004F00000000000000000000000000000000000FC
:1005000000000000000000000000000000000000EB
:1005100000000000000000000000000000000000DB
:1005200000000000000000000000000000000000CB
:1005300000000000000000000000000000000000BB
:1005400000000000000000000000000000000000AB
:10055000000000000000000000000000000000009B
:10056000000000000000000000000000000000008B
:10057000000000000000000000000000000000007B
:10058000000000000000000000000000000000006B
:10059000000000000000000000000000000000005B
:1005A000000000000000000000000000000000004B
:1005B000000000000000000000000000000000003B
:1005C000000000000000000000000000000000002B
:1005D000000000000000000000000000000000001B
:1005E000000000000000000000000000000000000B
:1005F00000000000000000000000000000000000FB
:1006000000000000000000000000000000000000EA
:1006100000000000000000000000000000000000DA
:1006200000000000000000000000000000000000CA
:1006300000000000000000000000000000000000BA
:1006400000000000000000000000000000000000AA
:10065000000000000000000000000000000000009A
:10066000000000000000000000000000000000008A
:10067000000000000000000000000000000000007A
:10068000000000000000000000000000000000006A
:10069000000000000000000000000000000000005A
:1006A000000000000000000000000000000000004A
:1006B000000000000000000000000000000000003A
:1006C000000000000000000000000000000000002A
:1006D000000000000000000000000000000000001A
:1006E000000000000000000000000000000000000A
:1006F00000000000000000000000000000000000FA
:1007000000000000000000000000000000000000E9
:1007100000000000000000000000000000000000D9
:1007200000000000000000000000000000000000C9
:1007300000000000000000000000000000000000B9
:1007400000000000000000000000000000000000A9
:100750000000000000000000000000000000000099
:100760000000000000000000000000000000000089
:100770000000000000000000000000000000000079
:100780000000000000000000000000000000000069
:100790000000000000000000000000000000000059
:1007A0000000000000000000000000000000000049
:1007B0000000000000000000000000000000000039
:1007C0000000000000000000000000000000000029
:1007D0000000000000000000000000000000000019
:1007E0000000000000000000000000000000000009
:1007F00000000000000000000000000000000000F9
:100800003E0032599B214B0A115A9B010600EDB064
:10081000215A9B06001E063E01CD960079871D20B9
:10082000F878FE0028EA215A9BCDA2007AD303DB98
:1008300001FE0020F1CDC300CDDE00FE14CA640825
:10084000FE103810FE132803C310083A599BFE000F
:10085000CA5B09C73A599BFE00282FFE012830FECB
:10086000022831C73A599BFE002809FE012810FED4
:10087000022844C721510A3E0132599BC30808216E
:10088000570A3E0232599BC3080821509B18082181
:10089000529B180321549B3EFF325E9B325F9B7834
:1008A000E5ED6F23ED6F015C9BE1CD760123015AED
:1008B0009BCD7601C310083EFFD3033EF7D301CD95
:1008C000EC08DA2F0A32569B21A00FCD43092150A4
:1008D0009B010700CD0C0921D007CD4709CDF908B0
:1008E000CD0C0921A00FCD4709C3370ACDF908D88F
:1008F000AF86EDA1EAF108B7C921529B5E235623CA
:100900004E236669B7ED524D4403EBC95ECD16091F
:10091000EDA1EA0C09C91608B7CD2909CB1BCD29D1
:10092000091520F837CD2909C9D9260038092E081C
:10093000CD47092E0218072E04CD47092E04CD43BA
:1009400009D9C90E9A18020E40291101003EFFD3A1
:10095000044110FEEE01ED5220F5C93EFF325E9BD0
:10096000325F9B2A509B22579B3EFFD3033EBFD34F
:100970000121E803CDD70938F02B7CB520F6CDD77F
:100980000930FB21509B010700CDF40938DB015CE5
:100990009B21509BCD760123015A9BCD7601ED5BC7
:1009A000509B0620215A9BCDA20010F82A579B008D
:1009B000B7ED52C269093EFFD3033EFED301CDF924
:1009C00008DA2F0ACDF409DA2F0ACDEC0821569B5C
:1009D000BEC22F0AC3370A110000DB0213CB1F3837
:1009E000F93E00D304DB0213CB1F30F93EFFD304E2
:1009F0007BFE42C9AF08CD010A73EDA1EAF60908F2
:100A0000C9CD120A1608CD120ACB1B1520F8CD123B
:100A10000AC9D9210000CDD70938062D2DCBC4181D
:100A2000F52CCB4428F0CB15D9C9083708D9C921F2
:100A30003F0ACDA20018F821450ACDA20018F88679
:100A4000CECEC0FFFF8EF9C8FFFFFF87F987C1C771
:100A5000C08EC0C88786FF8EF9C888C7FF00000017
:100A60000000000000000000000000000000000086
:100A70000000000000000000000000000000000076
:100A80000000000000000000000000000000000066
:100A90000000000000000000000000000000000056
:100AA0000000000000000000000000000000000046
:100AB0000000000000000000000000000000000036
:100AC0000000000000000000000000000000000026
:100AD0000000000000000000000000000000000016
:100AE0000000000000000000000000000000000006
:100AF00000000000000000000000000000000000F6
:100B000000000000000000000000000000000000E5
:100B100000000000000000000000000000000000D5
:100B200000000000000000000000000000000000C5
:100B300000000000000000000000000000000000B5
:100B400000000000000000000000000000000000A5
:100B50000000000000000000000000000000000095
:100B60000000000000000000000000000000000085
:100B70000000000000000000000000000000000075
:100B80000000000000000000000000000000000065
:100B90000000000000000000000000000000000055
:100BA0000000000000000000000000000000000045
:100BB0000000000000000000000000000000000035
:100BC0000000000000000000000000000000000025
:100BD0000000000000000000000000000000000015
:100BE0000000000000000000000000000000000005
:100BF00000000000000000000000000000000000F5
:100C000000000000000000000000000000000000E4
:100C100000000000000000000000000000000000D4
:100C200000000000000000000000000000000000C4
:100C300000000000000000000000000000000000B4
:100C400000000000000000000000000000000000A4
:100C50000000000000000000000000000000000094
:100C60000000000000000000000000000000000084
:100C70000000000000000000000000000000000074
:100C80000000000000000000000000000000000064
:100C90000000000000000000000000000000000054
:100CA0000000000000000000000000000000000044
:100CB0000000000000000000000000000000000034
:100CC0000000000000000000000000000000000024
:100CD0000000000000000000000000000000000014
:100CE0000000000000000000000000000000000004
:100CF00000000000000000000000000000000000F4
:100D000000000000000000000000000000000000E3
:100D100000000000000000000000000000000000D3
:100D200000000000000000000000000000000000C3
:100D300000000000000000000000000000000000B3
:100D400000000000000000000000000000000000A3
:100D50000000000000000000000000000000000093
:100D60000000000000000000000000000000000083
:100D70000000000000000000000000000000000073
:100D80000000000000000000000000000000000063
:100D90000000000000000000000000000000000053
:100DA0000000000000000000000000000000000043
:100DB0000000000000000000000000000000000033
:100DC0000000000000000000000000000000000023
:100DD0000000000000000000000000000000000013
:100DE0000000000000000000000000000000000003
:100DF00000000000000000000000000000000000F3
:100E000000000000000000000000000000000000E2
:100E100000000000000000000000000000000000D2
:100E200000000000000000000000000000000000C2
:100E300000000000000000000000000000000000B2
:100E400000000000000000000000000000000000A2
:100E50000000000000000000000000000000000092
:100E60000000000000000000000000000000000082
:100E70000000000000000000000000000000000072
:100E80000000000000000000000000000000000062
:100E90000000000000000000000000000000000052
:100EA0000000000000000000000000000000000042
:100EB0000000000000000000000000000000000032
:100EC0000000000000000000000000000000000022
:100ED0000000000000000000000000000000000012
:100EE0000000000000000000000000000000000002
:100EF00000000000000000000000000000000000F2
:100F000000000000000000000000000000000000E1
:100F100000000000000000000000000000000000D1
:100F200000000000000000000000000000000000C1
:100F300000000000000000000000000000000000B1
:100F400000000000000000000000000000000000A1
:100F50000000000000000000000000000000000091
:100F60000000000000000000000000000000000081
:100F70000000000000000000000000000000000071
:100F80000000000000000000000000000000000061
:100F90000000000000000000000000000000000051
:100FA0000000000000000000000000000000000041
:100FB0000000000000000000000000000000000031
:100FC0000000000000000000000000000000000021
:100FD0000000000000000000000000000000000011
:100FE0000000000000000000000000000000000001
:100FF00000000000000000000000000000000000F1
:00000001FF