Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:05 09 May 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICOZX81 - a ZX81 emulator for Raspberry Pi Pico

     Page 2 of 4    
Author Message
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 08:27am 19 Dec 2024
Copy link to clipboard 
Print this post

Hi, Thanks to @grogster for alerting me to the thread.

Yes, I'm the author of picozx81. It's great to see it being used. The keyboard looks excellent too, I'm looking forward to seeing the Gerbers

picozx81 supports a range of hardware, including the PicoMiteVGA, the Olimex RP2040 PC and an "all in one" design from Bobricius similar to the one linked above.

The ZX81 was surprisingly capable. It effectively had a software driven display, so with the right code it could generate high res graphics (up to 320 by 240, so higher than the Spectrum   ). It is also possible to generate hi-res graphics on an unexpanded 1K ZX81. There is a very impressive range of hi-res games that run on an unexpanded 1K ZX81 available on SinclairZXWorld, written by "DrBeep". Writing 1k hi-res programs is definitely a challenge!

To support hi-res graphics requires t-state accurate emulation of the Z80 and the ULA. There were also many sound and colour add-ons, plus joystick adapters for the ZX81. picozx81 emulates some of these as well. picozx81 can emulate the original 4k ROM ZX80 too, in case the ZX81 is viewed as too modern.

picozx81 can generate display output to LCD, VGA and HDMI. It can output sound over HDMI. The same HDMI sound library is also used in the excellent pico-zxspectrum Spectrum emulator. It supports sound over a 3.5mm jack too, for those that prefer their sound that way  

Each time I release an update I post at picozx81 release thread

The 2nd Pico that is used in the USB keyboard is effectively being used as an IO expander. With the right hardware (such as that from Bobricius) the emulator + keyboard will run on a single Pico.

In answer to the question about stopping the program listed above: Use the edit keys to delete the quotes, then enter STOP (shift A). The program will then stop with error code D.
Edited 2024-12-19 18:28 by Exile
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 09:18am 19 Dec 2024
Copy link to clipboard 
Print this post

Hi Ian,

nice that you found this thread! (THANKS to Grogster)
Your emulator is really great!

(...a COMPOSITE signal output and support for the "Pico-ResTouch-LCD-3.5" would be great! )

You can find all the information about my keyboard here:
https://forum.classic-computing.de/forum/index.php?thread/34553-keyboard-projekt-f%C3%BCr-zx80-zx81-und-oder-emulator/&postID=513583#post513583

Unfortunately the site is in German and you have to be logged in to download files...
I have attached the Gerber here:
ZX81_Keyb_01_241204.zip
JLCPCB did not include the placement print - the file probably needs to be renamed for this.

In the past, I had realized a PET2001 keyboard with an Arduino Pro Micro - so I also laid it out on the board (but didn't try it out).
https://forum.classic-computing.de/forum/index.php?thread/27159-mein-pet2001-projekt/

I took the layout/matrix of the buttons from this project:
https://github.com/wilco2009/zx80-81-Double-Clone

However, I should have checked the exact positions again - the four rows of buttons are a bit too far apart and the whole board is about 3mm narrower than the keyboard of a real ZX81. That's why the snap domes are not directly under the printed keyboard - it's still OK (at least for me).

I found the installation on the Pico very cumbersome. I simply dragged the .UF2 file onto the Pico and created the data structure by hand according to your template and copied the respective files there. That worked very well.

I have simply attached all the files that I have used:

adafruit-circuitpython-raspberry_pi_pico-en_GB-9.2.1.zip

ROOT (for copying to Raspberry Pico).zip

Keyboards(mit98%Slowview).zip

Please let me know if anything is unclear with my keyboard!

  Exile said  
The same HDMI sound library is also used in the excellent pico-zxspectrum Spectrum emulator.

Unfortunately there is no compiled .UF2 for it - otherwise I would like to try it out...

  Exile said  
In answer to the question about stopping the program listed above: Use the edit keys to delete the quotes, then enter STOP (shift A). The program will then stop with error code D.

MANY THANKS - I have not found any information on how to exit the program...

THANK YOU again for your great emulator!!!

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 05:55pm 19 Dec 2024
Copy link to clipboard 
Print this post

Many thanks for the files.

  Frank N. Furter said  (...a COMPOSITE signal output and support for the "Pico-ResTouch-LCD-3.5" would be great! )

I did prototype some black and white composite output on a bread board, but when I started emulating the Chroma 81 ZX81 colour add on board I gave up on it. Composite colour is tricky! All of the commercial boards I've seen do VGA or HDMI.

The issue with the Pico-ResTouch-LCD-3.5 is that it is 480 by 320, which does not work well with the usual ZX81 resolution of 256 by 192.

  Frank N. Furter said  Unfortunately there is no compiled .UF2 for it - otherwise I would like to try it out...

If you want to use the Olimex board with pico-zxspectrum then there are uf2s here, I helped test them

Olimex RP2040
Olimex RP2350
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 08:03am 20 Dec 2024
Copy link to clipboard 
Print this post

  Exile said  I did prototype some black and white composite output on a bread board, but when I started emulating the Chroma 81 ZX81 colour add on board
What a pity! Black and White would have been enough for me...

  Exile said  I gave up on it. Composite colour is tricky!
Yes, composite color output is quite complicated and time-critical.

  Exile said  The issue with the Pico-ResTouch-LCD-3.5 is that it is 480 by 320, which does not work well with the usual ZX81 resolution of 256 by 192.
That's annoying! ...2.8” is already pretty small...

  Exile said  If you want to use the Olimex board with pico-zxspectrum then there are uf2s here, I helped test them
Yes, is it Christmas already???
Thank you very much! I will try that out. Can I also use my “recreated ZX Spectrum” as a keyboard?

If you have any requests for changes to my circuit board, I may still be able to make them.

Frank

UPDATE:
=======

Hmm, my enthusiasm for the “pico-zxspectrum” is limited. With “ZxSpectrumOlimexPcHdmiAudio640x480x60Hz.uf2” I get no picture at all, “ZxSpectrumOlimexPcHdmiAudio720x576x50Hz.uf2” works on my LG monitor, on my two old DVI monitors one remains dark, the other shows interference on the left edge of the picture. On the LG you can also clearly hear a disturbing sound.
My “recreated ZX-Spectrum” is not recognized at all as a USB keyboard, your (my    ) keyboard works, but unfortunately you can't call up any function keys?!?

Your “picozx81” works better!
But I also had to use your “picozx81_olimexpc_rp2040.uf2” - “picozx81_olimexpc_hdmi_sound_rp2040.uf2” only worked on my LG - both other monitors remained dark. Could it be that this firmware only works if the monitor also has sound???

Frank
Edited 2024-12-20 21:45 by Frank N. Furter
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 05:20pm 20 Dec 2024
Copy link to clipboard 
Print this post

  Frank N. Furter said  
  Exile said  I did prototype some black and white composite output on a bread board, but when I started emulating the Chroma 81 ZX81 colour add on board
What a pity! Black and White would have been enough for me...


Can I ask why Composite? Is it because a composite display has artifacts to make it look more realistic, or something else? Do you have a board with composite out?

  Frank N. Furter said  
  Exile said  The issue with the Pico-ResTouch-LCD-3.5 is that it is 480 by 320, which does not work well with the usual ZX81 resolution of 256 by 192.
That's annoying! ...2.8” is already pretty small...


I did buy a 3.2" 320 by 240 display from Amazon, that was the largest I could find. When I looked today they were still available on amazon.co.uk.


  Frank N. Furter said  Hmm, my enthusiasm for the “pico-zxspectrum” is limited. With “ZxSpectrumOlimexPcHdmiAudio640x480x60Hz.uf2” I get no picture at all, “ZxSpectrumOlimexPcHdmiAudio720x576x50Hz.uf2” works on my LG monitor, on my two old DVI monitors one remains dark,

There is an issue with the Olimex board. It does not power pin 18 of the HDMI connection, which means that some displays do not recognise it. It's been mentioned on these forums before. There is also a discussion and solution here
However, if you apply the fix, you may then find that the pico is back powered by the monitor. The Pimoroni DVI board does not have these issues.

  Frank N. Furter said  
My “recreated ZX-Spectrum” is not recognized at all as a USB keyboard, your (my    ) keyboard works, but unfortunately you can't call up any function keys?!?

Both the ZX81 and Spectrum use an 8x5 keyboard matrix, but they are wired differently, so I expect all of the keys will be jumbled up on the Spectrum. You may be able to get it to work by changing the row and column pin connection order in the Python script that runs on "our" keyboard
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 08:13pm 20 Dec 2024
Copy link to clipboard 
Print this post

@Exile:

I also have a few old CRT monitors here - that would be even more realistic...

The nice thing about the Waveshare display is that the Pico Board only needs to be plugged in. I also have a 3.2” ILI9341 here - but I still have to build an adapter for it.

Thanks for the tip about the Olimex board. I already had to set the solder bridge. My LG did not recognize the board otherwise. Unfortunately, that is not the problem!

  Exile said  Both the ZX81 and Spectrum use an 8x5 keyboard matrix, but they are wired differently, so I expect all of the keys will be jumbled up on the Spectrum. You may be able to get it to work by changing the row and column pin connection order in the Python script that runs on "our" keyboard
Yes, but our keyboard has no “real” function keys. You have implemented them in the emulator with SHIFT+SHIFT+(0-9). That doesn't work with the Spectrum...

With the Arduino Pro Micro (and the Soarer firmware) it would probably be possible to assign the function keys to such a key combination.

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 11:04am 21 Dec 2024
Copy link to clipboard 
Print this post

  Frank N. Furter said  I also have a few old CRT monitors here - that would be even more realistic...

That got me thinking that sometimes hardware is easier than software.
I'm interested to see how composite would look, so I've ordered an HDMI to composite converter for 6GBP from Amazon. I'll let you know how it goes after it arrives.

  Frank N. Furter said  Yes, but our keyboard has no “real” function keys. You have implemented them in the emulator with SHIFT+SHIFT+(0-9). That doesn't work with the Spectrum...

With the Arduino Pro Micro (and the Soarer firmware) it would probably be possible to assign the function keys to such a key combination.


It would be fairly easy to move the key trap code into the Python script that is running on the Pico that is controlling the keyboard. The script would detect the double shift and then emulate a function key press over USB instead. The script already does some key translation, changing a shift period to comma.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 07:22pm 21 Dec 2024
Copy link to clipboard 
Print this post

  Exile said  Do you have a board with composite out?
I forgot to answer you - I have an AX81 ( https://www.jcwolfram.de/projekte/avr/ax81/main.php ) that can do VGA and composite.

  Exile said  It would be fairly easy to move the key trap code into the Python script that is running on the Pico that is controlling the keyboard. The script would detect the double shift and then emulate a function key press over USB instead. The script already does some key translation, changing a shift period to comma.
That would be cool! Then we could use my circuit board without any changes, just with a different imprint.

Frank
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9483
Posted: 04:14am 22 Dec 2024
Copy link to clipboard 
Print this post

Thank you, Exile, for responding.  

Colour composite is very hard to do in a MCU, as I understand.  The only module I ever found that could do it, was the Propeller Backpack, which generated NTSC Composite colour via serial commands.
Smoke makes things work. When the smoke gets out, it stops!
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 01:53pm 24 Dec 2024
Copy link to clipboard 
Print this post

The £5.99 DIGITNOW HDMI2AV composite converter that I ordered from Amazon UK arrived today. I've tested it out and it generates a nice clean composite signal from the HDMI signal put out by the Olimex board running picozx81. It also extracts stereo sound from the HDMI signal and sends that over the composite audio ports. It does colour, as well as black and white. It can output to both NTSC and PAL standards. As expected certain colour combinations look poor when NTSC is selected

The converter should be small enough to put in a ZX81 case. It requires 5V through a USB Mini port. If you wish to use Composite output from picozx81, I can recommend it. It's definitely easier than trying to write a driver for colour composite out  

I had a quick look on amazon.de and the same model seems to be available for €7.99.
Edited 2024-12-24 23:54 by Exile
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 02:29pm 24 Dec 2024
Copy link to clipboard 
Print this post

@Exile:

Thank you very much! I think I'll get one of these and try it out.

Merry Christmas to all!!

Frank
 
JanVolk
Senior Member

Joined: 28/01/2023
Location: Netherlands
Posts: 219
Posted: 07:54pm 27 Dec 2024
Copy link to clipboard 
Print this post

The ZX81 was also my first computer.

https://github.com/ikjordan/picozx81/releases/tag/v2.0.0

I played around with this .uf2 firmware and everything works on my Olimex board with HDMI and sound and SD card and standard USB keyboard and the function keys all have a function, even the setup can be set and there is a function key for the ZX81 keyboard.

Greetings,
Jan.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 07:16pm 28 Dec 2024
Copy link to clipboard 
Print this post

  Exile said  The £5.99 DIGITNOW HDMI2AV composite converter that I ordered from Amazon UK arrived today. I've tested it out and it generates a nice clean composite signal from the HDMI signal put out by the Olimex board running picozx81. It also extracts stereo sound from the HDMI signal and sends that over the composite audio ports. It does colour, as well as black and white. It can output to both NTSC and PAL standards. As expected certain colour combinations look poor when NTSC is selected

The converter should be small enough to put in a ZX81 case. It requires 5V through a USB Mini port. If you wish to use Composite output from picozx81, I can recommend it. It's definitely easier than trying to write a driver for colour composite out  

I had a quick look on amazon.de and the same model seems to be available for €7.99.


I received my converter today. Thanks for the tip - the converter works really well!

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 09:09pm 31 Dec 2024
Copy link to clipboard 
Print this post

@JanVolk - I'm glad it is working for you  

@Frank N. Furter  - Now you can enjoy the CRTs  

I've had a go at adding the function key generation into the Python ZX81 keyboard code. A double shift followed by 1 to 9 generates function F1 to F9. Double shift followed by 0 generates Escape

It's on the function branch at ZX81_USB_KBD

Happy New Year to everyone!
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 11:47am 01 Jan 2025
Copy link to clipboard 
Print this post

  Exile said  I've had a go at adding the function key generation into the Python ZX81 keyboard code. A double shift followed by 1 to 9 generates function F1 to F9. Double shift followed by 0 generates Escape


    Thank you very much, that's great!!!

Frank
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 06:18pm 01 Jan 2025
Copy link to clipboard 
Print this post

@Exile:

Shouldn't it be enough if I simply copy the new "code.py" to the drive?

...no change - SHIFT+SHIFT+Number does not trigger any function keys...

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 06:44pm 01 Jan 2025
Copy link to clipboard 
Print this post

I've sent a PM with some more details. The key thing to check is that you have downloaded the code.py from the function branch (not the main branch).

I've attached the code.py (zipped) here too. You may have difficulty writing to the Pico, as the boot.py that runs at start-up disables writing to the Pico flash from the PC. If this is the case, do the following:

   1. Connect to Thonny and stop program execution by pressing the red square
   2. Enter the following into the shell:
import storage
storage.remount("/", readonly=False)

You will now be able to save updates back to the Pico.

Fingers crossed  

code.zip
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 07:22pm 01 Jan 2025
Copy link to clipboard 
Print this post

@Exile: Thank you! I have replied to you.

Frank
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 936
Posted: 10:54am 02 Jan 2025
Copy link to clipboard 
Print this post

Ok, I've done it the hard way!  

- I have deleted the flash with "Clear_flash.uf2"
- I then reinstalled CircuitPython with
 "adafruit-circuitpython-raspberry_pi_pico-en_GB-9.2.1.uf2"
- I then copied all the files from "ROOT (for copying to Raspberry Pico).zip"
 from my attachement to the Raspberry Pico with the exception of "boot.py"
- Finally, I copied "boot.py" from the above attachment to the Raspberry Pico.

NOW IT WORKS!!!  

Frank
 
Exile
Newbie

Joined: 27/05/2023
Location: United Kingdom
Posts: 28
Posted: 05:32pm 02 Jan 2025
Copy link to clipboard 
Print this post

  Frank N. Furter said  NOW IT WORKS!!!  

Excellent. Thank you for the testing!

I've merged the changes back onto main. I've kept the two versions in separate files, so people can choose the behaviour they prefer. I've updated the Readme to reflect the steps required.
 
     Page 2 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025