Giter VIP home page Giter VIP logo

esp8266_reprap's Introduction

#ESP8266 I2S 32bit Realtime Shift Register Driver

I believe I found a way to use just an ESP8266 module to control a set of 3D printer stepper drivers directly. This code demonstrates how.

Background:

  1. Other projects show how to use ESP01 as a wifi-serial bridge to the arduinos, but serial is still a bottleneck and wifi uploads are impractical.
  2. Altough ESP8266 does 160MHz at 32bits processing (versus 16MHZ 8-bit from most Arduinos) it has insufficient realtime GPIO for controlling printers.
  3. Raspberry pi shared the realtime gpio limitation, but wallacoloo still did reprap control using DMA. Nice! https://www.youtube.com/watch?v=g4UD5MRas3E
  4. CNLohr did a really cool WS2812 led driver (weird one-wire serial protocol) using ESP8266 I2S audio output and DMA. https://www.youtube.com/watch?v=6zqGwxqJQnw
  5. I2S and SPI look very much alike, and SPI can control shift registers. Hey! Opportunity!

I got the code from CNLohr on github, modified it to output a 32 bit counter (16 bit left + 16 bit right channels) via a circular DMA buffer, and created a small PCB with four cascaded 74HC595 shift registers. wiring is simple:

  • I2S Data to '595 input data
  • I2S Bitclock to '595 shift clock
  • I2s word clock (left/right) to '595 buffer clock.

This is what RAW I2S output signals for the counter look like: word-clock (yellow), bit clock (cyan), data (purple). Notice how LSB of data is output after the word clock rising edge.

IMAGE ALT TEXT HERE

Fixed the offset (software shifing) to match the parallel outputs, raised the frequency a bit (just cause), plugged in the shifter board. Now this is what word-clock (yellow) and the 3LSBs (cyan=1, purple=2, blue=4) look like: image of osciloscope

The code and the PCB: (https://github.com/lhartmann/esp8266_reprap)

What this does:

  • Allows realtime bitbanging of 32 data bits via I2S and DMA.
  • Demo code just outputs a 32bit counter at 185kHz sample rate.
  • Reference shifter board is provided.

Limitations:

  • 1MSB is actually delayed by 1 sample due to I2S signaling standard. This delay is constant so it could be compensated, but I didn't bother.

Hopes for the future: RepRap 3D Printing.

  • No extra arduino necessary, ESP would control the drivers directly.
  • SDcard uploads over wifi would be feasible for large files, no more serial connection bottleneck with wifi-serial bridging.
  • Browser-side slicing with slic3r and (http://www.skulpt.org). No software install required on the client!

esp8266_reprap's People

Contributors

cnlohr avatar lhartmann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.