Page 3 of 3

Re: Real Input and Output on the Pi emulation

Posted: 12 Dec 2024 18:02
by TimoHartong
Can I propose I get the code and test it ?.

Re: Real Input and Output on the Pi emulation

Posted: 12 Dec 2024 19:33
by Bill B
Go ahead. All feedback welcome.

Re: Real Input and Output on the Pi emulation

Posted: 12 Dec 2024 22:00
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.

Re: Real Input and Output on the Pi emulation

Posted: 13 Dec 2024 17:36
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.

Re: Real Input and Output on the Pi emulation

Posted: 13 Dec 2024 17:55
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.

Re: Real Input and Output on the Pi emulation

Posted: 15 Dec 2024 17:23
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 39513 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 :(

Re: Real Input and Output on the Pi emulation

Posted: 16 Dec 2024 14:08
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.

Re: Real Input and Output on the Pi emulation

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

Re: Real Input and Output on the Pi emulation

Posted: 18 Dec 2024 18:44
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...

Re: Real Input and Output on the Pi emulation

Posted: 14 Mar 2025 23:17
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.