Code Monkey home page Code Monkey logo

Comments (6)

bdring avatar bdring commented on August 26, 2024

I added that to the roadmap. Most of the I/O you are talking about uses interrupts. I see there is an interrupt pin option. I'll have to look at that more.

Do you have any suggestions on how to add that to cpu_map.h and config.h?

from grbl_esp32.

tknapstad avatar tknapstad commented on August 26, 2024

Another option is this chip from Microchip which has two interrupt lines, one for each 8-pin port. Consumes one more ESP32 pin, but gives more flexibility:
https://www.microchip.com/wwwproducts/en/MCP23018

I haven't looked at the code until now. My initial impression and ideas:

  • I don't think config.h needs to be touched
  • Need to add an ioexp.h/.cpp module to handle the IO expander interrupt(s) and I2C communication.
  • Pin numbers can be defined in ioexp.h. The upper bit can be set to 1 for the IO expander pins, so we start at 127 (#define GPIO_EXP_NUM_1 127)
  • Include ioexp.h in cpu_map.h so that we can assign the IO expander pins to functions like PROBE_PIN
  • An abstraction level is needed for at least the Arduino functions pinMode, digitalRead, digitalWrite and attachInterrupt so that we can handle both regular pins and the IO expander pins in the same way from the Grbl code. I would suggest adding a gpio.h/.cpp module to handle this. Existing code would have to be refactored to call i.e. "gpio_set_pin_mode" instead of the Arduino "pinMode" function.
  • The IO expander interrupt handler must read the state of all pins and call the appropriate existing interrupt handlers (for instance isr_limit_switches if any of the limit switches were triggered)

The most work seems to be in creating an abstraction layer for GPIO handling (pinMode etc.) and implementing the I2C protocol for the IO expander.

from grbl_esp32.

npross avatar npross commented on August 26, 2024

I've never used it but I was looking for I2C IO expanders and came across these:
https://www.semtech.com/uploads/documents/sx150x_89b.pdf

Digikey sells them for $2.55
They are QFN

Sparkfun has a breakout board for and there is code too.

from grbl_esp32.

MakersHeaven avatar MakersHeaven commented on August 26, 2024

How about the cheap PCF8575 as a port expander? There are plenty of chips and modules out there and it's almost gold standard in ways of simplicity.

http://www.ti.com/lit/ds/symlink/pcf8575.pdf

Also, the port-expander could be used to free up i/o for additional step/dir driving on the ESP32, feedback like endstops or spindle speed goes to the expander.

from grbl_esp32.

svalambhia avatar svalambhia commented on August 26, 2024

This guy uses esp8266 and shift registers to control GRBL 8-axis. https://github.com/gcobos/grblesp & youtube video https://www.youtube.com/watch?v=EGESCcurkwA For a Good controller we need 9 axis like g2core https://github.com/synthetos/g2

from grbl_esp32.

M10CUBE avatar M10CUBE commented on August 26, 2024

Guys at the end all comes to PLC. That is why I am trying to solve all these I/O problems with this modular design.
https://gitlab.com/m10cube/m10
I am afraid we are a bit behind with the redesign (new PCB is 90x90) but you get the idea. Any help welcomed

from grbl_esp32.

Related Issues (20)

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.