Testing the first keyboard. It is the 8085-SDK hex matrix keyboard.
It is running on a Raspberry Pi Zero 2, without X server. So the images are displayed using the framebuffer. Also the touch data is read using evdev and the raw devices.
Todo:
HID part
Add a rotary button for the selection of the different Keyboard Layouts
Improvement keyboard matrix calculation to find out which key is being pressed.
Code to control AT/PS2 computers directly using GPIO pins
Add a controller to use Raw controlling of matrix pins ( 6502 C64 hardware for example )
import select
from math import floor
import sys
slot = 0
keysname=[["F","E","D","C","vect-int","reset"],
["B","A","9","8","GO","Single-Step"],
["7","6","5","4","Exam-reg","Subst-mem"],
["3","2","1","0","Exec","Next"],
]
keysnames=[["F","E","D","C","vect-int","reset"],
["B","A","L","H","GO","Single-Step"],
["PCL","PCH","SPL","SPH","Exam-reg","Subst-mem"],
["3","2","1","0",".",","],
]
for path in evdev.list_devices():
device = evdev.InputDevice(path)
if evdev.ecodes.EV_ABS in device.capabilities():
break
else:
sys.stderr.write('Failed to find the touchscreen.\n')
sys.exit(1)
while True:
r, w, x = select.select([device.fd], [], [])
id_ = -1
x = y = 0
for event in device.read():
if event.code == event.value == 0:
if id_ != -1:
yy = floor(( x - 600 ) / 700)
xx = floor(( y - 1377 ) / 226)
if yy < 4 and yy >=0 and xx < 6 and xx >= 00:
if slot == 1:
print(keysnames[yy][xx])
else:
print(keysname[yy][xx])
elif event.code == ABS_MT_TRACKING_ID:
id_ = event.value
elif event.code == ABS_MT_SLOT:
slot = event.value
elif event.code == ABS_MT_POSITION_X:
x = event.value
elif event.code == ABS_MT_POSITION_Y:
y = event.value
I came up with a simple matrix calculation
Pressing the 4 corner keys gave me x and y. I took averages for min and max reading. I don’t need pixel-perfect reading, and I noticed values between 960 and 3080 vertically. We want 960 – 3080 into 4 blocks, but the middle should start @ 960.
So 3080/3 = about 700 700 / 2 = 350 block 1 starts 350 sooner than 960 is ~ 600 Upper key y coords = 600-> + 700 Next is 1300 -> + 700 converting to whole numbers using floor gives me: floor(( y – 600 ) / 700) NOTE: My x and y are rotated
Example using coordinates 1600, 1600 floor(( 1600 – 600 ) / 700) = floor(1,4…) = 1st row (from row 0,1,2,3)
I’ve been busy programming Python and NodeRed for a client. But these are the things I’ve done in the last days.
C64 Assembly: Breaking borders, using sprites and multicolor font intro.
It does not look impressive, but I’ve learned a lot. Found a new way (for me) to open borders and change border colours on predefined raster lines. Sources will be posted.
KiCad tutorial, posted on YT also because I could not find many resources about the subject online. Maybe it’s helpful
Video editing using Kdenlive.
Edit: Even faster, use Netlabels, no need to join pins. Press L (uppercase) select pin 1, name 1. Press and hold insert until all pins named. Copy paste socket 5 times and goto your PCB tab.
This movie is about creating a backplane for a 6502 SBC I’m building. It is real-time and below 4 minutes.
Multi Keyboard
My small multitouch screen came in. This is for my previously mentioned multi-computer case.
It is going to show multiple keyboard layouts for different systems. (See previous posts about this)
Waveshare display, Raspberry Zero as HID device, using USB and pin emulated keyboards. (c64 matrix, AT (DIN) keyboard, ps2 keyboard)
Some example screens
Vic-20
Photo-realistic
Petscii C64
Another C64
I’m also going to make a layout like the keyboards on my 8085
Niccolò (or Nicolò) Paganini. October 1782 – 27 May 1840) was an Italian violinist and composer. He was the most celebrated violin virtuoso of his time, and left his mark as one of the pillars of modern violin technique. His 24 Caprices for Solo Violin Op. 1 are among the best known of his compositions and have served as an inspiration for many prominent composers.
I love listening to Paganini. The man was a beast. Extreme technical, a pop star in his time. But also because of that, he was seen as a demon.
Like the master bagpipers Stuart Liddell or the late Gordon Duncan.
Listening to Paganini’s caprices was wonderful.
A capriccio or caprice (sometimes plural: caprices, capri or, in Italian, capricci), is a piece of music, usually fairly free in form and of a lively character. The typical capriccio is one that is fast, intense, and often virtuosic in nature.
My top selection :
1,4,5,3
Why difficult?
Because of the advanced techniques, including parallel octaves, rapid interval shifts, extremely fast scales and arpeggios (including minor scales), left-hand pizzicato, high positions, and fast string crossings. Additionally, it features many double stops, such as thirds and tenths.
An arpeggio is a type of broken chord in which the notes that compose a chord are individually sounded in a progressive rising or descending order.
Pizzicato is a playing technique that involves plucking the strings of a string instrument.
Double stops are a fundamental technique in which two notes are played simultaneously on a stringed instrument. In the context of the violin, this entails using the bow to sound two adjacent strings at the same time.
On another note:
I finally got hold of the last missing Audio CD from Martyn Bennett! I was looking for this for ages!
GameA masm setupExample asm program to see gfx capabilities
68000 Progress
My address decoder seems to work (using an ATF22v10C) See previous posts.
Also new Rom and Ram chips. These are 8 bits, but the 68000’s data bus we need two (Odd and Even Addresses)
C64 Hacks
I made a proof of concept for a Rom switcher. 8 Different Roms can be selected using the dip switches. (Dipswitches are being replaces bij something smarter in the future, like an Arduino Nano (like Adrian Black’s solution)
PROCESSOR FUNCTION CODES (FC0, FC1, FC2) These function code outputs indicate the mode (user or supervisor) and the address space type currently being accessed.
The following table shows the
meaning of these three bits.
FC2 FC1 FC0 Meaning
0 0 0 Not used
0 0 1 User data
0 1 0 User program
0 1 1 Not used
1 0 0 Not used
1 0 1 Supervisor data
1 1 0 Supervisor program
1 1 1 Interrupt Acknowledge
These outputs can therefore inform external circuitry what is happening
inside the 68000. They could, for example, be used to switch in differentbanks of memory.
Using a small 8266 with a display, I wanted to see if it’s useful to monitor this information.
So using a trick with the uln2804/uln2803 as level convertor (don’t connect the VCC, and the output will drop to a level that is around the 3.3v. (I was out of bi-directional level convertors)
Latch demo
I’ve been using latches in the past, but I wanted to show how it works using a little demo setup. Below movie is for the Bus Controller I posted recently.
While busy fixing my business site, and working for a customer, I build a testing rig for the 68000.
I first made a power-on reset schematic. The timing is different from the 6502 power-on reset, and the 68k needs HALT and RESET being pulled low.
Inverted reset signal (before the 74ls06 invertor)
Pulse from A17
Schematic with poweron reset, some leds and 8mhz crystal Lines pulled to GND or VCC are at least needed to get a running CPU. Data bus resistors are needed because data is r/w
All Data lines are pulled low, emulating opcode 00 00 https://68k.hax.com/ORI%20to%20CCR This will do nothing weird, and will increment the address and try to read the next opcode. Resulting in an endless incrementing address bus, I’ve put a Led (Red)on Address A17.
For my 68000 POC I’ll need a way to test Address and Data buses. Something I also wanted for my 6502.
So I drew a schematic to make a generic bus manipulator. (Address, Data and some control lines)
Devices I want to control:
6502 – 16 addresses and 8 bit data
6800 – 24 address lines and 16 bits data
808x
LCD Displays – 8 bit data – enable, read/write and register select
SID Music Chip, AY-3-8910 Music chip
I will be using 8 input switches I can latch into 74HC373 chips. (3x 8 bit for addresses, or 2x 8 bit and extra control lines + 2x 8 bit datalines) Using ULN2804A or ULN2803A darlingtons I can use ledbars to display the bus data AND the latched data. Using 5 pushbuttons I can choose which one (or multiple banks will be latched. Other 5 buttons shall control the OUTPUT enable (OE), which also can be toggled using 1 master switch. (Not yet in the schematic)