Welcome! Log In Create A New Profile

Advanced

ESP32 Printer Board

Posted by CthulhuLabs 
Re: ESP32 Printer Board
January 03, 2018 02:56PM
The only draw back is the EFM8UB2's SPI interface is only 4.8MHz in slave mode.
Re: ESP32 Printer Board
January 03, 2018 04:02PM
Quote
CthulhuLabs
The only draw back is the EFM8UB2's SPI interface is only 4.8MHz in slave mode.

Maybe it's temporary and higher speeds will be enabled later. Older (I think) versions EFM8UB1, support SPI slave mode up to 12MHz.
Re: ESP32 Printer Board
January 03, 2018 04:03PM
Whops, I see that now.
That considered, I think it comes down to a few things:

->The esp32 has a hardware FIFO that handles UART communications (128 Bytes).
->the esp32 has an interrupt that fires when the buffer fills to a preset number (settable between 1-128)

->The EFM8 has a 3 byte FIFO on UART1
->The EFM8 has a 1kb FIFO on USB
->the EMF8, as far as a could see from reading the datasheet, does not have an interrupt on the UARTs, but does on USB (I think)
->As for SPI on EMF8, I did not see an interrupt for slave mode, but could probably use a pin interrupt on the SS line

One benefit of the ATMEGA16u4 is that it has interrupts on SPI-receive-data, and the UART.
Without the interrupts, we have to poll the UART QUITE often...
Re: ESP32 Printer Board
January 03, 2018 04:54PM
Not sure if we are still looking at other peripherals, anyway, here's SAM D for about $1 (52pin) ATSAMD21J15B-AUT. There is arduino for SAM D and max SPI speed is 12Mhz:
Atmel's SAMD21 processor (used on the Arduino/Genuino Zero, MKR1000 and MKRZero boards).

EDIT: This is ARM Cortex M0. It has an interrupt for every peripheral.

Edited 2 time(s). Last edit at 01/03/2018 05:03PM by newbob.
Re: ESP32 Printer Board
January 03, 2018 05:14PM
If SPI will work for this I am not going to use UART. My current design is not even breaking out the UART and using the pins for Y_DIR and Z_DIR.

The USB interface on the EFM8UB2 does provide interrupts. They also have code available to make the EFM8UB2 show up as a USB COM port.

I have provided the EFM8UB2 with 3 interrupt pins on the ESP32. The ESP32 can do interrupt on change. This gives me 8 possible combinations of those pins.

000 - Booting / ERROR
001 - COM data available
010 - Stepper Diagnostic triggered
011 - X Endstop Triggered
100 - Y Endstop Triggered
101 - Z Endstop Triggered
110 -
111 -
Re: ESP32 Printer Board
January 03, 2018 05:16PM
Quote
newbob
Not sure if we are still looking at other peripherals, anyway, here's SAM D for about $1 (52pin) ATSAMD21J15B-AUT. There is arduino for SAM D and max SPI speed is 12Mhz:
Atmel's SAMD21 processor (used on the Arduino/Genuino Zero, MKR1000 and MKRZero boards).

EDIT: This is ARM Cortex M0. It has an interrupt for every peripheral.

Doesnt look like it does PWM natively.

Edited 1 time(s). Last edit at 01/03/2018 05:16PM by CthulhuLabs.
Re: ESP32 Printer Board
January 03, 2018 05:27PM
It actually does more than just PWM:

30. TC – Timer/Counter
30.1 Overview
The TC consists of a counter, a prescaler, compare/capture channels and control logic. The counter can
be set to count events, or it can be configured to count clock pulses. The counter, together with the
compare/capture channels, can be configured to timestamp input events, allowing capture of frequency
and pulse width. It can also perform waveform generation, such as frequency generation and pulse-width
modulation (PWM).
30.2 Features
• Selectable configuration
– Up to five 16-bit Timer/Counters (TC) including one low-power TC, each configurable as:
• 8-bit TC with two compare/capture channels
• 16-bit TC with two compare/capture channels
• 32-bit TC with two compare/capture channels, by using two TCs
• Waveform generation
– Frequency generation
– Single-slope pulse-width modulation
Re: ESP32 Printer Board
January 03, 2018 05:34PM
Ahh. The document had not fully loaded when I ran my word search.
Re: ESP32 Printer Board
January 03, 2018 05:41PM
I'm liking the look of this one. The documentation is great, it has enough of everything, and it's cheap.
Re: ESP32 Printer Board
January 03, 2018 09:12PM
Re: ESP32 Printer Board
January 04, 2018 10:04AM
Damn it guys stop giving me so many options. LOL.

Looking at the SAMD21G it should work fine. Only question is how much RAM and Flash does it need. It would need to buffer the COM data.

It would be nice having Arduino to program in, but Arduino can drastically limit the functionality of a MCU. Would need to make sure that the Ardunio build has the right functionality.
Re: ESP32 Printer Board
January 04, 2018 01:35PM
New Alternate Design with the SAMD21G. It is the 32k SRAM version, but that can be swapped out with the lower SRAM version once memory usage is figured out.
Attachments:
open | download - MCU_ALT.png (337 KB)
Re: ESP32 Printer Board
January 04, 2018 01:48PM
I've used it before, and it's much more powerful than you'r regular ATMEGA. Should be quite effective.
And the arduino setup is stable.
Re: ESP32 Printer Board
January 04, 2018 02:20PM
Good you get to port arduino to the layout grinning smiley
Re: ESP32 Printer Board
January 04, 2018 02:27PM
sounds good smiling smiley
Re: ESP32 Printer Board
January 04, 2018 04:03PM
I found this post, SAMD21 SPI is limited to 8MHz when using DMA. I don't think it's a showstopper but good to know...

Arduino compatibility seems like a big plus.
Re: ESP32 Printer Board
January 04, 2018 04:17PM
Is that in Slave mode or Master mode?
Re: ESP32 Printer Board
January 04, 2018 05:01PM
Most docs I've read, not for samd21 (which I did not read yet) say uC needs 4 clocks to sample SPI clock so max speed at slave is sck/4 which would be 12MHz. Here's the doc I found for SAMD21

http://ww1.microchip.com/downloads/en/AppNotes/00002465A.pdf
Re: ESP32 Printer Board
January 05, 2018 01:59PM
Do you guys like the name Nemo for this project? I just gave it that name as it was the first thing that popped into my head.
Re: ESP32 Printer Board
January 05, 2018 02:53PM
I don't have an opinion about the name. Interestingly NEMO32.com is available to register as domain.

I searched in many places and cannot find any concrete data on how fast SAMx (SAM4, SAMD, SAMG, SAML) SPI will work in slave mode although app note I referenced previously is pretty detailed and does not list any limitations.

Edited 1 time(s). Last edit at 01/05/2018 04:05PM by newbob.
Re: ESP32 Printer Board
January 05, 2018 04:38PM
Quote
newbob
Most docs I've read, not for samd21 (which I did not read yet) say uC needs 4 clocks to sample SPI clock so max speed at slave is sck/4 which would be 12MHz. Here's the doc I found for SAMD21

[ww1.microchip.com]

We run the SAM4E SPI in slave mode at 27MHz on the Duet WiFi. We tried 40MHz, but it gave is very occasional transmit underrun errors.

Edited 1 time(s). Last edit at 01/05/2018 06:11PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: ESP32 Printer Board
January 05, 2018 05:51PM
Name sounds good. Reminds me of Captain Nemo's advanced submarine... a technological accomplishment smiling smiley
Re: ESP32 Printer Board
January 05, 2018 08:38PM
Quote
nathan25
Name sounds good. Reminds me of Captain Nemo's advanced submarine... a technological accomplishment smiling smiley

I thought it would be just another Fish themed name ("Finding Nemo"). So the firmware for the second processor could be Dorrie ;-)
Erik van der Zalm started that Fish Theme, as far as I know.

And also wasn't Captain Nemo the bad guy? Killing all military ships (including sailors) to force world peace?
Re: ESP32 Printer Board
January 06, 2018 12:13PM
There's just too much name collision in the world. I'm surprised they can still come-up with original movie titles, although, admittedly, it's been mostly remakes lately.

I say if it's good for a two-way communication system which has linked monitoring instruments on an active submarine volcano to the Internet since 1999, it's good for 3d printer controller smiling smiley
Re: ESP32 Printer Board
January 06, 2018 12:13PM
I was thinking of the NES game Little Nemo when I gave it that name. Just not sure I want to run with it.

I do find the whole Marlin - Nemo thing funny though. Mainly that I have no intention of porting Marlin to this board. Feel like that would be like trying to run MS-DOS on a modern gaming PC.

Edited 1 time(s). Last edit at 01/06/2018 12:14PM by CthulhuLabs.
Re: ESP32 Printer Board
January 06, 2018 12:17PM
Quote
newbob
I say if it's good for a two-way communication system which has linked monitoring instruments on an active submarine volcano to the Internet since 1999, it's good for 3d printer controller smiling smiley

Wah?
Re: ESP32 Printer Board
January 06, 2018 10:59PM
Added the DC to DC converter. Can someone please take a look at my work and let me know if I missed something. Been a while since I had to worry about a power circuit.
Re: ESP32 Printer Board
January 07, 2018 11:56AM
I'm actually debating making this just use a standard ATX power supply. That way it is easier for newbies to setup and I don't have to worry too much about handing different voltage levels.
Re: ESP32 Printer Board
January 07, 2018 12:40PM
Restricting it it to 12V operation only is quite a severe limitation. Before I abandoned it, the low-cost 32-bit board I was designing had a LM7805 linear regulator in TO220 package mounted vertically near the edge of the board. The idea was that a user could add a heatsink to it for 24V operation. The board itself plus a 12864-type display would draw less than 200mA, so the power dissipation @ 24V input would only be ((24 - 5) * 0.2) = 3.8W. The figures might be a little different for your ESP32 design.

Using a linear regulator is unfortunately less viable if you want to support TFT touch displays because they draw more current.

Edited 2 time(s). Last edit at 01/07/2018 12:41PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: ESP32 Printer Board
January 07, 2018 01:57PM
Thought about that too. From the 24 pin ATX connector I route some of the 12V pins to their own 12V bus. That bus is used to power the motors. Have a second 12V bus for things like fans. Then make a 24V adapter board with regulators on it. It would take 24V in and it would have 24V out for the motor bus, 12V out for the fans, 5V out for whatever, and 3.3V for the ICs.
Sorry, only registered users may post in this forum.

Click here to login