Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CP/M on the ESP32

1,259 views
Skip to first unread message

marcelo....@gmail.com

unread,
Oct 11, 2018, 12:27:44 AM10/11/18
to
Hi All,

Greetings from 8bitLand.
Just stopping by to say that I have ported RunCPM to the ESP32 boards.
The ESP32's are kind of an Arduino on steroids, with WiFi, RTC and BlueTooth.
So, if anyone is interested, just stop by https://github.com/MockbaTheBorg/RunCPM and check it out.

Cheers!

Richard Deane

unread,
Oct 11, 2018, 3:12:55 AM10/11/18
to
Great, will do as I have an esp32 waiting, bought to put z80pack 1.37 on when released.I use runcpm on teensy 3.6 with occasional forays with runcpm into Linux, Mac and Windows.
Richard

jim3...@gmail.com

unread,
Oct 15, 2018, 7:50:26 AM10/15/18
to
On something like the Arduino or the ESP32, is it possible to have the console connection be a "real" serial port instead of the USB connection to a PC running a terminal emulator?

I know I'd need an external adapter to connect to RS-232 (from TTL), but would love to have something powerful and small to connect to a vintage dumb terminal.

thanks,
Jim

marcelo....@gmail.com

unread,
Oct 15, 2018, 8:43:48 AM10/15/18
to
Hi Jim,

I believe so. I have never tried it, but I believe those boards have other UARTs mapped to different pins, so in theory it can be done.
Just a matter of connecting a TTL<->RS232 level adapter and changing RunCPM.ino sketch to use that serial port instead.
No other change to RunCPM would be required.

Cheers,
Marcelo.

mmm

unread,
Oct 15, 2018, 9:28:37 AM10/15/18
to
AFAIK even the UART0 on module with USB-to-UART chip can be connected to
external transceiver ( MAX3232 or similar, the 3.3V version not the
regular 5V version ) because the USB-to-UART chip is isolated with
series resistor ( tipically 1kOhm, double check this on schematics ! )

so you can use the stock .ino

> Cheers,
> Marcelo.
>

jim3...@gmail.com

unread,
Oct 15, 2018, 12:55:24 PM10/15/18
to
I'm looking at info on the Due and found this from the Arduino website:

The Arduino DUE has three additional 3.3V TTL serial ports: Serial1 on pins 19 (RX) and 18 (TX); Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX). Pins 0 and 1 are also connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip, which is connected to the USB debug port. Additionally, there is a native USB-serial port on the SAM3X chip, SerialUSB'.

I also came across this:

SerialUSB is the communication function used with the native USB port, Serial with UART (RX/TX) and Serialn(RXn/TXn) with the corresponding USARTp (Serial1 for USART0, Serial2 for USART1, Serial3 for USART3 and Serial4 for USART2 with a few more lines of code for this last one).

So if I wanted to use Serial1, I could modify the sketch with:

void setup(void) {
pinMode(LED, OUTPUT);
digitalWrite(LED, LOW);
Serial.begin1(SERIALSPD);
while (!Serial) { // Wait until serial is connected
digitalWrite(LED, HIGH^LEDinv);
delay(sDELAY);
digitalWrite(LED, LOW^LEDinv);
delay(sDELAY);
}

But am I also going to have to modify the parts of the code to specifically point to Serial1? It looks like things like

Serial.println();

will need to be changed to something like:

Serial1.println();

It doesn't look too overwhelming, but it looks like it involves more than just the command to open the serial port. Or if I only open a single serial port, are things smart enough to figure out to use that port by default?

Thanks,
Jim

marcelo....@gmail.com

unread,
Oct 15, 2018, 3:10:27 PM10/15/18
to
I have tried to write it as modular as possible ... but maybe we could change the serial name onto a define, like:

#define SerialPort Serial

And use SerialPort throughout the code.
Then, to change into Serial1, one would only need to change the define.

Cheers,
Marcelo.

jim3...@gmail.com

unread,
Oct 16, 2018, 5:00:09 PM10/16/18
to
My only Arduino Due is in the guts of my Altair 8800 emulator right now, but I'll get another one on order. I'm thinking I can do a raw "search & replace" manually for now and let you know how that goes. If it turns out to be fairly straight forward then you can decide if it makes sense to put it in the main code stream.

Thanks for the insight on how to even get started--I know enough to be dangerous now!

Thanks again,
Jim

marcelo....@gmail.com

unread,
Oct 17, 2018, 4:46:18 AM10/17/18
to
Hi Jim,

If you are considering to buy a different device, then I would suggest you the Teensy 3.5.
It is about the same price, much faster and also supported by RunCPM.
Just an idea.

Cheers,
Marcelo.

jim3...@gmail.com

unread,
Oct 17, 2018, 8:58:32 AM10/17/18
to
I've never used the Teensy, but this would give me a reason to try it. I was looking for information on the Teensy serial interface and found this:

https://www.pjrc.com/teensy/td_uart.html

Actually they do something similar to what you suggested with the define in the example code:

// set this to the hardware serial port you wish to use
#define HWSERIAL Serial1

void setup() {
Serial.begin(9600);
HWSERIAL.begin(9600);
}

void loop() {
int incomingByte;

if (Serial.available() > 0) {
incomingByte = Serial.read();
Serial.print("USB received: ");
Serial.println(incomingByte, DEC);
HWSERIAL.print("USB received:");
HWSERIAL.println(incomingByte, DEC);
}
if (HWSERIAL.available() > 0) {
incomingByte = HWSERIAL.read();
Serial.print("UART received: ");
Serial.println(incomingByte, DEC);
HWSERIAL.print("UART received:");
HWSERIAL.println(incomingByte, DEC);
}
}

I'll order one in the next week or so and give it a try...

Thanks again,
Jim W4JBM

marcelo....@gmail.com

unread,
Oct 18, 2018, 6:49:13 PM10/18/18
to
Awesome! I hope you have fun!
0 new messages