<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Question about 2nd Z-driver and IO for ANET A6</title>
        <description> Hi Everyone,
This is my first post on this forum. First of all, I would like to thank every contributor to the Marlin firmware! I have been a happy user for a while now, it was just the thing I needed, compared to the stock shipped firmware on my Anet A6.
I&#039;m now ready to go into the deep end :)

I would like to try adding some extra IO to the Anet board (Atmega 1284p)
Any help/insight for the below would be appreciated.

The electronics/hardware part I&#039;ve sorted:
By redirecting pins on the LCD header/plug and re-direct the Fan pin, I&#039;m able to:
	• Free up the uC pins for I2C and directly connect a 2nd Z-driver to the uC
	• Add an MCP23017 IO board on I2C for inputs
	• Add an PCA9685 PWM output board on I2C
	• Redirect the Encoder/dial on the LCD to the MCP23017
	• Redirect the Fan mosfet to be driven by the PCA9685
More details are on https://github.com/DutchForeigner/Anet-Z2-IO-Module

I&#039;ve created a duplicate board of the ANET_10 board
	• Added &quot;#define BOARD_ANET_10_Z2_IO           1512&quot; to boards.h
	• Created &quot;pins_ANET_10_Z2_IO.h&quot; based on &quot;pins_ANET_10.h&quot;
	• Added:
		#elif MB(ANET_10_Z2_IO)
		  #include &quot;sanguino/pins_ANET_10_Z2_IO.h&quot; 
	to file &quot;pins.h&quot;

My questions are now:
	1. How to assign pins on the I2C IO pins in the pins file (and have Marlin access those via I2C)?
   For example: the FAN will be on I2C PCA9685 port 15. Do I give that a virtual pin-number like 215 or IO2_15?
	2. Where (which folder/include in which file) would I put the Arduino libraries for the PCA9685 &amp;amp; MCP23017?
	3. In which part/file would I intercept the &#039;virtual&#039; pin number/names from the pins file to route them via I2C?
	4. Any change in input signals on the MCP23017 would generate an interrupt on D10. How/where would that need to be picked up?

I would be able to work my way through the C++ files etc.
If/when I manage to get this to work, I do plan to put all of it into a PR.</description>
        <link>https://reprap.org/forum/read.php?415,881206,881206#msg-881206</link>
        <lastBuildDate>Fri, 14 Aug 2026 05:33:27 -0400</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://reprap.org/forum/read.php?415,881206,881206#msg-881206</guid>
            <title>Question about 2nd Z-driver and IO for ANET A6</title>
            <link>https://reprap.org/forum/read.php?415,881206,881206#msg-881206</link>
            <description><![CDATA[ Hi Everyone,<br />
This is my first post on this forum. First of all, I would like to thank every contributor to the Marlin firmware! I have been a happy user for a while now, it was just the thing I needed, compared to the stock shipped firmware on my Anet A6.<br />
I'm now ready to go into the deep end :)<br />
<br />
I would like to try adding some extra IO to the Anet board (Atmega 1284p)<br />
Any help/insight for the below would be appreciated.<br />
<br />
The electronics/hardware part I've sorted:<br />
By redirecting pins on the LCD header/plug and re-direct the Fan pin, I'm able to:<br />
	• Free up the uC pins for I2C and directly connect a 2nd Z-driver to the uC<br />
	• Add an MCP23017 IO board on I2C for inputs<br />
	• Add an PCA9685 PWM output board on I2C<br />
	• Redirect the Encoder/dial on the LCD to the MCP23017<br />
	• Redirect the Fan mosfet to be driven by the PCA9685<br />
More details are on <a href="https://github.com/DutchForeigner/Anet-Z2-IO-Module" target="_blank"  rel="nofollow">https://github.com/DutchForeigner/Anet-Z2-IO-Module</a><br />
<br />
I've created a duplicate board of the ANET_10 board<br />
	• Added "#define BOARD_ANET_10_Z2_IO           1512" to boards.h<br />
	• Created "pins_ANET_10_Z2_IO.h" based on "pins_ANET_10.h"<br />
	• Added:<br />
		#elif MB(ANET_10_Z2_IO)<br />
		  #include "sanguino/pins_ANET_10_Z2_IO.h" <br />
	to file "pins.h"<br />
<br />
My questions are now:<br />
	1. How to assign pins on the I2C IO pins in the pins file (and have Marlin access those via I2C)?<br />
   For example: the FAN will be on I2C PCA9685 port 15. Do I give that a virtual pin-number like 215 or IO2_15?<br />
	2. Where (which folder/include in which file) would I put the Arduino libraries for the PCA9685 &amp; MCP23017?<br />
	3. In which part/file would I intercept the 'virtual' pin number/names from the pins file to route them via I2C?<br />
	4. Any change in input signals on the MCP23017 would generate an interrupt on D10. How/where would that need to be picked up?<br />
<br />
I would be able to work my way through the C++ files etc.<br />
If/when I manage to get this to work, I do plan to put all of it into a PR.]]></description>
            <dc:creator>DutchForeigner</dc:creator>
            <category>Firmware - Marlin</category>
            <pubDate>Thu, 04 Feb 2021 16:26:11 -0500</pubDate>
        </item>
    </channel>
</rss>
