Saturday, March 19, 2022

29F400 Chip installed on the DIP-48 adapter board, planning out the breadboard and arduino setup to write data to the chip

ADAPTER BOARD ARRIVED AND CHIP MOUNTED

I bought a board where I can solder down the surface mount flash chip, TSSOP-48 layout, which then has pins soldered to the back side to create a DIP-48 that can be inserted into a breadboard. I assembled everything and now have it inserted into a breadboard.

Surface mount flash chip now hooked to breadboard

Once the chip is programmed with the data for the IOB6120 board, I can use the hot air tool to remove it, then mount it into place on its permanent position. 

PLAN TO WIRE ADAPTER TO ARDUINO

I can load all the data onto the flash chip by using an Arduino Mega 2560 to drive the 19 address pins, 8 data pins, 2 control pins and read the ready status pin. That only requires 30 pins connected to the microcontroller. There are some other control signals on the flash chip which I can permanently wire to the appropriate logic level, because they don't need to change for the purposes of the file load.

Arduino Mega 2560 to drive the flash chip

DESIGNING ARDUINO CODE TO LOAD THE CHIP

I will be doing direct port manipulation for speed and to switch pins nearly simultaneously. The AT MEGA 2560 processor has a number of byte sized registers which directly control input-output pins. For example, the L port register drives pins 42 to 49 on the board. 

The direction of each port is set by writing to the directional  register for the port. In this case, writing B11111111 to DDRL will set all eight of the pins to output mode. The high or low state of that output is controlled by writing to the PORTL register. Thus, writing B00100000 will turn on pin44 (PL5) and turn off the other seven pins. 

If the pin is an input, it is read by accessing PINL to get the values of the eight pins for the L register. As a subtlety, if you set a pin to input (DDRL for PL7 is set to 0 for input direction), then set the PORTL for PL7 to a 1, it turns on a pullup resistor. I need this because the flash chip RD/BY# signal is an open collector output that needs a pullup to work. 

I have address pins A17 to A10 assigned to the C port, with A17 on PC7 and A10 on PC0. I continue with address bits A9 to A0 assigned to the L port, with A9 on PL7 and A2 on PL0. Finally, address bits A1, A0 and A(-1) are on port B, A1 is PB2, A0 is PB1 and A(-1) is PB0. 

To write an address of x00555 in byte mode, I would set port C to B00000001, port L to B01010101 and port B low end to B010. Which is x00AAA if you string all 19 bits together, just to be confusing. 

To write the data value xAA I would simply write B10101010 to port A which is the port which is assigned to data signals Q7 to Q0 on PA7 to PA0. 

Telling the flash chip that we are sending a command is done by first dropping CE# to 0, soon after dropping WE# to 0, leaving both down for a minimum of 35ns, then raising first WE# and then CE# to 1. This is done by doing an OR of B00100000 and PORTB to PORTB, then an OR of B00010000 and PORTB to PORTB, waiting in a loop, then doing an AND of B11101111 then B11011111 with PORTB to flip off the bits. 

EXPECTED TIMING OF OPERATIONS

The sector erase can take up to 8 seconds of real time to complete, per sector. A write of one byte to the flash can take as much as 300 microseconds. These are in addition to the times it takes to issue the sequence of writes to issue the command to erase or write. Each kilobyte is going to take around a third of a second to write and our file to load is around 128KB in size, thus the loading time is expected to be less than a minute. 

Add another minute or so to erase all the sectors and this is going to be limited mainly by the timing of sending the data file from the PC over USB to the Arduino. All in all, not a very long procedure once I have it working. 

Programming requirements for 29F400 flash memory chip

ERASING SECTORS USES SECTOR NUMBERS, NOT BYTE/WORD ADDRESSES

The Sector Erase commands use the high bits of the address, bits A17 down to A12, to specify a sector number. For the larger blocks, those that span 16K, 32K or 64K bytes, the low order bits don't matter. The first block is just 8K, so its sector number in binary is B000000 but the second block, spanning 16KB, responds to either B000010 or B000011, the third responds to B000100 or B000101, and so forth. 

The command sequence sets up the sector number in bits 17 to 12, all others are ignored when the command is executed. For the data I need to load, we will only use five sectors, thus I will issue this just five times using the addresses B000000, B000010, B000011, B000100, and B001000.  After this is complete, the contents of the first 128KB of the flash memory are all set to xFF. 

CHIP AND SECTOR PROTECTION POSSIBILITIES

The chip offers ways to protect sectors or the entire chip so that you can't inadvertently update or erase the contents. There are commands to protect the chip and sequences to remove the protection, but that also requires +12V be applied to the RESET# line which isn't available on the IOB PCB; if the chip is ever protected it cannot be released while on the board. There are protections per sector that can be applied, removed and tested. Fortunately, the chip comes with the protections off and I will leave them that way. 

NAVIGATING OCTAL, HEX, WORD AND BYTE ADDRESSES

In planning and execution of the flash loading project, I will have to deal with some complications related to multiple ways to refer to the same value. The PDP-8 is a 12 bit word machine and the general practice is to represent numbers in base 8 (octal), groups of 3 bits each. On the other hand, the flash memory documentation and the usual practice with the majority of computers is to use groups of four bits to represent values in hexadecimal, base 16. 

Even if we deal exclusively in hex, there is still some duality because the flash chip is inherently a word oriented design, words being 16 bits, but it has a byte mode. The addressing for locations in the chip is done with 18 bits, the most significant being A17 and the least is A0. If only address bit A3 is a 1, this is address x00008 or decimal 8. 

If in byte mode, there is an additional address bit A(-1) that is actually selecting which half of the 16 bit word is being selected. That means that in byte mode, the same word that was x00008 in regular mode is address x00010 in byte mode. This matters because there are times when we are required to set up address x00555 while in word mode, but address x00AAA in byte mode. This is the same location, but in byte mode we are adding in A(-1) to the right side of the address. 

WAKEUP SEQUENCES NEEDED BEFORE COMMANDS TO THE CHIP

For some reason, the controller inside the chip that handles the commands needs to see a special sequence of addresses and data values in order to wake up and accept the actual commands. The first cycle, you have to send address x00AAA and data of xAA (address x00555 on the A17-A0 lines and then a 0 on the A(-1) line. Second cycle gets x00555 and data of x55. For the sector erase command, it also needs the same two cycle sequence after the second command and before the actual sector number is sent. 

INTERROGATING STATUS OF THE OPERATIONS

The data bits from the chip are used to output status during and after these command operations. There is one output signal RD/BY# that goes off when the chip is busy and doesn't go on until the command completes. Too, you can look at the data bits for more information. The particular meaning depends on the command being executed.

COMMAND SEQUENCE TO ERASE A SECTOR

It takes six cycles to send the command sequence, after which you have to keep waiting until the RD/BY# signal goes active when the erase is complete. Here is what is sent on the address and data lines:

    ADDRESS                        DATA

    x00AAA                            xAA

    x00555                               x55

    x00AAA                            x80     (erase sector command)

    x00AAA                            xAA

    x00555                                x55

    sector address A17-A12    x30

COMMAND SEQUENCE TO WRITE A BYTE

It takes four cycles to request that the chip update a byte, after which you have to wait for RD/BY# to go active to signal that the change is complete.

    ADDRESS                        DATA

    x00AAA                            xAA

    x00555                               x55

    x00AAA                            xA0        (write a byte command)

    address of byte                   byte value


Thursday, March 17, 2022

Will install a 29F400 flash chip on a breakout board and attempt to program it with an Arduino Mega 2560

29F400 FLASH CHIP VERSUS ORIGINAL DESIGN PART

The IOB6120 was designed around a 28F400 chip, which is a 4Mbit flash chip that can operate in either byte or 16 bit word mode. These chips are extremely rare and can only be sourced from somewhat suspect sites or eBay, but the 29F400 is pin compatible and almost functionally compatible. 

The differences are only in the sequences to erase or write, while reading contents operates exactly the same between the two chips. This means that if I can write the contents to the flash chip, it can then be soldered onto the IOB board and will support its normal operation. What will NOT work is writing to the flash, using the FL (flash load) command since that is designed around the 28F400 protocols. 

USING BREAKOUT BOARD TO DEAL WITH SURFACE MOUNT FLASH CHIP

To write to the chip while it is off the IOB board would normally require a PCB with TSOP-48 pads since this is a surface mount device. I want to avoid the delay of designing and sending a board out to be fabbed simply to load the flash contents. I therefore found a breakout/adapter board which has the TSOP-48 pads on the top and is set up as a DIP-48 on the bottom, suitable to install into a breadboard. 

I can use a breadboard, with this setup, to provide the signals and voltages to the chip, get it programmed and then, using the hot air tool, remove it from the breakout board. The removed chip can be soldered onto the IOB6120 board and it should then work perfectly. 

PROGRAMMING THE FLASH CHIP IS A SEQUENCE OF BLOCK ERASE AND WRITES

In a flash chip, you have to do an erase of an entire block, setting the contents to xFF, then write to each location in the block in order to load your data. One challenge when switching between flash chips is varying block sizes. The 29F00 has a 16K block, two 8K blocks, a 32K block, then the rest in ascending addresses are all 64KB. The 28F00 has the first eight blocks 8K bytes in size, with the remainder in ascending order all 64KB. 

Thus, if you programmed for the 28F400, you would erase the block at address zero, thinking it would erase the bottom 8K, write those bytes, then erase the block starting at address 8K, write the next set of bytes, and so forth. If you did this to the 29F400, after writing the first 8K, when you issued a block erase for address 8K you would wipe out the entire first 16K, including the words you had just finished writing. 

Thus the programming difference for writing to the chips has to take into account the block structure and decide when it has to issue block erase commands to the flash. The FL command, as written, will only work with the block structure of the 28F400 chip and will not give proper data loading on the alternate chip. 

The solutions include rewriting the FL command and rebuilding the ROMs for the SBC6120 computer, but also there is a minimally invasive method where the chip is written outboard, prior to soldering onto the IOB PCB. 

SETTING UP MEGA 2560 TO CONTROL ADDRESS, DATA AND CONTROL LINES

The Arduino Mega has 51 digital pins, sufficient to drive the 8 data lines, 5 control lines and 19 address lines for programming this chip. The programming sequences dictated the order in which signals are set, the minimum time they must be stable, and the timing between control signals. Knowing the speed of execution of the Mega processor I can ensure that delays, hold times and the like are satisfied. 

ALMOST EVERYTHING IS READY EXCEPT THE BREAKOUT/ADAPTER BOARD

I have the 29F400 chips in hand and the Arduino Mega 2560. This, however, depends on the TSOP-48 to DIP 48 Breakout/Adapter part that has not arrived yet. With my visitors coming I expect to have the adapter board but not be able to work further on the project for a number of days. 

Repaired 160 pin connector for 1130 extender, adding cable wiring protection

AMPHENOL TOOL ARRIVED TO REMOVE THE SOCKETS IN THE CONNECTOR

Because I had two wires tear out of the socket crimping on the 160 pin signal Storage Access Channel (SAC) connector, I had bought new sockets and the special tool that removes the pins and sockets. It has a hollow cylinder that fits between the plastic hole in the connector and the body of the socket or pin. 

Amphenol tool

When pushed onto the socket, it displaces some lock tabs on the outside of the socket that lock it into the plastic connector. An inner piston pushes the socket out of the back of the connector once the lock tabs are freed. 

I used the tool to remove the sockets in positions A1 and A2 of the connector, as those had no wires attached. These were thrown out and new sockets were readied to attach to the wires. 

Two broken sockets ready for disposal

NEW SOCKETS CRIMPED TO WIRES AND INSERTED IN CONNECTOR

I put the wire ends in the sockets, crimped them well with my crimping tool, then pushed them into the connector housing until their lock tabs clicked in place. The connector is now repaired and ready for use. 

Two new sockets are the leftmost positions

ADDED HEAVY RUBBER PROTECTION TO KEEP WIRING FROM CHAFING ON CASE

The many wires from the SAC connector pass through the chassis and can rub along the metal edge. This can expose conductors, enable shorts or even break the wires. I am constructing a sleeve of heavy rubber to protect the wires from the lip of the chassis. I will epoxy it into place over the coming days. I have family coming to visit which will keep me out of the shop for some time. 

Working on the rubber protective sleeve


Wednesday, March 16, 2022

Solder reflow plate project working, still working to hook up logic analyzer to the IOB6120

PROGRAMMING THE ATMEGA328 ON THE REFLOW PLATE

The solder reflow plate has a ICSP connect (3x2) that is used to download code to the ATMEGA microcontroller. I used a spare Arduino Uno as the programmer, hooking up the two ICSP connectors with cables. It completed successfully, after which I used my oscilloscope to verify that the crystal was oscillating at 16MHz driving the controller chip. 

SOLDERED ON THE OLED AND FIRED IT UP

I installed the temperature sensor and the OLED display board to the PCB. The only part I am still waiting for is a good main diode that protects the circuitry from a reversed 12V supply connection. I have a jumper across the diode pads for now.

The OLED lit up with appropriate output and I got it to start heating - the power supply kicked up to the 5A limit I set and the plate began to get toasty. I am satisfied with the outcome of this project, in spite of the hiccups along the way, and will move it into service in my soldering area once I install the diode. 

Reflow plate is operational

GETTING ACCESS TO THE 50 PINS OF THE SBC EXTENSION BUS

The IOB6120 (IOB) board has a 2 x 25 pin header on it that fits into a 50 pin socket on the front panel PCB. This is the extension bus from the SBC6120 (PDP-8 replica). Since most of the parts on the IOB are surface mount, it is very difficult to hook probes to the circuitry. While I have the means to attach up to four, real debugging requires many more signals to be captured.

My first cut at this was to buy a 50 pin ribbon cable, the type that was an internal SCSI cable inside PCs. I would hook the cable to the header pins on the IOB, use a special header with long pins on both sides to connect to the front panel socket, and then use another long pin header on the center socket of the cable to gain access for logic analyzer connections.

Alas, I forgot about chirality, introduced because the header on the IOB extends downward into the socket on the front panel. A cable connected to each will transpose the two columns of 25 pins, while I intend to have the columns connected as they are when the board is directly plugged into the front panel.

Tuesday, March 15, 2022

I will prevail over the flash memory issues with the IOB6120

 USAGE OF THE FLASH MEMORY ON THE IOB6120

The flash memory on the IOB6120 is used for two purposes, read by the SBC6120 system initialization code, plus it can be loaded by a console monitor command FL. The first part of the flash is treated as EPROM, copied by the initialization code into the panel RAM space and executed.  The second part of the flash is copied over to the FPGA as the bitstream to program it. 

The EPROM code will modify the firmware of the SBC6120 to modify the memory space, add support for various additional devices and take over some IO requests. This happens only if the beginning of the flash has a specific signature and a good checksum, otherwise it is ignored and not copied.

Note that both of those purposes are accessing the flash as static ram reads - put an address on the bus, enable the output and the corresponding data shows up on the bus. That doesn't depend on any commands or specific sequences that differ between flash memory parts. The only case where commands are issued to the flash, such as erasing blocks, writing words, reading and clearing status, is when you reload (or initially load) the flash with the EPROM code and the FPGA bitstream. 

OPENING UP THE WAR ON THE FLASH ON MULTIPLE FRONTS

I found a vendor on eBay that claims to have Intel parts compatible with the Sharp flash chip used in this design. The vendor has thousands of perfect feedback responses and is US based - not an absolute protection against counterfeits as they themselves may have been victimized - which is a drop in and forget it solution that will support the console FL command as well as reading out properly.

I also purchased a 29F400 chip from a reputable distributor, thus probably real. It has a compatible footprint and pin assignments but apparently some of the access details are different for erasing and writing. Thus, use of the FL command may require me to make changes and rebuild the SBC6120 firmware and rewrite its EPROM. 

I have several of the 16M chip that were also footprint and almost pin compatible, although they had the extra two address bits that need to be driven. If I can program that chip, or the 29F400 above, through other means then I don't need the FL command to work. Soldering in a preprogrammed flash will allow it to boot up and work properly. 

I found an adapter board, TSOP-48 to DIP 48, which will let me solder down one of the flash chips then plug it into a breadboard for me to attempt to load the flash before I put it on the IOB board. This will support any of the chips, if need be. 

Replaced parts in solder reflow plate, tested and modified flash on IOB6120

REPLACED BLOWN PARTS ON REFLOW PLATE

The replacement for the parts that were destroyed by the 12V passing through the wrong linear regulator have arrived and today I soldered most of them on. I applied power and was aghast to see the 12V passing right through. 

I looked into this and discovered that the ground plane of the PCB (or the via that connects a group of ground pads) had failed, thus there was no ground at the linear regulator pad vref that should be grounded. I added in a jumper to bridge the group of pads to a known good ground level, at which time I validated that the voltage rails are indeed 5V not the full 12V passing through. 

With that done, I await only the temperature sensor from Mouser before I can complete assembly. Tomorrow I will program the FPGA, assuming it wasn't killed by the overvoltage. Since the ground traces were partially disconnected I am hoping that the FPGA didn't get connected to ground and therefore survived the prior voltage tsunami. 

CHECKED ON VCCW PIN POWER ISSUE ON IOB6120

I tested continuity and resistance for this pin, reflowed the pin contact and carefully inspected the chip under the microscope. It all looked good, which suggests that either I have a chip failure or the problems are deeper than it appears. 

CHECKED COMMANDS AND ADDRESSING BETWEEN REPLACEMENT AND ORIGINAL

One of the tenets of my substitution of the 16M flash chip for the 4M chip on the design is that it be almost a direct drop in replacement. That is, the pin assignments (other than two additional address bits for the larger capacity) should be identical and the functions should compatible enough to work properly.

I pored over the data sheets for the two devices to identify all possible differences after which I could analyze their impact on the substitution. The command codes are identical, the sequences are identical, the differences are minor:

  • Manufacturer ID is identical but the device code differs for the Read ID output
  • VCCw can be given 12V to do a full chip erase faster, but usually gets 5V
  • Two higher order address bits are added, A18 and A19

MODIFIED ADDRESS PIN WIRING FOR THE FLASH CHIP

I realized that since both chips have some low address blocks that are only 4K, intended for boot and parameter storage unlike the 32K word blocks in the bulk of the device, it is not correct to let the two high address bits match the value of adjacent address pins. Instead, these high order bits need to be logical zero, which means they should be tied to ground.

I found access to ground on nearby decoupling capacitor pads, removed the solder bridges I placed on these pins, and added jumpers to give those bits the proper value. This should allow the chip to work properly.

Jumpers to take A18 and A19 to ground

NEW TEST AFTER MODIFYING WIRING

With this change, the board again refuses to pass the memory test at SBC6120 initialization. Drat. I will have to move on to the logic analyzer probing to check things out. In the interim, I did discover that I can find the some new 29F400 chips, known to work on the board with small software modifications because they are quite similar to the 28F400 that was the basis of the original design.

I ordered the chip and removed what I had on the board now. With the ROM missing, the SBC initialization hangs in the memory test section just as before, so no progress will occur until I get the logic analyzer set up and the new flash chip installed.

Flash removed and waiting for the new chip