Monday, November 23, 2020

Reader of vintage PAL (next)

As I presented in a previous post, I wanted to make a small application capable of reading old PLDs in a simple way. I didn't want to venture into creating a controllable USB interface with a PC. Too complicated and too time consuming, especially with Windows programming. I could have used an Arduino-based system as well, but the DIY 'side' didn't really inspire me. I preferred to use a more 'serious' system. So I decided to use the powerful COLOR MAXIMITE 2 microcomputer as a base.


This system uses a powerful Basic interpreter and allows easy use of files on SDcard.

To be able to physically read several types of PAL, I developed a small interface, based on the computer's I / O connector. The circuit is very simple and is based around the use of the SPI bus associated with a MCP23S17 type port expander from Microchip.


Nothing very complicated on this circuit. In fact, it is possible to obtain a printed circuit board of reduced size which connects directly to the port of the CMM2.


The PCB, once made and equipped with all the components, looks like this:


The PCB is fairly easy to build despite a few surface mount components. I am thinking of putting this small development in open access but have not yet decided in what form.

Once this extension has been completed, and the first operational tests with the CMM2 computer validated, I was able to write the first program. In order to not complicate this first program, I deliberately 'restricted' its use to 10in / 8out type PAL, such as 10H8.

' PAL READER CONFIGURATION : 10 INPUTS, 8 OUTPUTS
' -----------------------------------------------------------------------------
' Signals defines
CONST CS  = 27  ' /CS for the MCP
CONST C0  = 29  ' PIN no 1
CONST C1  = 31  ' PIN no 11
CONST RST = 33  ' /RST for the MCP
CONST PWR = 7   ' Power signal for the board
CONST DLY = 1   ' Value of temporisation for SPI chronos
'
' Abstract for the PAL
' --------------------
' PIN no 1  : C0 (I)
' PIN no 2  : A7 (I) [BUS GPAx of the MCP]
' PIN no 3  : A6 (I)          //
' PIN no 4  : A5 (I)          //
' PIN no 5  : A4 (I)          //
' PIN no 6  : A3 (I)          //
' PIN no 7  : A2 (I)          //
' PIN no 8  : A1 (I)          //
' PIN no 9  : A0 (I)          //
' PIN no 11 : C1 (I)
' PIN no 12 : B7 (O) [BUS GPBx of the MCP]
' PIN no 13 : B6 (O)          //
' PIN no 14 : B5 (O)          //
' PIN no 15 : B4 (O)          //
' PIN no 16 : B3 (O)          //
' PIN no 17 : B2 (O)          //
' PIN no 18 : B1 (O)          //
' PIN no 19 : B0 (o)          //
'
' Globales variables init
TYPE$  = "10IN 8OUT"
ADDR_X = 1023        ' 1024 possibilities
PORT_A = &B00000000  ' GPBA => OUTPUT     
PORT_B = &B11111111  ' GPBB => INPUT
FILE_$ = "Pld type: " + TYPE$ + " at: " + DATETIME$(NOW)
' Signals configuration and INIT. 
'
' *** IMPORTANT : Respect the order of this sequence ***
'
SETPIN PWR, DOUT : PIN(PWR) = 0
SETPIN RST, DOUT : PIN(RST) = 0
SETPIN CS,  DOUT : PIN(CS)  = 0
SETPIN C0,  DOUT : PIN(C0)  = 0
SETPIN C1,  DOUT : PIN(C1)  = 0
' Display home page
PRINT "********************************************"
PRINT "*             PAL READER V1.0              *"
PRINT "*                                          *"
PRINT "* BE SURE TO CONNECT THE INTERFACE FIRST ! *"
PRINT "*                                          *"
PRINT "*        Copyright SillyCony 2020.         *" 
PRINT "*                                          *"
PRINT "*                "+TYPE$+"                 *"
PRINT "*                                          *"
PRINT "********************************************"
' Wait for keystroke
PRINT : INPUT "Press 'ENTER' to start when ready"; Misc : PRINT
' Start of the process
  ' Open file. If existe : overwrite the file
  OPEN TYPE$ + ".pld" FOR OUTPUT AS #1
  ' Powering the board : *** respect the sequence ***
  PIN(PWR) = 1 : PIN(CS)  = 1 : PIN(RST) = 1
  ' Open the SPI PORT at 3.125MHz, MODE 0:0, ONE byte 
  SPI OPEN 3125000, 0, 8
  ' MCP23S17 configuration
  McpConfig
  ' Reading loop 
  PRINT "-> Reading... "
  DO WHILE ADDR_X
    PRINT ".";  
    ' Configure all the signals for the PAL
    Port_A_Out : Port_B_Out : Port_C_Out
    ' Write in file the PAL return   
    PRINT #1, BIN$(ADDR_X, 10) + " " + BIN$(Port_B_In(), 8)
    ' Next 'address'
    ADDR_X = ADDR_X - 1
  LOOP 
  ' Write Date & Time 
  PRINT #1, "" : PRINT #1, FILE_$ : PRINT #1
  ' Close the file
  CLOSE #1
  ' Message
  PRINT : PRINT : PRINT " -> Reading terminated. ";
' Shutdown the board: *** respect the sequence ***
PRINT "Shutdown the board."
SPI CLOSE : PIN(C0)  = 0 : PIN(C1)  = 0 : PIN(RST) = 0 : PIN(CS)  = 0 : PIN(PWR) = 0
' Programm END
' -------------------------------------------------------------------------------------------------
FUNCTION Port_B_In() AS INTEGER
  LOCAL Misc
  PIN(CS) = 0 : PAUSE DLY
  Misc = SPI(&B01000001) : Misc = SPI(&H13) : Port_B_In = SPI(&H13)
  PIN(CS) = 1 : PAUSE DLY
END FUNCTION
' -------------------------------------------------------------------------------------------------
SUB Port_A_Out
  LOCAL Misc
  Misc = ADDR_X AND &B0111111110 : Misc = Misc / 2
  PIN(CS) = 0 : PAUSE DLY 
  SPI WRITE 3, &B01000000, &H14, Misc 
  PIN(CS) = 1 : PAUSE DLY
END SUB
' -------------------------------------------------------------------------------------------------
SUB Port_B_Out
  LOCAL Misc
  Misc = ADDR_X AND &B000000000
  IF Misc <> 0 THEN
  PIN(CS) = 0 : PAUSE DLY  
  SPI WRITE 3, &B01000000, &H15, Misc
  PIN(CS) = 1 : PAUSE DLY
  ENDIF
END SUB
' -------------------------------------------------------------------------------------------------
SUB Port_C_Out
  LOCAL Misc
  Misc = ADDR_X AND &B0000000001
  IF Misc = 0 THEN : PIN(C1) = 0 : ELSE : PIN(C1) = 1 : ENDIF
  Misc = ADDR_X AND &B1000000000
  IF _DataTemp = 0 THEN : PIN(C0) = 0 : ELSE : PIN(C0) = 1 : ENDIF
END SUB
' -------------------------------------------------------------------------------------------------
SUB McpConfig
  ' Force Chip Address to 000
  PIN(CS) = 0 : PAUSE DLY
  SPI WRITE 3, &B11110001, &H0A, &B00001000 
  PIN(CS) = 1 : PAUSE DLY
  ' CONFIGURE PORT A
  PIN(CS) = 0 : PAUSE DLY
  SPI WRITE 3, &B01000000, &H00, PORT_A
  PIN(CS) = 1 : PAUSE DLY
  ' CONFIGURE PORT B PULL UP by default
  PIN(CS) = 0 : PAUSE DLY 
  SPI WRITE 3, &B01000000, &H0D,&HFF
  PIN(CS) = 1 : PAUSE DLY
  ' CONFIGURE PORT B
  PIN(CS) = 0 : PAUSE DLY 
  SPI WRITE 3, &B01000000, &H01, PORT_B 
  PIN(CS) = 1 : PAUSE DLY
END SUB
' -------------------------------------------------------------------------------------------------
(Sorry but there is no coloring class for the Basic language).
 
Again, there is nothing very complicated in this source. Please note that I am using the CMM2 via the USB serial port on my PC, equipped with the 'Tera Term' software. CMM2 also has the possibility of being used in exactly the same way, in complete autonomy, directly with a VGA screen and a USB keyboard. Graphical instructions can also be used to enhance the 'user experience'.


At the end, a file is generated in the form : 

Address                                                              Data
A09 A08 A07 A06 A05 A04 A03 A02 A01 A00    D07 D06 D05 D04 D03 D02 D01 D00

I did not generate a particular format, but it is still very easy to do from the Basic source, for example to use this data with the 'Logic Friday' utility, which allows the generation of the equations corresponding to these data.


Please do not hesitate to send me your comments :

Monday, November 9, 2020

Retro keyboard.

Last month I published an article on the Z80 processor based kit from Wichit Sirichote. In this article I mentioned the type of keyboard used and the fact that I found it unsuitable for this kind of use. Which is why I decided to develop a more suitable keyboard by myself : 


Since this publication I have developed the software for the keyboard processor using a real time debugger. The processor used is a low cost generic processor without peripheral. For the moment it is not placed on the printed circuit board because the emulation is made thanks to the 20 pin connector visible on the image below :



The characteristics of this keyboard are on the one hand the use of Cherry type keys and on the other hand the code output via a serial port. I didn't want to develop a keyboard outputting the code in parallel : too many signals to connect. And it would have been necessary to develop a keyboard for each computer considered.

As expected, it will suffice to develop a small serial / parallel converter for the processor board to which the keyboard will be connected. This greatly reduces the cost of such an adaptation. I plan to do this for the Omega motherboard I was talking about in the previous article.

https://www.retrobrewcomputers.org

The keyboard provides the code for the key pressed. In order to perform tests, I simply made sure that the generated codes were display characters based on the letter 'A' : 


The keyboard does not produce the space code... This test actually comes from the keyboard output. I have to say that the feel provided by the keys is very similar to what one feels with a standard computer keyboard. The goal is reached...

It now remains to convert the Wichit Sirichote kit into an FPGA-based system. I have already implemented this kit on a Digiasic board but I would like to develop a new board with a more recent FPGA and with an I / O port compatible with the MPF1.




Wednesday, October 28, 2020

Retro Computing.

Is retro computing something you just do for fun? Certainly, but not only!

The microcomputers of the 80s were open and easy to program, often in Basic, but also in assembly language. It was quite easy to create cartridges or expansion boards for them. Everyone remembers the Commodores, Atari, Apple, Sinclair, BBC etc etc...


In short, a time of great creative freedom. All this gradually disappeared with the hegemonic position of the PC(IBM) / Microsoft 'association'.


Is it possible to regain some freedom again in this digital world? Yes of course. By resuming and 
continuing the great road of creation abandoned in the early 90s. How? by taking up some good ideas from the time and developing them :


There were a lot of good ideas in the 80s. But, if we take the case of 8-bit machines, the MSX standard was a very good initiative since it allowed a good stadardization of the computers, while preserving a good freedom of design. This standard was originally initiated, among others, by Microsoft : 


To enter the MSX scene, It is obviously possible to equip yourself with some new MSX machines based on an FPGA, but I think that in the introduction, a machine created such as at the time would be a good starting point.


All this written, it remains to find an effective solution to launch into the realization of an MSX machine. Fortunately, Sergey Kiselev has recreated a great MSX computer motherboard called Omega :

My own Omega main board issue.

The Omega computer is not based on any computer that has existed but only on the MSX 2 standard. Therefore, it is necessary to obtain a whole set of obsolete components but still available on the Net.

It may take a little time to build this board but the months ahead should leave time for this task. In the end, it should look like this :

https://www.retrobrewcomputers.org

I am thinking of using my own keyboard version with this Omega.

A good introduction to the MSX standard with the Yamaha CX5M computer, recently published :


Of course there were some great 16/32-bit machines as well, Amiga, 520ST, but that's another story...



Monday, October 26, 2020

Retro keyboard.

Iin 2016, Wichit Sirichote created learning kits for different types of microprocessors, including the Z80 : 


This kind of kit is very interesting but suffers from some problems in my opinion. The first of these, and certainly the most important, is the keyboard. The tactile switches used are not suitable for precise, regular and comfortable typing. These are front panel switches, intended to configure a device, but certainly not to serve as an element of 'dialogue' with a computer. 

I'm not even talking about the self-adhesive plastic film where the key symbols are printed. It just makes typing painful : 


So I decided to create a keyboard equipped with real input keys. For this, I start by creating a prototype of what should be the type of keyboard that I will use for my future developments :


After a few days of waiting, I received the printed circuit board and soldered the components that will allow me to perform the programming of the on-board microprocessor :


Why an embedded microprocessor on this keyboard? Because this will allow the development of a keyboard, I hope, adaptable to a large number of materials, without having to recreate it each time.