ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Emulator and emulator development specific topics
User avatar
Paul
Posts: 1550
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by Paul »

There are also 3.2 inch 320x240 spi modules
In theory, there is no difference between theory and practice. But, in practice, there is.
Exile
Posts: 50
Joined: Tue Jan 03, 2023 9:50 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by Exile »

I've now measured the frame rate on my 240x240 LCD and it looks like 50Hz (but not 60Hz) should just be possible on a similar 320 by 240 display.

I've decided to order a 2.8" 320 by 240 SPI display:
https://www.waveshare.com/wiki/Pico-ResTouch-LCD-2.8
https://thepihut.com/products/2-8-touch ... co-320x240

This uses a similar SPI controller to the one I've been testing with and also has an SD Card built in. In theory it should be possible to create a self contained display and storage solution that performs like a UK / European ZX8x. There will be no sound, but I know some do not see that as a deal breaker. I'm planning to ignore the touch capability of the display for now.

As the frame rate will be effectively software controlled, it will be interesting to see how the frame rate effects that some ZX81 programs introduce appear.

I've got a few other projects on the go at the moment though, so it may take me a while to post the results.
Exile
Posts: 50
Joined: Tue Jan 03, 2023 9:50 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by Exile »

I've now implemented support for the https://www.waveshare.com/wiki/Pico-ResTouch-LCD-2.8.

The screen resolution is 320x240. I've set the LCD up to receive RGB444, so that it can work at a sustained 60 Hz refresh rate. The refresh rate can also be configured for 50 Hz and 50.65 Hz. The Waveshare board has an SD Card, and the Pico plugs straight into the back of the board, so it is a very compact solution.

A couple of images can be seen below. The first shows Hi-Res Galaxians. It can be controlled by either the joystick or the USB keyboard (made from a 3d printed ZX81 case) that are also in the shot. The second shows MaxDemo (just) filling the screen, although in retrospect the picture makes it look like the screen has cracked :)

As ever, more information, source code and executables etc can be found at: https://github.com/ikjordan/picozx81

Image
Attachments
lcd_system.jpg
lcd.jpg
zx4ever
Posts: 18
Joined: Wed Jun 27, 2018 10:58 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by zx4ever »

Hi,
Can we use Pico W for this project ?
I read that some GPIO pins have a different function.
Also, is there a difference in boot time between Pico H and Pico W ?
Exile
Posts: 50
Joined: Tue Jan 03, 2023 9:50 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by Exile »

Yes, Pico W is supported, although the emulator does not use the WiFi functionality. @Paul kindly gave me a Picomite board to work with, which had a Pico W installed.

The boot time for the Pico H or W is very short, a few milliseconds. The time to get to the "K" prompt is governed by the emulated ZX81 ROM stepping through and checking its RAM - just like the real thing :-)
Exile
Posts: 50
Joined: Tue Jan 03, 2023 9:50 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by Exile »

The latest updates to picozx81:

1. More LCD displays are supported, using the Cytron Maker board as a base.
2. Colour comes to picozx81! Chroma is now supported for VGA and LCD displays.

Pre-built executables can be found at: https://github.com/ikjordan/picozx81/tree/main/uf2
Documentation and pictures can be found at: https://github.com/ikjordan/picozx81/bl ... /README.md
zx4ever
Posts: 18
Joined: Wed Jun 27, 2018 10:58 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by zx4ever »

My Olimex RP2040-PICO-PC Board has arrived and I tried to start with this great emulator, but I came across an unexpected problem.
I followed the procedure, I first recorded a microSD card, then connected Pico H and Olimex Board to PC via USB cable with pressed BOOTSEL button and it normaly recognized Pico as a USB Storage with 127 MB Free Ram.
Then I dragged the The UF2 file (picozx81_olimexpc_hdmi_sound.uf2) on Pico Storage and after that Pico automatically unmounted from PC.
But, when I connected the Olimex Board with HDMI cable to my TV, I do not get any picture and even worse, my HDMI output is totally inactive and grayed out in the OSD menu, which indicates that was not connected at all.
I checked the HDMI cable and TV, by connecting it to my Raspberry PI 3 and HDMI immediately became active, even with PI3 turned off.
I don't think I'm wrongly connected Pico on the Olimex Board, (both USB connectors are on the same side, one below another), the red LED light on the Oilimex Board is On, when I connect it to PC USB or official raspberry pi PSU 5V.
It acts correctly as a USB Storage with or without the Olimex Board attached.
When I turn it on again as a USB storage, UF2 file from previous session is no longer there, but I guess it's normal.
I also tried with some other UF2 files including alternative picozx81_olimexpc.uf2, but the problem persist, simply I don't have any signal from the HDMI connector on the Olimex Board on my TV, with or without Pico inserted.
Perhaps my pico is defective (purchased on eBay from the Chinese seller), while Board was purchased from a reliable UK distributor of Raspberry Pi equipment.
What should be done first, try another pico or maybe there is a way to check the Olimex HDMI connector somehow ?
When working properly, does HDMI connection became active as soon as it connects board to the TV (as my PI3) or only when powered on ?
In my case, in both situations, I have no signal on TV.
zx4ever
Posts: 18
Joined: Wed Jun 27, 2018 10:58 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by zx4ever »

Meanwhile, I tested the board with Audio.uf2 test program from the official Olimex Github page and sound works well through 3.5mm audio output jack.
Unfortunately, the dilemma is still there, except that my Pico H obviously works, but I'm still not sure, what is the cause of the lack of HDMI connection, maybe Pico or faulty hdmi board connector, or something else.
I tried three HDMI cable of different lengths and both HDMI connectors, but my TV still does not detect any video signal through HDMI.
I also have a monitor with a DVI input, I will try later to get some DVI-HDMI adapter to try on it, but slowly running out of ideas...
Exile
Posts: 50
Joined: Tue Jan 03, 2023 9:50 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by Exile »

Thanks for trying picozx81 :-)

Some makes of TV detect an HDMI device by looking for 5V on pin 18 of the HDMI connector. Unfortunately, by default, the Olimex board does not supply 5V to that pin. However, there are two pads on the back of the board, which when shorted with a blob of solder, will enable the 5V. They are labelled "SJ1 HDMI +5V Out" on my board.

If you'd like to verify this before soldering, then you can test by connecting the Olimex to a PC monitor with HDMI out. All the monitors I have tried do not check pin 18.
zx4ever
Posts: 18
Joined: Wed Jun 27, 2018 10:58 pm

Re: ZX80 / ZX81 Emulator for the Raspberry Pi Pico

Post by zx4ever »

Exile wrote: Tue Mar 19, 2024 9:14 am Thanks for trying picozx81 :-)

Some makes of TV detect an HDMI device by looking for 5V on pin 18 of the HDMI connector. Unfortunately, by default, the Olimex board does not supply 5V to that pin. However, there are two pads on the back of the board, which when shorted with a blob of solder, will enable the 5V. They are labelled "SJ1 HDMI +5V Out" on my board.

If you'd like to verify this before soldering, then you can test by connecting the Olimex to a PC monitor with HDMI out. All the monitors I have tried do not check pin 18.
Thank you, for this useful advice, I will try to test it and hope thats the cause of this issue.
It confused me, because my Raspberry PI3A+ immediately establishes HDMI connection, even when its not powered on, but I guess there is a connection with the 5V, which you mention.
I currently don't have a monitor with an HDMI input, because I do not use desktop PC, just a laptop, but I will somehow get it to test it, before soldering.
BTW, did I correctly select the uf2 file version ?
I read somewhere, that Olimex does not support the sound through HDMI, but I may not remember well.
Basically, I would like to know, which of two versions of the uf2 file, I need to use ?
Cheers.
Post Reply