Mirror of CollapseOS
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

42 Zeilen
1.4KB

  1. # Building a SPI relay for the SMS
  2. The I/O space on the SMS is, sadly, entirely taken. If you had
  3. the idea of somehow plugging a SPI relay that is similar the one
  4. on the RC2014, you can forget about it. Only A7, A6 and A0 are
  5. considered by the 8 builtin peripherals on the SMS and trying to
  6. do an IN or OUT to any address is going to end up conflicting
  7. with one of them.
  8. What we can do to achieve SPI communication with the SMS is to
  9. use the B controller port. It can already do bit banging. It's
  10. slow, but it works.
  11. One problem we have, however, is that only 2 pins can be set as
  12. output. We need 3. What I did, and it works with SD cards, is
  13. to hard-wire CS to GND so that it's always turned on. The
  14. downside of this is that if you go out-of-sync with the SPI
  15. device, you have to physically disconnect it and reconnect it
  16. to solve the sync problem.
  17. The advantage of using port B is that the connector is really
  18. simple, you don't even need a schematic:
  19. * CLK to TH
  20. * DI to TR
  21. * DO to Up
  22. * CS to GND
  23. Add pull-downs to CLK and DI to avoid messing up with your
  24. device (it's always on, remember).
  25. # Building the binary
  26. The SPI driver is in B622, which depends on controller port
  27. routines at B625-B626. A ready-to-use xcomp unit is at
  28. arch/z80/sms/xcompsdc.fs.
  29. The SMS emulator has support for a SPI relay based on the B
  30. controller port and can emulate a SD card plugged in it with the
  31. "-c" argument. If it works in the emulator, it has good chances
  32. of running on the real thing.