28X + MCP23017 ? AndyPro

Chris DeHut

Senior Member
Hi all,

I am working on another high capacity I/O device using a 28X and MCP23017 chip. I did one already with the MCP23016 chip, but this time I want to make things much more compact and the 23017 seems to be much better laid out for this.

I want the system to work like this...

All inputs are switches connected to ground. So, when a switch is made, the signal at the port is pulled low.

For the electronics, I think I want this to be the configuration...


+5Vd --> 1K resistor ->|
|
Gnd -> Sw ->-----------| ----> 23017 port

Is this correct? Sorry, I am a bit better at programming than electronics.

Chris
 

ylp88

Senior Member
Your ASCII diagram has gone wonky... try using the "<code>" and "</code>" tags (substituting the "<" for "[" and ">" for "]"). It will work better!

<b><i>ylp88 </b> </i>
 

ylp88

Senior Member
<code><pre><font size=2>
+5Vd-----1K-----+
|
Gnd----Sw-------+----&gt; 23017 port
</font></pre></code>

If this is what you meant then the 23017 port pin will be pulled high and when the switch (Sw) is pressed, the input will be pulled low. Is that what you want?

Also, is there a reason why you chose a 1K pull-up resistor. Although it is perfectly fine, you can use a higher value resistor, say 4.7k - 10k.

<b><i>ylp88 </b> </i>

Edited by - ylp88 on 1/10/2006 2:45:47 PM
 

Chris DeHut

Senior Member
Sorry about that, I will have to look at the editing a bit more to make the ascii schematics more clear.

Yes, that is what I want. I want the port high when inactive (Switch open), then Low when the switch closes. I think this is the &quot;normal&quot; method of dealing with inputs, please correct me if I am wrong though!

Chris
 

ylp88

Senior Member
This is a common arrangement. It is similar to that of the i2c bus, but of couse with internal &quot;switches&quot;.

The alternative is the pulldown resistor, or active high setup.

<code><pre><font size=2>
+5Vd----Sw-------+
|
GND-----1K-------+----&gt; 23017 port
</font></pre></code>

In this case, the pin is usually low, and when the switch is pressed, the pin is then high and becomes active - active high.

The i2c configuration above is active low - and active signal when the voltage is low. This is also alike the RS232 bus.

As for ASCII schematics, use the &quot;code&quot; syntax (as described above, and in the &quot;Protocol&quot; page - look at the link at the VERY top of the page) to get the constant pitch font and force the preservation of the masses of leading spaces.

<b><i>ylp88 </b> </i>

Edited by - ylp88 on 1/10/2006 2:56:36 PM
 
Top