Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add support for Adafruit Feather RP2040 Adalogger (instructions in description) #4

Open
adamenkov opened this issue Nov 7, 2024 · 4 comments

Comments

@adamenkov
Copy link

adamenkov commented Nov 7, 2024

5980-00

Adafruit Feather RP2040 Adalogger is a small board from Adafruit with RP2040 and microSD holder on it (https://www.adafruit.com/product/5980). I did have fun assembling a CP/M machine according to the README.md file, but the Adalogger is smaller and no jumper wires are involved. A genuine pocket CP/M computer for any pocket size, like eZ-Tiny, but with easy access to microSD files on any OS of your choice.

Instructions:

  1. Clone this repository.
  2. Pick the latest version, e.g. v6_7.
  3. Unzip the Pico archive, not Pico W, e.g. GL20241103_Binary_Source_RunCPM_v6_7_Pico2_275Mhz.zip.
  4. In the newly created directory, find the RunCPM sketch, e.g. RunCPM_v6_7_Pico2_275Mhz_03112024.ino.
  5. Open the sketch in the Arduino IDE.
  6. Make sure the board is recognized as "Adafruit Feather RP2040 Adalogger".
  7. Upload the sketch. If it keeps uploading or looking for RP2040 devices (in the Output log), press Boot+Reset on the board to help.
  8. Set the Serial Monitor baud rate at 115200. Press Reset on the board if necessary.
  9. Make sure you see the CP/M Emulator greeting.
  10. Note that the last line is "CPU-Clock", nothing about SD. It's time to fix it.
  11. First, the SD used in the Adalogger is through SPI1, not SPI. Second, a couple of pins (MISO and SS/CS) are different.
  12. Hence the fix: Replace this snippet:
SPI.setRX(16);   // MISO
SPI.setCS(17);   // Card Select
SPI.setSCK(18);  // Clock
SPI.setTX(19);   // MOSI

with this one (see https://learn.adafruit.com/adafruit-feather-rp2040-adalogger/pinouts#microsd-card-slot-3174751 about why):

  SPI1.setRX(20);   // MISO
  SPI1.setCS(23);   // Card Select
  SPI1.setSCK(18);  // Clock
  SPI1.setTX(19);   // MOSI
  1. About a dozen lines below, replace #define SS 17 with #define SS 23.
  2. Replace this line
#define SD_CONFIG SdSpiConfig(SS, DEDICATED_SPI, SD_SCK_MHZ(SDMHZ), &SPI) // self-selecting the Mhz

with this one (or just replace &SPI with &SPI1)

#define SD_CONFIG SdSpiConfig(SS, DEDICATED_SPI, SD_SCK_MHZ(SDMHZ), &SPI1) // self-selecting the Mhz
  1. Add these lines
#undef LED
#define LED 13

after

// Raspberry Pi Pico(2) - normal (LED = GPIO25)
#include "hardware/pico/pico_sd_spi.h"
  1. Copy the contents of the SDCARD directory to your microSD.
  2. Insert the microSD into the Adalogger, press Reset, enjoy. Use TeraTerm or something to enjoy even more.

(Optional, strictly a matter of preference.) Here are the steps for a more realistic Z80 experience:

  1. In globals.h, comment out #define CCP_DR and uncomment #define CCP_Z80.
  2. Copy CCP-Z80.64K to the microSD.

Not sure how to make CCP-Z80.60K work at the moment. Just replacing #define TPASIZE 64 with #define TPASIZE 60 and copying CCP-Z80.60K to the microSD doesn't work.

@adamenkov
Copy link
Author

Made an article about it at https://www.hackster.io/a7v/tiny-runcpm-cp-m-computer-based-on-adafruit-rp2040-adalogger-faa9da

@guidol70
Copy link
Owner

guidol70 commented Nov 8, 2024

  1. In globals.h, comment out #define CCP_DR and uncomment #define CCP_Z80.
  2. Copy CCP-Z80.64K to the microSD.

Not sure how to make CCP-Z80.60K work at the moment. Just replacing #define TPASIZE 64 with #define TPASIZE 60 and copying CCP-Z80.60K to the microSD doesn't work.

Dear Evgeny Adamenkov (adamenkov),

you have already added support for the Adafruit Feather RP2040 Adalogger ;)

I personally cant maintain a source for every Pico-Board - mostly because I havent they available to test the code and compiled binary. ( I dont know how this is doen on the RP2040-Core)
So I did create a Source for the Pico1 & Pico1W.

But you can support the board that you own with a fork on your github-page and i can set a link an my readme.md for users of your board.

Now to the "problem" with the 60K TPA:

The source you did clone from my github was set to use ABDOS.SYS
for using more BIOS-calls than BDOS-calls.
This is enabled in Line 35 of the globals.h with the command
#define ABDOS

If you want to use ABDOS.SYS with the CCP-Z80.60K then you should
copy /A/0/ABDOS.60K over /A/0/ABDOS.SYS
(see also README.TXT inside the .ZIP which you did download from Github
about 64K and 60K ABDOS.* files)

Then the with 60K TPA-Size compiled version of RunCPM should start successfully.

If you dont want to use ABDOS the commentz out line 35 of the globals.h
// #define ABDOS
and set your TPA-Size as desired.

In every case (as you already did) copy the appropriate CCP-File to the root of your SDCard like
CCP-Z80.60K

The only CCP which doenst need an CCP-File is the "Internal" CCP.

Many thanks for building and using RunCPM on the Pico :)

Kind regards
Guido Lehwalder

@adamenkov
Copy link
Author

Dear Guido Lehwalder (@guidol70),

Thanks a lot for your detailed explanations! :)

Let me do the fork.

Best regards,
Evgeny

@adamenkov
Copy link
Author

Dear Guido,

I updated the instructions based on your helpful comments. I don't want to fork your repository though, because you keep your versions zipped. Which is not a problem since people can just follow my list of instructions.

Thank you again - CP/M in a pocket is fun. :)

Best wishes,
Evgeny

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants