Thursday, October 31, 2019

Revised Verilog debounce module

A while back I wrote a post (here) about the Verilog module I used to debounce input pins. As I noted in a reply to that post, that module had a flaw that caused a single sample of the opposite polarity to be reported as an edge, even though the state output didn't change.

Later I found another problem. My modified Lattice iCEblink demo board has a clock frequency of 10 MHz. My Digilent Spartan 3E Starter board has a clock frequency of 50 MHz, and my Digilent Atlys board has a clock frequency of 100 MHz. There is no point in sampling the input pin at 100ns, 20ns, or 10ns intervals, as doing so would require a very long debounce FIFO. To address this I divided the system clock down to provide a clock enable input of a more reasonable 100 KHz, resulting in the input being sampled every 10 microseconds (remember, the printer position sensor signals are only asserted for 500us, and exhibit no appreciable bounce). However, this meant that the edge detection outputs on the iCEblink were asserted for 100 clock cycles, which then required the modules using the debounce module to do edge detection on the edge detection outputs. That's silly.

Friday, October 18, 2019

M-32TL Timing: Why three position sensors?

While reviewing my last post I realized that I'd left out an interesting behavior that happens after the printer hammer fires.

Let's look at a couple of waveforms captured using an intact P170-DH calculator. All of these are taken from the same capture, covering the printing of the first 6 characters on a line. The sensor signals are labeled based on the operation I expected when I started working with this printer rather than the nomenclature I use now.  In each case I've placed cursors at the leading (falling) edges of the "Rotation Index" signal; these mark the start and end of one complete revolution of the print wheel.


Monday, October 14, 2019

EP-102 to M-32TL Glue logic

I decided to spend some time this weekend moving the interface to the Epson M-32TL printer forward.

The Busicom 141-PF calculator had a Shinshu Seiki (the predecessor of Epson) Model 102 drum printer. A drum printer has a cylinder (or drum) with rows of characters embossed across its width. The drum spins at relatively high speed, while a set of hammers on the other side of the paper presses the paper against the drum's surface at the right moment to print the desired characters. A full revolution of the drum is required to print all the characters on the line.

Here's a picture of a Shinshu Seiki Model 102 printer:


Since this printer can print 18 columns, it has 18 separate print hammers. Thus the i4004 software generates 18 signals in parallel using a pair of i4003 shift registers to activate the correct hammers at the correct time.

The Epson M-32TL printer, on the other hand, prints one character at a time by moving the print mechanism across the paper from right to left. Obviously some translation is required.

M-32TL Printer timing revisited

While browsing through my accumulated datasheets related to this project I found one for the Toshiba TC83230-0015 calculator chip. The information in it is sparse but it specifically mentions the Epson M31/M31A printer. The suggested system block diagram includes one tiny clue: