Wednesday, December 28, 2016

P-touch info mode diagnostic

So I found a service manual for the PT-1900 and it says that it has a "diagnostic mode." With the unit powered off, hold code and k, then press the power, release the power, then release code and K you get into the INFO diagnostic mode, and the display will say "INFO MODE."

Note that it won't go into info mode unless the buffer is empty.


The page from the manual says:


Starting the Inspection Mode
First, press the “ON/OFF” key while pressing the “Code” and “R” keys, and release the “ON/OFF” key, then “Code” and “R” keys so that the RAM is cleared, and the machine performs normally. Then, when the power is OFF, press the “ON/OFF” key while pressing the “Code” and “K” keys and release the “ON/OFF” key, then the “Code” and “K” keys so that the machine goes into the inspection mode.


Once you are in "INFO MODE" and you type the number keys you get:




1 = Info mode (show the country settings and test the display)
2 = Cassette diagnostic (if you push the cassette identification pins with your finger, it will update in real-time)
3 = key (test the keyboard)
4 = cut (test the cutter)
5 = print 1
6 = print 2
7 = motor (runs the motor until you turn it off, best to take out the cassette first or you will waste your p-touch tape)
8 = AD (test the Analog/Digital conversion)

r = motor
m = print head
f = feed and cut

so hit ENTER and it will go into the various modes, when you've cycled through all the options for a given mode, it will go to the next mode.


I find the AD kind of interesting, as it will display the Voltage and Temperature sensors in real time:

VOLT TEMP
BA 8A


for the m=PRINT HEAD, if you then type y, it will cycle through Di,STR,CLK,LAT, w will go to OFF, then e will go to END, then 1 (one) turns the unit off. I have no idea what this means...perhaps it is to test the signals on the print head connector as there are signals on the connector that are named DI, STR, CLK and LAT.



My cool discovery of the day.







Na = Nation and it is a US model, H = Head Rank (I don't know what that means exactly), and Vo = Voltage (o for good, x for not good)



Cassette pins status







I'm using a Panasonic PQLV1 telephone adapter that only puts out 9V, but it seems to work. Probably why the Vo reads X instead of O.



Officially, the PT-1900 requires 9.5V.

I was able to get into the info mode on a PT-1750 and a PT-2300. The PT-1750 had some different options, one being a CG that would display the character roms.

Mastermind game

Years ago, I had a coleco digits handheld game. It played the game of mastermind, where it chooses a 4 digit number and you try to guess it. You press a button and it will tell you how many digits are in the solution and if they are in the correct place.

I thought it'd be fun to try and make a mastermind game using microsoft excel.


So you choose a number, put it in A1, then set up a function like this:

=findmatchwrongpos(TEXT($A$1),TEXT(C1)

and your function would look something like this where we mark a "match" with an asterisk so it won't be counted again.

Function findmatchwrongpos(a, b As String) As Integer
  For i = 1 To Len(a)
    If Mid(a, i, 1) = Mid(b, i, 1) Then
      correctposcount = correctposcount + 1
      Mid(a, i, 1) = "*"
      Mid(b, i, 1) = "*"
    End If
  Next i
  For i = 1 To Len(a)
    c = Mid(a, i, 1)
    If c <> "*" Then
        For j = 1 To Len(b)
          If Mid(b, j, 1) = c Then
            Mid(b, j, 1) = "*"
            Mid(a, i, 1) = "*"
            wrongposcount = wrongposcount + 1
            Exit For
           End If
        Next j
    End If
  Next i
  
  findmatchwrongpos = wrongposcount
End Function



And for debugging purposes, why not have a function that returns a variant type so you can see what's going on:


=findmatchitem(TEXT($A$1),TEXT(C1),1)

passing an item number so you can get different return items:



Function findmatchitem(a, b As String, item As Integer) As Variant

  For i = 1 To Len(a)
    If Mid(a, i, 1) = Mid(b, i, 1) Then
      correctposcount = correctposcount + 1
      Mid(a, i, 1) = "*"
      Mid(b, i, 1) = "*"
    End If
  Next i
  correcta = a
  correctb = b
  For i = 1 To Len(a)
    c = Mid(a, i, 1)
    If c <> "*" Then
        For j = 1 To Len(b)
          If Mid(b, j, 1) = c Then
            Mid(b, j, 1) = "*"
            Mid(a, i, 1) = "*"
            wrongposcount = wrongposcount + 1
            Exit For
           End If
        Next j
    End If
  Next i
  
  If item = 1 Then
    findmatchitem = correctposcount
  ElseIf item = 2 Then
    findmatchitem = wrongposcount
  ElseIf item = 3 Then
    findmatchitem = "CORRECT CHECK: " + correcta + "," + correctb
  ElseIf item = 4 Then
    findmatchitem = "WRONG CHECK: " + a + "," + b
  End If
End Function



Maybe after this, I'll dig out a copy of Interplay's Learn to Program Basic and write mastermind in it.

Monday, December 26, 2016

Ear blasting youtube on headphones

I like to watch youtube on my knoppix box and to use headphones. The problem is that so many videos have wildly different audio levels. Some videos are extremely quiet, while others are really loud. So what happens is that you turn the volume way up for the quiet video, then BAM! another video starts playing at an ear shattering level.

I don't really want to experience the full dynamic range of loudness on my headphones.

Windows has loudness equalization built-in, why not linux? Just a simple limiter will do.

Something like this, but for your computer audio:

http://gizmodo.com/245624/tv-volume-regulator-keeps-those-loud-commercials-on-an-even-keel

Sunday, December 18, 2016

Formula for number of dominoes

So I was trying to wrap my head around the formula for the number of dominoes.

It's (n+1)(n+2)/2.

For double 12 dominoes, that's 91. But how to derive it?

Let's look at the simple case of n=2 dominoes.

Plugging n=2 into the formula, we get (3)(4)/2 or 6 dominoes.



but there's tiles that stick out over the top of the triangle. There's (n+1) half tiles. Or (n+1)/2 area, to sum up all the half tile area.



and presto we get our formula:

((n+1)(n+1)/2) + ((n+1)/2)

and simplifying

(n^2+2n+1)/2 + (n+1)/2

to get

(n^2 + 3n + 2)/2

or

(n+1)(n+2)/2.


http://www.domino-games.com/faq/How-Many-Tiles-And-Dots-Are-In-A-Dominoes-Set.html

Math and dominoes...

Wednesday, December 14, 2016

Trs-80 whiz kids


I was going through some stuff today and came across a copy of the TRS-80 whiz kids comic book.

Kids today don't have the experience of growing up with the TRS-80 whiz kids. "Hey, it's a free comic book!"

Stories like "The computers that said no to drugs!" and "The computers that saved Metropolis!"

http://www.trs-80.org/trs-80-computer-whiz-kids/

Monday, December 12, 2016

Apple II checkerboard

I remember years ago I wanted to see what would happen if I flipped the Apple II's hi-res pages as fast as I could.

So I did an HGR which would clear the first hi res screen, then an HGR2 to switch to the second hi res screen and filled the screen with white with a for loop. Something like HCOLOR=7:FOR I = 0 TO 191:HPLOT 0,I TO 279,I:NEXT.

Then I entered a little machine language program that would read $c053 and $c054 to flip the pages, then jump back to the top of the loop.

As I recall, it would make a neat checkerboard effect, alternating black and white down the screen. If you altered the timing of the loop, the pattern would change.

Of course, this would necessitate a reset to get out of this loop.

This is all from memory, as I haven't had a real apple II for ages.

Thursday, December 8, 2016

Little puzzles

Recently, I've been fascinated with LCDs and how to drive them from a microcontroller. They're not simple like LEDs, you have to give them an AC signal. If you drive them with a DC signal, it will destroy the LCD.

So I read a bunch of pages about driving LCDs searching google on "driving lcd microcontroller".

In the pdf at http://www.atmel.com/Images/doc2569.pdf it describes how you can make the necessary voltages to swing from -vlcd to +vlcd using waveforms that runs from 0 to +vlcd and are out of phase with one another.

This totally baffled me, how could you make the negative voltage differences with only positive voltage?

I was stumped before I realized that the negative voltage difference wasn't from COM to ground or SEG to ground but instead from COM to SEG.

When COM is +vlcd and SEG is 0, you get +vlcd across COM-SEG.

When COM is 0 and SEG is +vlcd you get -vlcd across COM-SEG.


This page was pretty helpful to see this:

http://www.arduinoos.com/2014/08/lcd-direct-driving/