UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Reply
 
Thread Tools
Old 27th Dec 2021, 3:01 pm   #141
DeltaAlpha52
Tetrode
 
Join Date: Feb 2020
Location: Crawley, West Sussex, UK.
Posts: 77
Default Re: MK14 Programming Interface

Happy Christmas all

Well I got Slothie's Pi key interface board wired up and working - didn't have a Pi zero around so used an ordinary Pi and built the wire interface. It works great, although the network cable does run across the top of the MK14 at present.

Having got that working I wondered if I could take the web interface that I'd built for the ESP8266 and use it on the PI.

Well the answer is yes I could. Using the lighttpd web server, brushing up on my HTML, CSS, Javascript, PHP, Python and working out how AJAX interface works, I have found it possible to control the MK14 keyboard from a web page on the PI. Why does it take so many different languages etc., to get the websites to work.

Hopefully I can get the code tidied up, documented, and up on github in a few days.

Cheers
David
Attached Thumbnails
Click image for larger version

Name:	piconnected.jpg
Views:	51
Size:	81.3 KB
ID:	248433  
DeltaAlpha52 is offline   Reply With Quote
Old 28th Dec 2021, 12:38 pm   #142
Timbucus
Octode
 
Join Date: Mar 2019
Location: Barry, Vale of Glamorgan, Wales, UK.
Posts: 1,193
Default Re: MK14 Programming Interface

Nice one with a little PI0W that will be a really useful upgrade to the Sirius software
Timbucus is offline   Reply With Quote
Old 28th Dec 2021, 5:21 pm   #143
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 8,853
Default Re: MK14 Programming Interface

It seems we now have a couple of mad geniuses on the case, what with DA52 here and coolsnaz2 elsewhere. I look forward to seeing the finished article, although I don't think I am clever enough to understand how the web interface side of it all works.

Did you also get the ESPxx version of this fully working as well, Dave, or have you now decided to continue development on the Pi only?
SiriusHardware is online now   Reply With Quote
Old 28th Dec 2021, 9:25 pm   #144
DeltaAlpha52
Tetrode
 
Join Date: Feb 2020
Location: Crawley, West Sussex, UK.
Posts: 77
Default Re: MK14 Programming Interface

Not so sure about the mad bit, or the genius really - I just love messing around with stuff and the MK14 has given me that opportunity.

The ESP8266 version of this is fully working with my interface PCB. The dummy pages I stuck up on my webserver are just that - dummy pages - although with what I've learnt creating the Pi interface I might be able to make them a bit better.
The ESP8266 code is loaded at https://github.com/dallday/MK14ESP8266keys but it requires my PCB to handle charleplexing as the ESP8266 does not have enough pins. I was thinking about an ESP32 version - but I've not got around to buying an ESP32

The Pi version of the web interface uses mainly PHP, with some HTML, CSS and javascript - plus slightly modified version of the python scripts in the scripts folder. I changed the one that sends a .hex file giving it a second parameter which can be either 1 or 2 denoting the OS to use.

I have uploaded the current version for the Pi web interface to
https://github.com/dallday/mk14keyswebpages

If someone want to try installing it I'd love to know if my instructions work - and any comments would be welcome.
DeltaAlpha52 is offline   Reply With Quote
Old 29th Dec 2021, 12:17 pm   #145
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 8,853
Default Re: MK14 Programming Interface

I'm away from the Bat-Cave just now but when things are back to normal post New-Year I will try to give this a go as I do have all of the relevant hardware, whereas I don't currently have an ESPxx or your charlieplexed version of the optocoupler interface.
SiriusHardware is online now   Reply With Quote
Old 29th Dec 2021, 3:40 pm   #146
Slothie
Octode
 
Join Date: Apr 2018
Location: Newbury, Berkshire, UK.
Posts: 1,166
Default Re: MK14 Programming Interface

Just to add some spice to the mix, with a connected ESP32 or Pi, it should be possible to connect to the display and "read" the seven segment display as it changes, and put that on the web page.......
Or you could just hook up a webcam and stream the display
Slothie is offline   Reply With Quote
Old 30th Dec 2021, 5:57 pm   #147
DeltaAlpha52
Tetrode
 
Join Date: Feb 2020
Location: Crawley, West Sussex, UK.
Posts: 77
Default Re: MK14 Programming Interface

Would love to have a way of "reading" the mk14 display - apart from anything else it could act as a good feedback for the keys14 programming interface code - zoom zoom.

Web cam with character recognition ?
DeltaAlpha52 is offline   Reply With Quote
Old 30th Dec 2021, 7:55 pm   #148
DeltaAlpha52
Tetrode
 
Join Date: Feb 2020
Location: Crawley, West Sussex, UK.
Posts: 77
Default Re: MK14 Programming Interface

Whoops minor tweek to the send14_file.py script - was checking a different .hex file and it was in lower case - all the ones up to now have been in upper case. This caused a checksum failure in the script.
Also updated it to include the values that were in error and the line where the error was found.

Cheers
David
DeltaAlpha52 is offline   Reply With Quote
Old 30th Dec 2021, 8:22 pm   #149
Phil__G
Hexode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 272
Default Re: MK14 Programming Interface

Quote:
Originally Posted by DeltaAlpha52 View Post
Would love to have a way of "reading" the mk14 display
You can read the display contents at 0xD00 but how to get this info back through the programming interface?
Phil__G is offline   Reply With Quote
Old 31st Dec 2021, 10:58 am   #150
DeltaAlpha52
Tetrode
 
Join Date: Feb 2020
Location: Crawley, West Sussex, UK.
Posts: 77
Default Re: MK14 Programming Interface

But isn't 0xD00 just the display "latches" - reading that address gives the keyboard values - and I'm sure I read some where about reading 0xD00 impacts the values displayed

Mind you I could attach to the address / data lines and extract the values when the D00 address is written to. I'm sure the arduino can run fast enough to do that and the issue vi board has all the address/data lines on the edge connector.
DeltaAlpha52 is offline   Reply With Quote
Old 31st Dec 2021, 11:13 am   #151
Slothie
Octode
 
Join Date: Apr 2018
Location: Newbury, Berkshire, UK.
Posts: 1,166
Default Re: MK14 Programming Interface

Quote:
Originally Posted by DeltaAlpha52 View Post
But isn't 0xD00 just the display "latches" - reading that address gives the keyboard values - and I'm sure I read some where about reading 0xD00 impacts the values displayed

Mind you I could attach to the address / data lines and extract the values when the D00 address is written to. I'm sure the arduino can run fast enough to do that and the issue vi board has all the address/data lines on the edge connector.
You could just monitor the inputs to the 7445 and the outputs from the LED drivers, and just read the outputs of the drivers whenever the LSBit of the 7445 inputs.
Slothie is offline   Reply With Quote
Old 31st Dec 2021, 6:01 pm   #152
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 8,853
Default Re: MK14 Programming Interface

Quote:
Whoops minor tweek to the send14_file.py script - was checking a different .hex file and it was in lower case
Indeed, the original script expects the alpha characters in the Intel Hex file to be upper case. To be fair I have NEVER seen an Intel Hex file with its alpha characters in lower case but as you say it doesn't take much twiddling to get it to accept both.
SiriusHardware is online now   Reply With Quote
Old 1st Jan 2022, 12:22 pm   #153
DeltaAlpha52
Tetrode
 
Join Date: Feb 2020
Location: Crawley, West Sussex, UK.
Posts: 77
Default Re: MK14 Programming Interface

I expect when the hex format was designed ( 1973 ? ) most systems tended to only really use upper case. I can remember that the fast chain printers at work only did uppercase characters, having lower case on the chain would have really slowed the printers down. Mind you I did not want to be near them when they were printing due to the noise.

The file I came across was from doug rice and was generated from the rcasm assembler. I was looking at various cross assemblers - his pages are a mine of information.

Hope you have a happy Christmas and new year
David
DeltaAlpha52 is offline   Reply With Quote
Old 1st Jan 2022, 12:40 pm   #154
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 8,853
Default Re: MK14 Programming Interface

I actually went looking to see if there was a 'law' regarding upper / lower case in Intel Hex files, and the only comment I could find regarding that was on the information page regarding Intel Hex format on San Bergman's site in which one sentence states that the record should be read correctly regardless of case, although he doesn't say where that came from.

I can honestly say that I have never, ever seen an IH file with its alpha characters in lower case but as you say, it only takes a very small change to allow for this rare possibility, so it is a sensible addition.

The problem can probably also be solved by using the Linux TR command to translate all lower case characters in the file to upper case, like this:-(untested)

Code:
tr [:lower:] [:upper:] < originalfilename.hex > modifiedfilename.hex
With regard to the provision of a switch to allow to choose 'New OS' or 'Old OS' mode at runtime, when I originally put it together I couldn't imagine a world where anyone would have more than one MK14 or would need to change that setting more than once... but how little I knew.

We've also discussed the possibility of switches to set the key press / release delay values to optimum for a 4.00MHz machine or a 4.43MHz machine, and for a selectable 'VDU slow mode' which slows down the key entry speed for a machine which is being slowed down by an active, attached VDU. My feeling at the time was that all those options would be better incorporated into a pull down menu on a future GUI version of the uploader.

Last edited by SiriusHardware; 1st Jan 2022 at 12:54 pm.
SiriusHardware is online now   Reply With Quote
Old 1st Jan 2022, 1:31 pm   #155
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 8,853
Default Re: MK14 Programming Interface

With respect to the idea of reading the display hardware so that what it is displaying can be displayed on a 'mimic display' on the web page, this is starting to go too far in the direction of Doug Rice's online emulator. If you can't even see that you are using / running your code on a real MK14, is there actually any point in it working that way?

I think if you are going to put an MK14 online for people to play with then they really need to be able to see it and watch it respond as they 'press' the keys, which takes us back to the original idea of a webcam looking at the machine.
SiriusHardware is online now   Reply With Quote
Old 3rd Jan 2022, 12:51 am   #156
DeltaAlpha52
Tetrode
 
Join Date: Feb 2020
Location: Crawley, West Sussex, UK.
Posts: 77
Default Re: MK14 Programming Interface

The case issue I "fixed" in my python script by using the upper method on the line read from the file.

for lineraw in fileobj:
line = lineraw.upper()

and then process the line string, it already handled lower case letters in the conversion of each pair of bytes to hex but failed the check sum comparison. The change not yet updated in github.

The esp8266 version uses the fact that if you add up all the byte values, including the checksum, then the answer should be 0 - when truncated with 0xFF. Maybe I should change the python version to do that

The web cam seems like a great idea, I'm pretty sure I can create a web page to show the web cam along side the control page.
I've done some initial testing on my PI version 2 but . . . . . it's not powerful enough - you get a picture but it's always a few seconds behind reality.

Have to see if I can get a PiZerow2 or a Pi4 to test it on.

Stay safe and cheers
David
DeltaAlpha52 is offline   Reply With Quote
Old 3rd Jan 2022, 12:57 am   #157
DeltaAlpha52
Tetrode
 
Join Date: Feb 2020
Location: Crawley, West Sussex, UK.
Posts: 77
Default Re: MK14 Programming Interface

and to say that I tested
tr [:lower:] [:upper:] < originalfilename.hex > modifiedfilename.hex
and it seems to do the trick beautifully
DeltaAlpha52 is offline   Reply With Quote
Old 3rd Jan 2022, 10:20 am   #158
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 8,853
Default Re: MK14 Programming Interface

Better for the script to handle it properly in the first place though, I agree.

Since quite early on most Pis have had a connector on the PCB for a specific accessory camera module which is directly connected to the system rather than connected via USB. They come in 'normal' and I/R versions.

I don't know if these would be less resource heavy / cause less lag, but I also don't know what the maximum length of the interconnecting cable is or can be. With the Pi already connected to the RH edge connector, you wouldn't want the physical position of the Pi to be determined by the length of the cable to the camera.

Edit: There now seems to be a bewildering array of directly attachable camera modules, in addition to the official modules. All depend on the Pi having the specific onboard camera connector, which not all Pi models do.

Last edited by SiriusHardware; 3rd Jan 2022 at 10:42 am.
SiriusHardware is online now   Reply With Quote
Old 3rd Jan 2022, 9:23 pm   #159
Slothie
Octode
 
Join Date: Apr 2018
Location: Newbury, Berkshire, UK.
Posts: 1,166
Default Re: MK14 Programming Interface

Quote:
Originally Posted by SiriusHardware View Post
Edit: There now seems to be a bewildering array of directly attachable camera modules, in addition to the official modules. All depend on the Pi having the specific onboard camera connector, which not all Pi models do.
Many USB cameras can be connected to the Pi's USB port too. So if you have one you don't need to buy a Pi specific one provided the one you have is supported (as most cheap ones are).

The Pi Zero has a different camera connector to the Pi 3/4 and a special camera just for the Pi Zero, which is cheaper, but there are also cables available to allow cross-compatibility.
Slothie is offline   Reply With Quote
Old 3rd Jan 2022, 11:04 pm   #160
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 8,853
Default Re: MK14 Programming Interface

As I read it, DA52 has tried using a USB camera (post #156) and is suffering a lot of lag.

Historically speaking USB comms had to go through a bit of a bottleneck on the Pi since all USB traffic went through one narrow channel, or that was my understanding - That may have improved on the later models.

Imagine trying to initiate an action on the online connected MK14 and not seeing it respond for several seconds, it would be like trying to speak while listening to your own delayed voice.

The 'proper' cameras for the Pi seem to have their own exclusive highway over which to communicate with the Pi.
SiriusHardware is online now   Reply With Quote
Reply

Thread Tools



All times are GMT. The time now is 12:14 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Copyright ©2002 - 2021, Paul Stenning.