I/O expansion

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Please rate this article out of 5: (1 being the worst and 5 being the best)

1
0
No votes
2
0
No votes
3
0
No votes
4
0
No votes
5
9
100%
 
Total votes: 9

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: I/O expansion

Postby Sean » Fri Oct 16, 2009 12:06 pm

Hello Mathy,

Now that I have found the errata I will be able to repeat my tests with a better understanding of the results. I suspect my chips are affected by this problem so I will test my understanding of the additional software requirements.

The errata was dated 2007. I don't know when stocks of the corrected devices became available, but it is possible that recently purchased chips will be from the older stock (you can sometimes find a date in the additional numbers printed on the devices). You may also find that your SOIC devices do not have this problem.

If you want to post one of your programs on the forum I will take a look at it and try to sort out any problems. If not, I will post any successful test/demonstration programs I create over the next few days.

Mathy
Posts: 333
Joined: Mon Oct 05, 2009 2:39 pm
Has thanked: 30 times
Been thanked: 33 times
Contact:

Re: I/O expansion

Postby Mathy » Fri Oct 16, 2009 1:17 pm

Hi sean,

I just test a 23S17 SOIC on my breadboard and it works !!!!!
I test all the address one by one and I think it's ok. Nothing appears strange...

I have to Init with your macro

first : 0,0x0A,0x08
and second : 4,0x0A,0x08

If I forget the second Init macro, the chip doesn't respond to address higher than 3 but works with.
With my DIP chip, even if I put all the init of the world, I have nothing on PORTA and PORTB, and I try with three different DIP chip.

I'd like to pay you a good bear !

Have a nice weekend !

Mathy

luthra_arun
Posts: 18
Joined: Wed Nov 11, 2009 7:39 am
Contact:

Re: I/O expansion

Postby luthra_arun » Thu Nov 12, 2009 9:55 am

Hi to all,
i am get the problem to communication the MCP23017 with pic16f877A i had run the same program which had post previously i donot know where the problem is i am get .78v in all the pin even if give high the PortA the PortB values havn't changed. I put 4.7k pull up in data and Clock bus.

User avatar
Benj
Matrix Staff
Posts: 14303
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4396 times
Been thanked: 4124 times
Contact:

Re: I/O expansion

Postby Benj » Thu Nov 12, 2009 10:30 am

Hello

A few quick questions.

Does a simple program work. Eg flashing a LED with 1 second delays.

Are you using a pull up resistor for the MCLR reset pin?

Are you using your own programming hardware or one of our boards?

Is the crystal or clock circuit connected and configured correctly?

luthra_arun
Posts: 18
Joined: Wed Nov 11, 2009 7:39 am
Contact:

Re: I/O expansion

Postby luthra_arun » Thu Nov 12, 2009 12:04 pm

Hello
Benj wrote:Hello

A few quick questions.

Does a simple program work. Eg flashing a LED with 1 second delays.


Yes it works properly .

Are you using a pull up resistor for the MCLR reset pin?

yes .

Are you using your own programming hardware or one of our boards?

I am using my own h/w.But that is working fine i had drive the lcd and other parameters are also fine.

Is the crystal or clock circuit connected and configured correctly?

Yes i am using 4Mhz clk and i had configure correctly in the program.

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: I/O expansion

Postby Sean » Thu Nov 12, 2009 1:16 pm

There is a /RESET pin on the 23017 (pin 18 on the dip package). Is this also being pulled high?

luthra_arun
Posts: 18
Joined: Wed Nov 11, 2009 7:39 am
Contact:

Re: I/O expansion

Postby luthra_arun » Thu Nov 12, 2009 1:24 pm

sean wrote:There is a /RESET pin on the 23017 (pin 18 on the dip package). Is this also being pulled high?

I had already make it high.

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: I/O expansion

Postby Sean » Mon Nov 16, 2009 10:28 am

Have the hardware address pins (A0, A1, A2) on the 23017 been configured correctly?

For initial tests these pins should be connected to 0v to match the device address (0) passed to the read and write macros in the example programs.

Any changes to the device hardware address must be matched by the software.

luthra_arun
Posts: 18
Joined: Wed Nov 11, 2009 7:39 am
Contact:

Re: I/O expansion

Postby luthra_arun » Thu Nov 19, 2009 11:19 am

sean wrote:Have the hardware address pins (A0, A1, A2) on the 23017 been configured correctly?

For initial tests these pins should be connected to 0v to match the device address (0) passed to the read and write macros in the example programs.

Any changes to the device hardware address must be matched by the software.


It is now working actually every thing is fine their is even to problem with h/w connection and s/w. The problem which i found is that the development board in which i was testing that is USB based due to that the current on the port pin get down and i unable to communication the same program then i run on the board where i give the from SMPS it is working.

User avatar
Jay Dee
Posts: 352
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 116 times
Been thanked: 134 times
Contact:

Re: I/O expansion

Postby Jay Dee » Sun Aug 14, 2011 3:20 pm

Hi,
I found this thread really useful and have learnt quite a bit in getting my SPI MCP23s17 expander working with an ECIO 40P , especially logic levels and tweaking the in-line resitors on the SPI line. I usually try to document my stuff for future reference and so I've attached my Circuit diagram and notes, which might help other Noobs like me who are playing with this expander. There are no guarantees with it and if you think its wrong let me know! I basically used the Flowcode example from Sean and only threw in a few extra lines to configure pull ups on the inputs etc..so have not attached the flowcode.
- see below for Ver2 of Schematic
Cheers, John. :)
Last edited by Jay Dee on Sun Aug 14, 2011 7:54 pm, edited 1 time in total.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: I/O expansion

Postby Spanish_dude » Sun Aug 14, 2011 5:06 pm

Hi Jay Dee,

Haven't you forgotten a connection at the push buttons on your schematic ?

BR

Nicolas L. F.

User avatar
Jay Dee
Posts: 352
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 116 times
Been thanked: 134 times
Contact:

Re: I/O expansion

Postby Jay Dee » Sun Aug 14, 2011 7:52 pm

Well, whats a ground line between friends. :D
I never trust anything thats still a version 1 anyway...it only means I must have missed something and not yet spotted it!
Ver2
ECIO_and_EXPANDER_MCP23S17_Ver2.pdf
(47.89 KiB) Downloaded 666 times

Cheers, J.
These users thanked the author Jay Dee for the post:
Sean (Mon Aug 15, 2011 9:48 am)
Rating: 5.26%
 

gmwow
Posts: 11
Joined: Sat Sep 27, 2014 4:14 am
Location: Colorado, US
Has thanked: 2 times
Contact:

Re: I/O expansion

Postby gmwow » Sat Nov 29, 2014 5:15 am

Hi. I know this is an old thread but I'm trying to do this very same thing with a pic18f46k20 and the mcp23s17 and I just can't get it to work using Flowcode 6. Could you upload a version 6 working example of this?

Thank you.