Raspberry Pi Pico 6502 emulator

Topics pertaining to the emulation or simulation of the 65xx microprocessors and their peripheral chips.
kuwatay
Posts: 4
Joined: 06 Aug 2021
Location: Muroran-shi, Hokkaido, JAPAN
Contact:

Re: Raspberry Pi Pico 6502 emulator

Post by kuwatay »

Hi,

I'm trying noneya's VIA emulator in PICO-6502. Here's knight-rider code in a1basic.
Note I moved the base address of 6522 to $B000.

Code: Select all

   10 POKE -20478,255
   20 K = 1
   30 FOR I=0 TO 7
   40   POKE -20479,K
   45   GOSUB 500
   50   K=K*2
   60 NEXT I
   70 K=128
   80 FOR I=0 TO 7
   90    POKE -20479,K
   95    GOSUB 500
  100    K = K / 2
  110 NEXT I
  120 GOTO 20
  500 FOR J=1 TO 10
  510 NEXT J
  520 RETURN
スクリーンショット 2023-10-24 20.38.52.png
noneya
Posts: 39
Joined: 12 Feb 2021
Contact:

Re: Raspberry Pi Pico 6502 emulator

Post by noneya »

kuwatay wrote:
Hi,

I'm trying noneya's VIA emulator in PICO-6502. Here's knight-rider code in a1basic.
Note I moved the base address of 6522 to $B000.

Code: Select all

   10 POKE -20478,255
   20 K = 1
   30 FOR I=0 TO 7
   40   POKE -20479,K
   45   GOSUB 500
   50   K=K*2
   60 NEXT I
   70 K=128
   80 FOR I=0 TO 7
   90    POKE -20479,K
   95    GOSUB 500
  100    K = K / 2
  110 NEXT I
  120 GOTO 20
  500 FOR J=1 TO 10
  510 NEXT J
  520 RETURN
スクリーンショット 2023-10-24 20.38.52.png

Nice kuwatay!
Shaking out the dirty bits!

https://github.com/DonaldMoran
noneya
Posts: 39
Joined: 12 Feb 2021
Contact:

Re: Raspberry Pi Pico 6502 emulator

Post by noneya »

Hi all,

Just a small follow‑up to this thread. Working with the VIA emulation here (and all the experiments with LCDs, SD cards, SPI, etc.) eventually pushed me into building something much larger. I ended up taking everything I learned from the emulator and wiring tests and built a full smart‑peripheral system around a *real* 6522.

It’s now a two‑Pico setup: one Pico emulates a 65C02 system, and the second Pico acts as a modern “smart peripheral” connected over a real VIA‑style parallel interface. The 6502‑side code is written in ca65, and the bridge uses the 6522’s automatic handshake mode (the repo is built around that), though I’ve tested manual handshake mode offline and it works fine too.

On top of that I now have NETDOS, Microsoft BASIC 2.0 integration (LOAD/SAVE/CD/DEL), a clean command interface, and full wiring diagrams.

Rather than derail this emulator thread, I posted the full write‑up in the Hardware section:

**Pico‑6522 Bridge: Real 6522 Smart Peripheral (Auto Handshake)**
viewtopic.php?f=4&t=8552

My GitHub repo (with all the code, examples, and binaries) is here:
https://github.com/DonaldMoran/pico-6522-bridge

Huge thanks again to jfoucher — your emulator was the starting point for all of this. Anyone experimenting with the Pico‑6502 emulator may find the new project interesting as well.

— Don (noneya)
Shaking out the dirty bits!

https://github.com/DonaldMoran
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Raspberry Pi Pico 6502 emulator

Post by BigEd »

Thanks for making the new thread, and linking it here. That's a good way to keep things organised.
noneya
Posts: 39
Joined: 12 Feb 2021
Contact:

Re: Raspberry Pi Pico 6502 emulator

Post by noneya »

Hi all,

Following up on my February post about the two-Pico system with the real 6522 bridge—I've continued pushing this project forward and just released v0.96 of what I'm now calling the W25Q64_INTERLOCK project.

GitHub: https://github.com/DonaldMoran/W25Q64_INTERLOCK
Pre-release details: https://github.com/DonaldMoran/W25Q64_I ... /tag/v0.96

This release represents a major milestone. What started as a VIA emulation experiment has grown into a complete retro‑computing environment:

You'll want python 3 and CA65.

Key additions:
  • FIG‑Forth 1.1 with a virtualized disk system mapping classic 1K Forth "screens" to individual files in /FORTH/. This release includes the FIG‑Forth editor from the FIG Installation Manual (screens 87‑97), packaged and ready to install.
  • Local storage using the onboard W25Q64 flash chip, providing persistent file storage for the entire system
  • MSBASIC 2.0 (Commodore BASIC) with SAVE/LOAD
  • Krusader resident assembler with file‑based source management (S [save source] and F [fetch source], i.e. S ASSEM/ABC.S and F ASSEM/ABC.S)
  • WRITE – a full‑screen, nano‑like text editor I authored for the system, featuring cursor movement and line numbering, etc.
  • CALC – a programmer's calculator I also authored, supporting hex, decimal, and binary operations as well as Address Range Calculation
  • DOTS (.S) stack display utility for Forth
  • DDOS shell with file management (LS, CP, MV, RM, CATALOG, etc...) and networking (GET, PUT, PING, RLIST [remote list], etc...)
  • NEWS/WEATHER info streaming over HTTP
The architecture is now a two‑Pico system:
  1. Host Pico – runs the 6502 emulator (optional—can also use a real 65C02)
  2. Bridge Pico W – acts as a smart peripheral over a real 6522 VIA with automatic handshake, featuring the W25Q64 flash chip for local storage
The Bridge Pico W handles networking, file storage (on the W25Q64), and all the heavy lifting while presenting a clean interface to the 6502 side. Transient commands are fetched over HTTP from a local file server, making the system highly modular and easy to extend.

Here's the wiring diagram showing the connections between the Host Pico, Bridge Pico W, and W25Q64 flash:

Code: Select all

       HOST PICO (Emulator)                     BRIDGE PICO (Pico W)
    +-----------------------+                 +-----------------------+
    |                       |                 |                       |
    | GP0  (PA0) <--------->| [DATA BUS] <--->| GP6  (PA0)            |
    | GP1  (PA1) <--------->| [DATA BUS] <--->| GP7  (PA1)            |
    | GP2  (PA2) <--------->| [DATA BUS] <--->| GP8  (PA2)            |
    | GP3  (PA3) <--------->| [DATA BUS] <--->| GP9  (PA3)            |
    | GP4  (PA4) <--------->| [DATA BUS] <--->| GP10 (PA4)            |
    | GP5  (PA5) <--------->| [DATA BUS] <--->| GP11 (PA5)            |
    | GP6  (PA6) <--------->| [DATA BUS] <--->| GP12 (PA6)            |
    | GP7  (PA7) <--------->| [DATA BUS] <--->| GP13 (PA7)            |
    |                       |                 |                       |
    | GP11 (CA2) ---------->| [REQUEST]  ---->| GP14 (Input)          |
    | GP10 (CA1) <----------| [ACK]      <----| GP15 (Output)         |
    |                       |                 |                       |
    | GND  -----------------| [COMMON GND] ---|--- GND                |
    |                       |                 |                       |
    +-----------------------+                 +-----------+-----------+
                                              |   BRIDGE PICO (W)     |
                                              |                       |
                                              |  GP19 --------------->| DI (MOSI)
                                              |  GP18 --------------->| CLK
                                              |  GND  --------------->| GND
                                              |  GP17 --------------->| CS
                                              |  GP16 --------------->| DO (MISO)
                                              |                       |
                                              +-----------+-----------+
                                                          |
                                                          |
                                                          v
                                                +---------------------+
                                                |     W25Q64 FLASH    |
                                                | (left→right labels) |
                                                |                     |
                                                |   DI(MOSI) <------->| GP19
                                                |   CLK      <------->| GP18
                                                |   GND      <------->| GND
                                                |   DO(MISO) <------->| GP16
                                                |   CS       <------->| GP17
                                                |   VCC      <------->| 3V3
                                                |                     |
                                                +---------------------+
Getting started is documented in the release notes at https://github.com/DonaldMoran/W25Q64_I ... /tag/v0.96 —flash both UF2 files, run the Python file server, and stage the networking command SETSERVER via WozMon, as well as the GET command. Once that's done, you can use that "transient" command GET to get the rest of the transient command suite and the FIG‑Forth screens. The included figinst_editor.zip contains the classic fig-FORTH 1.1 Installation Manual editor screens (87‑97) for a complete Forth development environment.

The project is still in pre‑release, and I'd love feedback from anyone willing to test it out. Open issues on GitHub if you run into anything or have suggestions.

This thread and jfoucher's original emulator were the foundation that made all of this possible—thanks again!

— Don (noneya)
Shaking out the dirty bits!

https://github.com/DonaldMoran
Post Reply