Skip to content

Latest commit

 

History

History
67 lines (50 loc) · 3.28 KB

0098-2023-06-19.md

File metadata and controls

67 lines (50 loc) · 3.28 KB

19 Jun 2023

Previous journal: Next journal:
0097-2023-06-18.md 0099-2023-06-20.md

Pico-DE0: What next?

  • Maybe change some of the arguments and defaults to be more convenient:
    • = command take value first (since we know this earlier) then also support an arg of * to be equiv. to ffffffff.
    • Start off in hex mode by default, with debug off?
  • Provide a timing function, i.e. a command to start a timer on pico_de0, then stop it and see what the delta is. This will allow us to work out how fast the pico_de0 can respond to USB streams.
  • Create GUI for receiving keyboard/mouse input, then interpreting it, then sending as vector updates to pico_de0 over USB?
    • This will allow proper user control over the Raybox design.
    • It could borrow code from the Raybox sim.
    • Needs to run under Windows to get proper mouse capture and deltas.
    • Can we make the Raybox design on the FPGA work like an async bus/register device? i.e. Pico-DE0 can pretend to be a CPU that writes to its registers whenever it wants, but these get buffered (also with metastability avoidance) for when the design is next ready to load them (i.e. just before ray-casting DDA loop) so that:
      • we don't need to sync with the design.
      • we can write data anytime we've got it.
      • the controller can write to a register that confirms when the data is actually ready/valid; ensures atomicity.
      • the design could send us an IRQ for when the ray-casting loop is done, for better efficiency.

Timer command:

  1. Get a timestamp both at the start of a return to READY state, and once a new command has been started.
  2. If the command just started is [ then store both timestamps.
  3. As soon as a ] command starts, store the current timestamp.
  4. Upon executing the ] command, print the time since READY and the time since the [ was first started.
  5. NOTE: The ] can be issued again later, to keep printing the delta since the last mark was started with [.

Notes

Sending data to Pico-DE0 using Python

I'm going to try using Python to send data from Windows to the Pico-DE0...

  • In Python we could do the basics of what raybox-app does with vectors from mouse/KB input.
  • pygame is probably good for basic mouse/keyboard capture.
  • pygame could also display a basic map on the host.
  • PySerial can do COM port access on Windows.

Installing Python for Windows

  1. Download Python 3.11.4 installer for Windows from here.
  2. Run it, tick option to add to PATH, and click "Install Now".
  3. Install Microsoft's Python VSCode extension.
  4. Check out this guide

Installing requirements

On Windows...

  1. cd pi_pico\pico-de0\client
  2. py -m pip install -r requirements.txt

Basic python serial client

I've started it. This proves comms works, though there's a lot more to do yet.