Retro Computer: Arduino Pro Mini stuffed in a keyboard

WP_20150325_16_25_02_ProSo, during the Half-Byte Console project, I purchased quite a few PS/2 style PC keyboards.  Since the project is pretty much over, I have a few of these keyboards still. They are actually fairly decent keyboards for the price.  Well, I had envisioned a future Half-Byte Computer living in something like a keyboard, like the old Commodore 64 or Vic 20.  So, I set out to build one.

I wanted to use one of my Half-Byte Console boards, alas, though, it is too big. Since I ordered a truckload of Arduino Mini Pro’s, and they are really small, I used one of them.

The first thing I had to do was figure out what I wanted in this thing and where to put the parts.WP_20150325_15_44_57_Pro

I grabbed one of the keyboards and took it apart. It is really simple, a standard membrane matrix with full travel keys.  However, even though it is a full size keyboard. there isn’t much room inside.  However, there’s enough for the mini pro, wires and not much else.  I had to cut holes for the power connector and video out.

WP_20150325_15_44_49_ProWhat I was not going to do this iteration was include sound, nunchuck or FTDI connectors.  That can all come later. I’m putting HB Tiny Basic  on the this one, so I won’t need to be programming it often. The nunchuck will be easy enough to add later, as will sound. Just not that industrious at the moment.

I cut the cable from the keyboard as the pc board inside is marked and easily accessible.  I wired it directly to the pro mini: data to pin 5 and clock to pin 4.

I decided to put the video jack on the left side,  but first had to cut a hole for the connector.WP_20150325_16_24_37_Pro  Next, I put the power jack on the bottom, where the keyboard’s cable came out. I had to enlarge that opening and super glue the connector.  Next, I wired up the video out jack and the two resistors (470 ohm and 1kohm) to the pro mini (470 ohm to pin  9 and 1k to pin 7 see my previous postings on the video out subject.)  Then the power was wired up and I tested the whole thing.  Amazingly, it worked.  It took two attempts at laying out the wire and board to get the case to  go back together and for all of the keys to work. 

WP_20150325_16_20_05_ProI now have my true retro computer, complete with Tiny Basic and blocky graphics.  Truly, an awe inspiring device.  Yep. Awe inspiring.

NOTE: yes, the wiring  is a bit sloppy, but I’m no Ben Heckendorn and this was for me.  I will clean it up when I add the other connectors.

Coach Wayne Hoy

I have been fortunate enough to have met some truly great and influential people in my life.  People such as Oliver North, Chuck Robb, Richard and Kyle Petty, Ward Burton and Wayne Hoy.  If you are into politics, you know the first two. I had the honor to see Mr. North up close and shake his hand. Mr. Robb I met during a meeting of a handicapped persons advocate group.  Richard and Kyle Petty, of NASCAR fame, I met at a visit to Victory Junction Gang Camp and Mr. Burton, another NASCAR driver, I met at a race.

And, then, there is Coach Hoy.

This is a man who not only rose above those five gentlemen, he was, truly, a very special person who touched many lives. Now, you may not have heard of him, and that’s OK. Coach Hoy was a teacher at Douglas S. Freeman High School in Henrico County, Virginia.

Mr. Hoy, who was a coach at that High School as well as a physics teacher, was one of those rare people who, no matter what was thrown at him, manage to smile, tell a joke and make you feel good.  And, he was thrown many curve balls. 

He had diabetes that pretty much took over his body and slowly killed him. It cost him, at first, a foot and then part of a leg, much of his sight, his kidneys and put him on dialysis. Ultimately, coach paid the ultimate price.

Before all of that, however, he was a very active man.  A Mason-a clown, to be specific, he was one of the most honorable people I have ever met. He rarely, if ever, said an unkind word about anybody and whenever I needed advice, I knew exactly who to go to.  As did most people.

Because he taught, he touched many lives and people never forgot him.  I’m telling you, the man could anywhere on the planet and meet someone he taught or worked with or just knew.  ANYWHERE.  And, those people treated him with the utmost respect.  His son is very much like him in this and many other respects.

As we come up on the eighth anniversary of his death, I have thought, quite a bit, about what we lost.  The coach was my father in law but I always considered him my second dad.  I miss our talks, his jokes (and, yes, those dreadful cornball jokes too) and his advice. I could always count on him giving me sound advice.

Most of all, however, I just miss him. 

PROGMEM issues with Arduino 1.6.x and how to fix them

WP_20140826_22_20_46_ProThere is a new version of the Arduino IDE out, version 1.6.1. If you do not have, you can go to the Arduino web site and grab yourself a copy.  It is much faster than the older versions.  Overall, it seems to be better in most aspects. Except for one…the new compiler breaks some of your code.

I installed it and then tried to compile Half-Byte Tiny Basic.  Expecting a clean compile, I was surprised by the errors it generated.  Upon investigation, I found that the references to PROGMEM was the cuprit. Further research revealed a fairly easy remedy, but one that was difficult to find, so I thought I’d make it easier.

Error:  variable ‘message’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))

So, this was the first error, which led to a second error that isn’t really an error (it goes away when you fix this) so I’m not going to talk about it, it is one that is safe to ignore.  Now, simply changing ‘Static’ to ‘Const’ does not actually fix the problem. No, like the error says, you need to specify the SECTION to put it in.  Look at the old way below, then check out the new way.

OLD WAY:
/***********************************************************/
// Keyword table and constants – the last character has 0x80 added to it
static unsigned char keywords[] PROGMEM = {
‘L’,’I’,’S’,’T’+0x80,
‘L’,’O’,’A’,’D’+0x80,
‘N’,’E’,’W’+0x80,
‘R’,’U’,’N’+0x80,
‘S’,’A’,’V’,’E’+0x80,
….
‘S’,’C’,’R’,’O’,’L’,’L’+0x80,
0
};
NEW WAY:
/***********************************************************/
// Keyword table and constants – the last character has 0x80 added to it
static unsigned char __attribute((section(“.progmem.data“))) keywords[] = {
‘L’, ‘I’, ‘S’, ‘T’ + 0x80,
‘L’, ‘O’, ‘A’, ‘D’ + 0x80,
‘N’, ‘E’, ‘W’ + 0x80,
‘R’, ‘U’, ‘N’ + 0x80,
‘S’, ‘A’, ‘V’, ‘E’ + 0x80,

‘S’,’C’,’R’,’O’,’L’,’L’+0x80,
0
};

Fixing this killed the second error that was showing up.  BUT…

ANOTHER error (third overall) reared its head:

Error: <variable> causes a section type conflict with <section>

Specifying the attribute did the trick, simply using PROGMEM causes issues. While the original error went away (along with that secondary error), the section type error appeared.  This one, though, was simple. I was stuffing two TYPES into the same section and that is a no-no in the new world.  Just adding the code below AND specifying a different section of PROGMEM did the trick. This way allows you to segment your data as well.

// Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734
‪#‎ifdef‬ PROGMEM
‪#‎undef‬ PROGMEM
‪#‎define‬ PROGMEM __attribute__((section(“.progmem.vars”)))
‪#‎endif‬

Once I made these changes, my code compiled and uploaded just fine.  I hope this saves you some time.

PS/2 Keyboard and Video Out support for Arduino UNO and compatibles (and the Half-Byte Console)

While this information is readily available on the Internet, I have, nonetheless, received requests on how to do this. The most recent was from Dave in the form of a question on a post about Tiny Basic.  So, I thought I’d write a post-with pictures-on how to connect these things to your UNO or compatible.

PS/2 Keyboard

Connecting the keyboard was a challenge for as I have dsylexia. See! Anyway, I had the hardest time figuring out how to wire up a PS/2 keyboard connector, but, I did and here’s how you can too!

WP_20150315_00_11_58_ProPINOUTS
  • Pin 1 to Pin 5 on chip (ATMEGA 328)
  • Pin 2 to GND
  • Pin 3 to Pin 4 on chip (ATMEGA 328)
  • Pin 5 to +5

Click on the image to see the PS/2 Keyboard connector from the BOTTOM. Pin 1 is on the right, pin 2 above it, pin 3 to the left, pin 4 to the left, pin 5 to the left and pin 6 to the left and down.

VIDEO

Video and mono audio can also be achieved.  Video is generated by soldering two resistors together on one end and then connecting the other ends to different pins on the chip.  Audio imagecomes directly from pin 11 on the 328 chip. Refer to the diagram.  For UNO and compatibles, you will need a 1k Ohm resistor connected to pin 9 for the sync signal and a 470 ohm resistor connected to pin 7 for the video itself. Software controls the actual generation of the signal.  The other ends of the resistors should be soldered together and form the composite video and goes to the center pin of the video connector. The other (or outer) pin of the video connector goes to ground. 

AUDIO

Audio is also generated by software and consists of Atari Pong style beeps.  Connect the center pin of the audio connector to pin 11 of the chip and the ground to the outer shell or other pin of the audio connector.

Libraries

You need the following libraries:

  • TVOUT (Google has announced that they are shutting down google code, so grab this while you can. I do not know where it will end up.)

Apple Watch, MacBook Air and Apple TV: a quick update

MacBook_PF_OP30_Svr-PRINTApple announced a few things at a press event held March 9, 2015.  Among the things they showed are new Macs and the Apple Watch.  They also announced a new $69 (US) Apple TV and HBO Now, which is exclusive to Apple for the time being.

The MacBook Air gets a major refresh with a super smooth shell.  One connector, USB-C, is all that adorns the shell of the laptop.  A new keyboard also comes with the machine.

Now, the single connector on this very nice looking laptop handles EVERYTHING, including video out and power.  What this means is that the device will need to be tethered to a $79 (US) port extender accessory.  Without this dongle, you cannot charge the device AND connect ANYTHING else to the computer.

Admittedly, I have the ‘I want it’ for the hardware, even with that rather arcane limitation. There’s no reason why a second connector could not have been added.

The Watch.AplWatch-HomeScreen-PR-PRINT_2

Yes, they showed off more of the watch. It features an 18 hour battery life, three different styles and lots of apps already to go. The base watch-you know, the one everyone will buy-will cost $350, the Apple Watch will sell for $500 and the Apple Watch Edition will START at $10,000. The Sport edition, at $350, is the most affordable. Bands for the watches range from $40 to $500. 

Now, smartwatches are worth having, they can be very useful…but, tethering them to a smartphone seems a bit silly, and I say that in regard to the Android watches as well as the Apple Watch.  What we need is one that works with ANY device, Android, IOS or other. 

AplWatch-3Up-Features-PR-PRINTApple also talked about ResearchKit, a set of API’s that will be used for medical research.  This one seems a bit forced and not overly interesting.  You can read more about it here.  I don’t care about it enough to write more.

Perhaps the most interesting thing to come out of the press event was the HBO Now and Apple TV announcements. HBO Now will be available to Apple devices for $14.95 a month, much like cable tv prices.  Apple TV gets dropped down to $69 (US), a thirty dollar reduction. You KNOW the Roku was just killing it if Apple drops it price that much.

Over all, the press event was lackluster and the products, while interesting, could have just been released without an event and they would have done just fine. These things are just tired now.

The products, though, are not.  Apple continues to show that design over function will sell and these are no different. I’m not sure they will sell many $500 or $10000 watches, but the $350 one just might hit it. And, at $69, the Apple TV is a sweet deal.  Not quite as versatile as a Roku, but still worth the money.  Don’t forget that gorgeous, lusty laptop.  Buy it, put Windows on it and you have a really nice computer.

Go to Apple.com watch the press event.

The weird tale of WebOS: from Palm to LG, a strange journey indeed

pre_05Introduced in 2009 by Palm, webOS (as it was then) was new, unique, fresh and, dare I say, ‘cool’? The mobile operating system was going to be the answer to Palm’s dire situation: Smartphones, headed by Apple’s iPhone, were all the rage. Sales of dedicated devices fell off the face of the earth and everyone, seemingly, wanted a smartphone, preferably the iPhone.  Companies scrambled to introduce a new phone.  Apple, Google, Microsoft, Blackberry and Palm all had phones out. Palm’s success with the Centro was waning.  Sales of its stand alone PDA devices were non-existent and things were beginning to look grim.

At some point, in 2008, they began work on webOS.  At its core was an embedded Linux kernel.  It’s user interface layer, however, was radically different.  It and other parts of the OS were built with web development technologies such as javascript, HTML 5, CSS and xml.  There were API’s written native to the hardware, but most of the OS was done with these web technologies. This was meant to keep it simple.  Palm introduced a clever and nice looking device to run the new operating system: the Palm Pre.  The Pre looked like a smoothPalmPixi pebble, something you could easily jump across water.  It was elegant.  It was also flawed.

The phone was released in July of 2009 on the Sprint network.  Some say that was it’s death knell and, I’d say that was close to spot on.  Sprint, already in dire straits itself, did little to support the phone.  They did not have the iPhone, so one would think they would have supported it better, but, they did not. With in the year, the Pre was available on AT&T and Verizon. The Pre 2 and Palm Pixi were released, but, by now, Palm was in trouble.

A seeming white knight came hopping along in the guise of HP. HP, run by Mark Hurd at the time, was going to do a lot with the Palm division.  A tablet was going to come out, webOS was going to be put into everything from Printers to PC’s and phones.  PC’s would dual boot webOS and Windows 7.  Things looked great.  For a very short time, that is.

Mark Hurd was ousted in a controversy of his own doing. Leo Apothekar was brought in and he immediately made a terrible decision:  He came from the services industry and decided that HP should be one too.  He was going to split HP’s hardware out, kill Palm and the PC division would be sold.  Gone, almost as soon as it came out, was the HP Palm Slate. The tablet ran webOS 3.0 and was fantastic.  When the cancellation was announced, fire sales ensued.  The price went from well over $300 to $99.  Sales were so brisk, that HP decided to do a second production run-using the parts left over from the first-and those sold out as well.  And, with that, the Palm company was dead.  So were the grandiose ideas for webOS.

Along the way, however, Apothekar was ousted and Meg Whitman came in to save HP. She announced that while Palm as hardware was no more, the webOS would continue.  Weeks later, she announced that HP would open source the Operating System and, possibly, use it as well.

weboswatchIn 2013, it was announced that LG (Lucky Goldstar for all of you who remember Goldstar from the 80’s) would purchase the IP and source to the operating system from HP.  LG wanted to use the OS in its televisions, which they have done.  In 2015, LG showed off a SmartWatch that uses a flavor of WebOS (as it is now spelled) as the core os for its new wearables.  This watch is, in effect, a phone. So, WebOS has come full circle: from phone, to tablet, to television to watch/phone.  The odd tale of the operating system that refuses to die is just getting good.

Stay tuned, I’m sure more weird things will happen.

That’s no Superfish, Lenovo, its stinkyfish

For years, when you bought a new PC from the likes of Dell, HP, Lenovo and other Windows PC makers, you tended to get crapware on the computer.  These companies make a few dollars by installing this crapware that you, likely, never use.  Most of the time, all it tends to do is eat up space on the storage device and, often, can slow your computer down a bit.  Now, however, it can also break something called SSL and that’s bad.

The crapware in question is called Superfish and it came pre-loaded on consumer PC’s from Lenovo.  Now, before I go on, let me say that Lenovo, a Chinese owned company, makes excellent computers.  They made the IBM Thinkpad and desktop computers for years before buying the whole line from IBM.  The consumer grade stuff is just as well designed and built and I would have recommended them in a heartbeat.

Sadly, I can’t do that now.

Superfish is a package that injects advertising into web pages.  ANY web page, even those that did not have any ads.  And, worse, it had to break SSL encryption to do so.

I uses a root certificate that is SHARED.  That is, it is packaged with the product and distributed to any computer that gets Superfish.  It takes precedence over the SSL certs that are installed.  It is called a ‘middle man’ attack and it is bad.  What it means is that when you log into a site, say your bank, that is secure and uses SSL, this product negates that and then serves up the ads.  In doing so, it opens up your connection to snooping and your computer becomes vulnerable.

Initially, Lenovo said it was a benefit, giving its users a chance to see ‘alternative’ choices in the ads it served.  As anger grew, Lenovo’s response changed, several times, and now the company is saying that they will no longer offer up crapware.  They have been cagey about this, so time will tell if they mean it or not.

Now, the company that developed Superfish claims that the piece that breaks encryption was developed by another company, Komodio, This is troubling because this company has its hooks in well over a hundred other applications and services, including several anti-virus applications, parental control apps (just stick with the Microsoft supplied solution for this, it is great and works well) and other popular applications. 

eWeek has a  much better explanation of the problem here.

Sadly, I cannot recommend Lenovo and will even go so far as to say you should probably avoid it for now.  While the Superfish crapware can be removed, Lenovo’s response and initial attitude has discredited them and, for me, it will take a long time to rebuild that trust.  Sad, really, since the hardware is great. 

And, by the way, Microsoft’s Security Essentials has been update to detect and wipe out this mess.  It thinks it is a virus.

I’d say it is right.