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

ESP32 Port #66

Closed
MockbaTheBorg opened this Issue Oct 2, 2018 · 22 comments

Comments

Projects
None yet
2 participants
@MockbaTheBorg
Owner

MockbaTheBorg commented Oct 2, 2018

My ESP32 boards will be arriving in a few days.
Let's see if this is going to work right out of the box, or if it will require a lot of coding to happen.
Or even if it will not be at all possible.
Stay tuned.

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 3, 2018

The file operations routines won't work without changes.
Or my installed Arduino ESP32 stuff isn't configured correctly.

I'm waiting for the next ESP32 boards (I've ordered more than one on the same day) because I cannot use the 1st one that arrived until the dispute with the seller has been solved: $THEY sent me a different (and cheaper) type of board than advertised. So far I opened the package only for taking photos.

drawkula commented Oct 3, 2018

The file operations routines won't work without changes.
Or my installed Arduino ESP32 stuff isn't configured correctly.

I'm waiting for the next ESP32 boards (I've ordered more than one on the same day) because I cannot use the 1st one that arrived until the dispute with the seller has been solved: $THEY sent me a different (and cheaper) type of board than advertised. So far I opened the package only for taking photos.

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 8, 2018

Owner

YAY!
putty_2018-10-07_21-21-27

The cool part is: Version 3.2 coincides with (preliminary) ESP32 support ... :)

Owner

MockbaTheBorg commented Oct 8, 2018

YAY!
putty_2018-10-07_21-21-27

The cool part is: Version 3.2 coincides with (preliminary) ESP32 support ... :)

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 8, 2018

Owner

Now off to extensive testing ... the thing seems to not have (at least with no code changes) support to analogWrite.
Also, it runs at 80MHz, a bit slow, but I saw somewhere it can be heavily overclocked, though I have no idea how to do it yet.
Fun times lie ahead.

Owner

MockbaTheBorg commented Oct 8, 2018

Now off to extensive testing ... the thing seems to not have (at least with no code changes) support to analogWrite.
Also, it runs at 80MHz, a bit slow, but I saw somewhere it can be heavily overclocked, though I have no idea how to do it yet.
Fun times lie ahead.

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 8, 2018

AnalogWrite still is broken in this Arduino core.

https://github.com/espressif/arduino-esp32#development-status mentiones:

Most of the framework is implemented. Most noticable is the missing analogWrite.

And PSRAM is said to be slower than the internal RAM. Can it be disabled?

Where did you hide mySD.h?

Also, it runs at 80MHz, a bit slow, but I saw somewhere it can be heavily overclocked, though I have no idea how to do it yet.

It should be faster: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf#14

How do I run at 160 or 240MHz? #487

drawkula commented Oct 8, 2018

AnalogWrite still is broken in this Arduino core.

https://github.com/espressif/arduino-esp32#development-status mentiones:

Most of the framework is implemented. Most noticable is the missing analogWrite.

And PSRAM is said to be slower than the internal RAM. Can it be disabled?

Where did you hide mySD.h?

Also, it runs at 80MHz, a bit slow, but I saw somewhere it can be heavily overclocked, though I have no idea how to do it yet.

It should be faster: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf#14

How do I run at 160 or 240MHz? #487

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 8, 2018

Owner

mySD went inside Documents/Arduino/mySD folder

Looks like it is always running at 240MHz? I have a feeling that it runs slower than the Teensy.
Gotta run more tests.
The DUE, poor DUE, got left behind.

The PSRAM can be disabled on the board configuration of the Arduino GUI.

Owner

MockbaTheBorg commented Oct 8, 2018

mySD went inside Documents/Arduino/mySD folder

Looks like it is always running at 240MHz? I have a feeling that it runs slower than the Teensy.
Gotta run more tests.
The DUE, poor DUE, got left behind.

The PSRAM can be disabled on the board configuration of the Arduino GUI.

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 8, 2018

Owner

Now ... I think we should implement BDOS calls to make use of the other functionalities of the ESP32, like BlueTooth, WiFi and Real Time Clock.

Owner

MockbaTheBorg commented Oct 8, 2018

Now ... I think we should implement BDOS calls to make use of the other functionalities of the ESP32, like BlueTooth, WiFi and Real Time Clock.

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 8, 2018

I've no idea where mySD.h hides. This line should find it indepently of upper/lower-case usage. No output, no file... :-(

(yeti@kumari:25)/home/wrk/runcpm/src/RunCPM$ find . -iname mysd.h
The good news: I got a refund for the wrongly delivered variant of the ESP32 board and don't need to send it back. Maybe I'll find time to test it tomorrow. If I get `mySD.h` from somewhere... :-)

Found mySD.h!
I expected it to be part of the it repo...


Some update must have screwed up my $HOME/.arduino15/preferences.txt. I suddenly had a $HOME/Arduino folder additionally to my $HOME/wrk/arduino/sketchbook. Not expecting this, it took a while to notice $HOME/Arduino and to fix $HOME/.arduino15/preferences.txt. Now RunCPM.ino finds the SD card library and compiles. Looking for a SD card breakout and test run will need to wait until tomorrow.

drawkula commented Oct 8, 2018

I've no idea where mySD.h hides. This line should find it indepently of upper/lower-case usage. No output, no file... :-(

(yeti@kumari:25)/home/wrk/runcpm/src/RunCPM$ find . -iname mysd.h
The good news: I got a refund for the wrongly delivered variant of the ESP32 board and don't need to send it back. Maybe I'll find time to test it tomorrow. If I get `mySD.h` from somewhere... :-)

Found mySD.h!
I expected it to be part of the it repo...


Some update must have screwed up my $HOME/.arduino15/preferences.txt. I suddenly had a $HOME/Arduino folder additionally to my $HOME/wrk/arduino/sketchbook. Not expecting this, it took a while to notice $HOME/Arduino and to fix $HOME/.arduino15/preferences.txt. Now RunCPM.ino finds the SD card library and compiles. Looking for a SD card breakout and test run will need to wait until tomorrow.

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 8, 2018

Owner

Cool ... keep me posted.
I have added some website references to RunCPM's readme.

Owner

MockbaTheBorg commented Oct 8, 2018

Cool ... keep me posted.
I have added some website references to RunCPM's readme.

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 9, 2018

The Board is labeled ESP32 DEVKITV1.
There is no vendor name like NodeMCU, DOIT, Lolin or such.

grafik

It has the 2 rows with 15 pins pinout and uses an ESP-WROOM-32 (so no PSRAM).

grafik

Unluckily it only leaves 1 row of holes on a breadboard so I wired a fullsize SD card socket directly to it using F/F jumper wires.

grafik

It is only a socket, no resistors or other stuff is included.

grafik

I'll rethink that when the next types of boards arrive.

The first in action snapshot using a "Hackaday amber" XTerm:

grafik

drawkula commented Oct 9, 2018

The Board is labeled ESP32 DEVKITV1.
There is no vendor name like NodeMCU, DOIT, Lolin or such.

grafik

It has the 2 rows with 15 pins pinout and uses an ESP-WROOM-32 (so no PSRAM).

grafik

Unluckily it only leaves 1 row of holes on a breadboard so I wired a fullsize SD card socket directly to it using F/F jumper wires.

grafik

It is only a socket, no resistors or other stuff is included.

grafik

I'll rethink that when the next types of boards arrive.

The first in action snapshot using a "Hackaday amber" XTerm:

grafik

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 9, 2018

Owner

I am starting to think about a new BDOS call (243 I think) for supporting the ESP32.
We would build a record on 0x80 with more information about what the calls does, it can be wifi, BT, RTC, then call BDOS 243 to make it happen. So it would be a single BDOS entry for ESP32 support.

Owner

MockbaTheBorg commented Oct 9, 2018

I am starting to think about a new BDOS call (243 I think) for supporting the ESP32.
We would build a record on 0x80 with more information about what the calls does, it can be wifi, BT, RTC, then call BDOS 243 to make it happen. So it would be a single BDOS entry for ESP32 support.

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 9, 2018

For some stuff, the buffer at 0x80 will not be large enough (e.g. when doing something with longer URLs) but then a pointer to a string could be dropped there instead of the whole URL.
A way to get software directly from the net would be like magic... \o/
Being able to save/backup stuff via WLAN would be nice too!


But now for somethig completely different:

Are you planning to mention RunCPM/ESP32 in /r/ESP32, /r/CPM, Hackaday, ...

New users may have new ideas too... :-D

drawkula commented Oct 9, 2018

For some stuff, the buffer at 0x80 will not be large enough (e.g. when doing something with longer URLs) but then a pointer to a string could be dropped there instead of the whole URL.
A way to get software directly from the net would be like magic... \o/
Being able to save/backup stuff via WLAN would be nice too!


But now for somethig completely different:

Are you planning to mention RunCPM/ESP32 in /r/ESP32, /r/CPM, Hackaday, ...

New users may have new ideas too... :-D

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 9, 2018

Owner

My idea is that the 0x80 buffer would be only for passing one byte with the "sub-call" ID and multiple pointers to the data to be sent/received. Then a C program could allocate whatever memory and go from there.
And yes, definitely a "DOWNLOAD.COM", which we could call to download files from the network.
The possibilities are infinite (which is a number around 65536).

Owner

MockbaTheBorg commented Oct 9, 2018

My idea is that the 0x80 buffer would be only for passing one byte with the "sub-call" ID and multiple pointers to the data to be sent/received. Then a C program could allocate whatever memory and go from there.
And yes, definitely a "DOWNLOAD.COM", which we could call to download files from the network.
The possibilities are infinite (which is a number around 65536).

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 9, 2018

Owner

Now, regarding social network ... lol ... I suck at these ... I avoid going to forums and suck to promote the software because I would then have no time to follow up.
RunCPM in on hackaday, I go there maybe every 6 months only. 😄

Owner

MockbaTheBorg commented Oct 9, 2018

Now, regarding social network ... lol ... I suck at these ... I avoid going to forums and suck to promote the software because I would then have no time to follow up.
RunCPM in on hackaday, I go there maybe every 6 months only. 😄

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 10, 2018

My idea is that the 0x80 buffer would be only for passing one byte with the "sub-call" ID and multiple pointers to the data to be sent/received.

Ok.

The possibilities are infinite (which is a number around 65536).

:-)

drawkula commented Oct 10, 2018

My idea is that the 0x80 buffer would be only for passing one byte with the "sub-call" ID and multiple pointers to the data to be sent/received.

Ok.

The possibilities are infinite (which is a number around 65536).

:-)

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 11, 2018

$ git branch
* local-ccpz-64k-115200bd
  master
$ git log --max-count=1
commit d0ae20704ad23837e25f9618287cfbe11022a70f
Author: yes! :-P
Date:   Thu Oct 11 12:42:51 2018 +0000

    My local changes...
    
    * RunCPM/RunCPM.ino
      ** console speed 115200Bd
    * RunCPM/globals.h
      ** use CCPZ
      ** silence CCPHEAD mesage
      ** use 64k RAM

The following tests were run on the ESP32 DEVKITV1 board connected to screen (with SIXEL support) in an xterm on Debian9/AMD64.

So far I see no trouble with ...

  • WordStar4
  • Hi-Tech C - fixed point arithmetic Mandelbrot Set program with ASCII output
  • Hi-Tech C - fixed point arithmetic Mandelbrot Set program with SIXEL output
  • ACK C - fixed point Mandelbrot Set program cross compiled for CP/M-8080 with ack on Linux.
  • ACK C - floating point Mandelbrot Set program cross compiled for CP/M-8080 with ack on Linux.
  • Complete rebuild of [Peter Schorn]'s SPL compiler from AltairZ80's Programming Languages download page.
    The rebuild was run on the ESP32 using the binaries of a previous rebuild done on RunCPM/Posix copied over to RunCPM/ESP32's SD card.
    The freshly rebuilt SPL then is used to build a lot of SPL programs.
    So this is an epic opera of M80 and friends featuring SPL in Z80 major. 🎶

Bonus material included...

  • Deceleration!
    I'm sooo spoiled by the speed of RunCPM/Posix on my notebook...
    This puts the Ommmmmmm... back into computing... 😉

drawkula commented Oct 11, 2018

$ git branch
* local-ccpz-64k-115200bd
  master
$ git log --max-count=1
commit d0ae20704ad23837e25f9618287cfbe11022a70f
Author: yes! :-P
Date:   Thu Oct 11 12:42:51 2018 +0000

    My local changes...
    
    * RunCPM/RunCPM.ino
      ** console speed 115200Bd
    * RunCPM/globals.h
      ** use CCPZ
      ** silence CCPHEAD mesage
      ** use 64k RAM

The following tests were run on the ESP32 DEVKITV1 board connected to screen (with SIXEL support) in an xterm on Debian9/AMD64.

So far I see no trouble with ...

  • WordStar4
  • Hi-Tech C - fixed point arithmetic Mandelbrot Set program with ASCII output
  • Hi-Tech C - fixed point arithmetic Mandelbrot Set program with SIXEL output
  • ACK C - fixed point Mandelbrot Set program cross compiled for CP/M-8080 with ack on Linux.
  • ACK C - floating point Mandelbrot Set program cross compiled for CP/M-8080 with ack on Linux.
  • Complete rebuild of [Peter Schorn]'s SPL compiler from AltairZ80's Programming Languages download page.
    The rebuild was run on the ESP32 using the binaries of a previous rebuild done on RunCPM/Posix copied over to RunCPM/ESP32's SD card.
    The freshly rebuilt SPL then is used to build a lot of SPL programs.
    So this is an epic opera of M80 and friends featuring SPL in Z80 major. 🎶

Bonus material included...

  • Deceleration!
    I'm sooo spoiled by the speed of RunCPM/Posix on my notebook...
    This puts the Ommmmmmm... back into computing... 😉

drawkula referenced this issue Oct 12, 2018

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 12, 2018

Owner

Ran a few side-by-side tests here between a Teensy 3.5 (overclocked to 168MHz) and the ESP32.

1 - The serial being 115200, on the ESP32 it still seems to be much slower than on the Teensy.
2 - The disk on the Teensy looks much faster, applications load faster on the Teensy.
3 - Then on running ZEXALL, the ESP32 goes faster.

So I am concluding:
The Teensy is good for disk intense apps with many user interactions and screen changing.
The ESP32 is good for processing horsepower.

At least this is what it looks like so far.

Owner

MockbaTheBorg commented Oct 12, 2018

Ran a few side-by-side tests here between a Teensy 3.5 (overclocked to 168MHz) and the ESP32.

1 - The serial being 115200, on the ESP32 it still seems to be much slower than on the Teensy.
2 - The disk on the Teensy looks much faster, applications load faster on the Teensy.
3 - Then on running ZEXALL, the ESP32 goes faster.

So I am concluding:
The Teensy is good for disk intense apps with many user interactions and screen changing.
The ESP32 is good for processing horsepower.

At least this is what it looks like so far.

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 14, 2018

I'm still waiting for more ESP32 boards to arrive. When playing with them and looking at the SD card speeds (of e.g. MicroPython, uLisp, ...) maybe it turns out, that all of them are slower than expected. If not, a closer look at the differences may help.

drawkula commented Oct 14, 2018

I'm still waiting for more ESP32 boards to arrive. When playing with them and looking at the SD card speeds (of e.g. MicroPython, uLisp, ...) maybe it turns out, that all of them are slower than expected. If not, a closer look at the differences may help.

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 15, 2018

My fullsize SD breakout is nice because it has both sets of names of the SD card's signals. The microSD breakout I'm using now only has the SDIO names, so a table like this may be helpful in the documentation or source not only for me... ;-)

SPI     ESP32   SDIO
------------------------
cs      13      dat3
mosi    15      cmd
miso    2       dat0
sck     14      clk

Yes! I definitely did test this wiring:

CP/M 2.2 Emulator v3.2 by Marcelo Dantas
Arduino read/write support by Krzysztof Klis
      Build Oct 12 2018 - 15:18:16
--------------------------------------------
CCP: CCP-CCPZ.64K  CCP Address: 0xf400

A>█

Snapshots as reminder how to rewire without much thinking:

20181015_001h bb1024 q80
20181015_002h bb1024 q80
20181015_003h bb1024 q80
20181015_005h bb1024 q80

drawkula commented Oct 15, 2018

My fullsize SD breakout is nice because it has both sets of names of the SD card's signals. The microSD breakout I'm using now only has the SDIO names, so a table like this may be helpful in the documentation or source not only for me... ;-)

SPI     ESP32   SDIO
------------------------
cs      13      dat3
mosi    15      cmd
miso    2       dat0
sck     14      clk

Yes! I definitely did test this wiring:

CP/M 2.2 Emulator v3.2 by Marcelo Dantas
Arduino read/write support by Krzysztof Klis
      Build Oct 12 2018 - 15:18:16
--------------------------------------------
CCP: CCP-CCPZ.64K  CCP Address: 0xf400

A>█

Snapshots as reminder how to rewire without much thinking:

20181015_001h bb1024 q80
20181015_002h bb1024 q80
20181015_003h bb1024 q80
20181015_005h bb1024 q80

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 18, 2018

My two WROVER-ESP32 boards arrived yesterday. So far I only found enough time to flash them with MicroPython (with PSRAM support) to have a quick test run for a few keystrokes.

So the 1st board ordered (WROOM32 on 2x19 pin board which turned out to be delivered as 2x15 pin variant) and the last 2 boards ordered (the 2 WROVER32 boards) arrived. The other 2x19 pin boards ordered between them still are missing. :-(

I think I like the ESP32ers, especially they have what is missing on ESP8266: More than one UART! Even if it turns out not to be a good board for RunCPM, I sure will have some other tasks for them.

The ESP32 IDF is able to drive the SD card in 4 bit mode. The speed problem should be fixable if we find out how to do this using the Arduino-ESP32 core (or find an existing "arduinoified" SDIO library?). Diving into directly using the IDF is a longer way. Maybe someone out there has enough Methylphenidate to get this done... :-)

drawkula commented Oct 18, 2018

My two WROVER-ESP32 boards arrived yesterday. So far I only found enough time to flash them with MicroPython (with PSRAM support) to have a quick test run for a few keystrokes.

So the 1st board ordered (WROOM32 on 2x19 pin board which turned out to be delivered as 2x15 pin variant) and the last 2 boards ordered (the 2 WROVER32 boards) arrived. The other 2x19 pin boards ordered between them still are missing. :-(

I think I like the ESP32ers, especially they have what is missing on ESP8266: More than one UART! Even if it turns out not to be a good board for RunCPM, I sure will have some other tasks for them.

The ESP32 IDF is able to drive the SD card in 4 bit mode. The speed problem should be fixable if we find out how to do this using the Arduino-ESP32 core (or find an existing "arduinoified" SDIO library?). Diving into directly using the IDF is a longer way. Maybe someone out there has enough Methylphenidate to get this done... :-)

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 18, 2018

Owner

The ESP32's are definitely good for RunCPM.
Right now I think the Teensy 3.6 is better, even though the ESP32 cpu is faster.
But on the ESP32 we can implement things like the RTC and WIFI, which will move away from CP/M compatibility, but into some more useful development with all the languages CP/M have to offer.
I ended up buying 4xESP32-TTGO-T1 and 2xLolin32-pro. I will certainly find an use for each one of them.

Owner

MockbaTheBorg commented Oct 18, 2018

The ESP32's are definitely good for RunCPM.
Right now I think the Teensy 3.6 is better, even though the ESP32 cpu is faster.
But on the ESP32 we can implement things like the RTC and WIFI, which will move away from CP/M compatibility, but into some more useful development with all the languages CP/M have to offer.
I ended up buying 4xESP32-TTGO-T1 and 2xLolin32-pro. I will certainly find an use for each one of them.

@drawkula

This comment has been minimized.

Show comment
Hide comment
@drawkula

drawkula Oct 18, 2018

The SD speed really is subterran.
Rebuilding the whole SPL stuff takes hours on the ESP32 and that seems to be caused mainly by the slow loading of the binaries.
Probably even the serial floppy drive of the C128 was faster with CP/M.
I think after a while of playing with other stuff on the ESP32 ideas to get faster loading times will show up.
Maybe even the bottleneck still is in the Arduino core and we'll see improvements with future updates.

I didn't find time today to look closer at MicroPython. Testing MicroPython's SD card speed will be one of the things to be done really soon.

drawkula commented Oct 18, 2018

The SD speed really is subterran.
Rebuilding the whole SPL stuff takes hours on the ESP32 and that seems to be caused mainly by the slow loading of the binaries.
Probably even the serial floppy drive of the C128 was faster with CP/M.
I think after a while of playing with other stuff on the ESP32 ideas to get faster loading times will show up.
Maybe even the bottleneck still is in the Arduino core and we'll see improvements with future updates.

I didn't find time today to look closer at MicroPython. Testing MicroPython's SD card speed will be one of the things to be done really soon.

@MockbaTheBorg

This comment has been minimized.

Show comment
Hide comment
@MockbaTheBorg

MockbaTheBorg Oct 20, 2018

Owner

Yup ... this is my feeling. They may have a bad SD library.
The serial is also slow it seems.
I have no time to test anything else for at least two more weeks (working in Chicago).

Owner

MockbaTheBorg commented Oct 20, 2018

Yup ... this is my feeling. They may have a bad SD library.
The serial is also slow it seems.
I have no time to test anything else for at least two more weeks (working in Chicago).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment