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

Post by Sean »

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

Post by Mathy »

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

Post by luthra_arun »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I/O expansion

Post by Benj »

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

Post by luthra_arun »

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

Post by Sean »

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

Post by luthra_arun »

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

Post by Sean »

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

Post by luthra_arun »

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: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Re: I/O expansion

Post by Jay Dee »

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

Post by Spanish_dude »

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: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Re: I/O expansion

Post by Jay Dee »

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 824 times
Cheers, J.

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

Re: I/O expansion

Post by gmwow »

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.

Post Reply