Real Input and Output on the Pi emulation

Everything about Andy Key's great Emulator MEMU
TimoHartong
Posts: 28
Joined: 23 Sep 2024 16:11

Re: Real Input and Output on the Pi emulation

Post by TimoHartong »

Can I propose I get the code and test it ?.
Bill B
Posts: 641
Joined: 26 Jan 2014 16:31

Re: Real Input and Output on the Pi emulation

Post by Bill B »

Go ahead. All feedback welcome.
TimoHartong
Posts: 28
Joined: 23 Sep 2024 16:11

Re: Real Input and Output on the Pi emulation

Post by TimoHartong »

I have compiled the source and it seems to be working. Running a longer test now with as base my loop test program. Now out and input is tested 65536 times :D. I will run further tests tomorrow. Particular exit and reentering the MEMU simulator and switching on and off the Pi-Zero.
TimoHartong
Posts: 28
Joined: 23 Sep 2024 16:11

Re: Real Input and Output on the Pi emulation

Post by TimoHartong »

Today ran some further tests:
- Power on Pi , start memu run loop 0-255 loop program . Result : OK
- Close memu, start memu run loop 0-255 loop program. Result : OK
- Reboot Pi, start memu run loop 0-255 loop program . Result : OK
- Close memu, Start Memu run 255 x 0-255 loop program : Result OK.
If this works with the real simulator hardware I can only test in the museum because no schematics are available from the real I/O. But for now it looks promising with the current I2C code. If the I2C does not work we perhaps to have resort to real GPIO.
Bill B
Posts: 641
Joined: 26 Jan 2014 16:31

Re: Real Input and Output on the Pi emulation

Post by Bill B »

Thanks for the feedback.

I will still try and run my own tests over the weekend: I2C, Kernel MCP23017 driver and RPi GPIO.
Bill B
Posts: 641
Joined: 26 Jan 2014 16:31

Re: Real Input and Output on the Pi emulation

Post by Bill B »

My GPIO test setup (Apologies for poor photograph, the light was not good).
GPIO Test Setup
GPIO Test Setup
DSC_0000098.jpg (181.22 KiB) Viewed 39521 times
And my test program:

Code: Select all

10 LET PL=0
20 LET P=INP(7)
30 IF P=PL THEN GOTO 20
40 OUT 7, P
50 PRINT P
60 LET PL=P
70 GOTO 20
So the switches on the input pins should control the LEDs on the output pins.

With this I can confirm that using I2C to control MCP23017 GPIOs from MEMU is working.

However using the kernel driver and /dev/gpiochip* is not working. Further investigation required :(
TimoHartong
Posts: 28
Joined: 23 Sep 2024 16:11

Re: Real Input and Output on the Pi emulation

Post by TimoHartong »

Hi Bill,

It is very interesting to see that it works with two languages : Assembly and BASIC. I hope you also het the GPIO working just in case.
Bill B
Posts: 641
Joined: 26 Jan 2014 16:31

Re: Real Input and Output on the Pi emulation

Post by Bill B »

The issue with the GPIO interface has now been resolved and updated version pushed to GitHub.
TimoHartong
Posts: 28
Joined: 23 Sep 2024 16:11

Re: Real Input and Output on the Pi emulation

Post by TimoHartong »

Sorry for the delay but I had to visit the dentists :mrgreen: . Ran a partial test with the 65536 test program which is in my opinion OK. To test the GPIO I must build an extra print...
TimoHartong
Posts: 28
Joined: 23 Sep 2024 16:11

Re: Real Input and Output on the Pi emulation

Post by TimoHartong »

Bill B wrote: 16 Dec 2024 15:52 The issue with the GPIO interface has now been resolved and updated version pushed to GitHub.

Finally I have build de extra print to test the GPIO option and I'm happy to report that the GPIO and I2C are both working.
Post Reply