Shop OBEX P1 Docs P2 Docs Learn Events
Mpc23016 — Parallax Forums

Mpc23016

NewzedNewzed Posts: 2,503
edited 2004-10-14 21:22 in BASIC Stamp
Seems like I can not get my MPC23016 to work.· I think I have it wired correctly - does anyone have a schematic of it connected to a Stamp and the code to run it on a BS2P.· I don't ask for help very often but this time I'm stuck.

Sid
«13

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-02 14:39
    Do you have the required RC circuit connected to pin 9 (CLK)?


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office


    Post Edited (Jon Williams) : 9/2/2004 2:44:16 PM GMT
  • KenMKenM Posts: 657
    edited 2004-09-02 14:49
    Jon,

    What schematic layout software is did you use in this thread?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-02 14:53
    None. We use Corel Draw to do our drawings.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-09-02 15:29
    Jon, everything is just like your schematic except that I am using pins 8 and 9.· Also, I do not have 8 and 19 connected to ground.· Aren't these pins connected internally to pin1?

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-02 15:42
    They probably are, but I've always connected my circuit as in the schematic and I have never had a lick of trouble with the MCP23016 -- in fact, it has become one of my favorite accessory parts. Double-check your connections and your code; that part is very easy to use and it's probably one of those simple "gotchas" that is biting you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-09-02 15:47
    Jon, would you mind posting the code again.· I have the I2C code for the BS2P which I think I got from you, but I would just like to check it.· Seems to me I had this thing running once before.· As you say, it just might be something dumb.

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-02 16:00
    It's attached to the message that has the schematic.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-09-02 16:12
    Oh sure!· This is the first I have heard of this part!· Now I may have to redesign a few projects!· sad.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-02 16:21
    Obviously you're not following my Nuts & Volts column, because I wrote about this chip in the May issue....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-09-02 16:30
    Jon, you do not have pin 6 - INT - connected.· I have it pulled high.· Could that be the problem?

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2004-09-02 16:37
    Correction:· Pin 6 is not·pulled high - it is connected directly to Vdd.

    Sid
  • SunflowerSunflower Posts: 48
    edited 2004-09-02 17:06
    Did you mean: MCP23016

    [noparse][[/noparse]PDF] Column #109: Expansion Made Easy Column #109 May 2004 by Jon ...
    File Format: PDF/Adobe Acrobat - View as HTML
    ... We're not using that here, but we still need the RC circuit for the MPC23016
    to run. The values shown are recommended by Microchip. ...
    www.parallax.com/dl/docs/cols/nv/vol5/col/nv109.pdf - Similar pages

    Did you mean to search for: MCP23016
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-02 17:55
    Sid: The INT pin is an output that I'm not using. The MCP23016 pulls that line low, so you should use a pull-up and not connect it directly to Vdd.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-09-02 18:16
    You're right Jon...I need to find the time to start reading the articles...I can't imagine how much stuff I am missing by not.· In fact, I have the first 4 "Nuts & Volts of BASIC Stamps" books, but I haven't read those either.· I also have Al's SOM book, and again, haven't gotten to it.··I have, however,·read the entire StampWorks manual, and the Robotics books as well.· I guess I need to unwind more.· Still this chip looks promising.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    ·
  • NewzedNewzed Posts: 2,503
    edited 2004-09-03 12:55
    Jon, I'm still having problems with the MCP23016.· Right now I am using the BS2 code.· If I read the states of GP0 the screen tells me 11111111, but there is no voltage on the pins - won't light an LED.· There is a possibility I damaged the chip by tying INT to Vdd, so I'm building another one this morning.· I have attached the BS2 code which you helped me with some time ago - if you have time could you take a look at it to make sure I haven't done something wrong.

    Just so everyone will know - on the Rev B and Rev C boards the Stamp Vdd comes from the regulator on the Stamp, not the external regulator.· Max current is 60ma.· Yesterday I had the MPC hooked up to my BS2P with four LEDs attached to the MCP.· When I powered up the four LEDs came on briefly, then I fried my BS2P.· Be careful what you attach to the Stamp Vdd on these BOEs.

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-03 13:23
    It's early and I'm having trouble following the flow of your code, Sid.· What I've done is attached a working MCP23016 demo for the BS2 that uses my updated I2C routines.· Give it a try.

    Vdd on BOE boards has always come from the onboard regulator and not the BASIC Stamp.· The output from the regulator does attach to Vdd on the BASIC Stamp, however.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-09-03 13:39
    Thanks for the code, Jon.· I'll give it a try.

    On the Rev A BOE, pin 24 - Vin - is not connected to anything.· Stamp Vdd comes from the external regulator.

    Are you saying that on the Rev B and Rev C boards, Stamp Vdd comes from the Stamp regulator, and that Stamp Vdd - pin 21 also connects to the external regulator?

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-03 13:51
    Yes, the output of the external regulator (LM2940) connects to the Vdd pin (21) on the BASIC Stamp -- this doesn't cause any problem, and you can get about 500 mA from that regulator (for the BASIC Stamp and your circuits).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-09-03 14:17
    I tried your code, Jon.· I changed SDA/SDL to 8 and 9.· Also on my board A1 is pulled high so I changed line 84 - devNum - to 2.

    Ran the program and in line 133:

    IF (i2cAck = Nak) THEN Write_Byte

    I get a constant " 1 " - busy.· I would have to assume something is bad on the MCP23016 board.

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-03 14:32
    You could always hook-up a 'scope and check it out. I'm sorry you're having so much trouble; I've always found working with the MCP23016 trouble-free and like it so much I asked our Marketing group to add it to our "Component Shop."

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-09-03 15:16
    Jon, I looked at what I could with the Optascope.· Remember the program is locked up at at line 133.

    SDA and SCL appear to be switching normally - both patterns the same.

    I looked pin the clock - pin 9.· Base line was 5 volts, with a negative-going pulse of about 2.5 volts every 15ms, which corresponds to a frequency of about 66 Hz.· I don't know what effect the Optascope would have on the clock frequency.· Seems to me the frequency should be a lot higher than that.

    Sid
  • NewzedNewzed Posts: 2,503
    edited 2004-09-03 19:49
    Jon, I removed the Stamp from a Rev B board and applied power.· I had 5VDC on the AppMod header and on the header at the top of the breadboard.· Vin read 12VDC but Stamp Vdd - pin 21 - read 0.

    Can you confirm that Stamp pin 21 is tied to the output of the external regulator?· This is important - I think that is why I fried my BS2P - I was trying to pull all the current for the Stamp and the MCP23016 with its LEDs through the Stamp's regulator, which is 60ma max.

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-03 20:21
    Schematics are attached for your reference (I just got them from Engineering).· As you can see, Vdd comes from the LM2940, and on the Rev B board the LM2940 output and the BASIC Stamp Vdd pin are indeed connected.· On Rev C and later boards, the Vdd pin of the BASIC Stamp connects to nothing but a cap so a loss of Vdd at the header would indicate a bad regulator.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-09-03 20:22
    Poor Sid...It always hurts to lose a good BS2 chip...Especially a BS2P.· A moment of silence?

    sad.gif

    On a serious note though, I have 2 Rev B BOE boards, and the output of the external regulator connects to Vdd directly.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • NewzedNewzed Posts: 2,503
    edited 2004-09-03 20:54
    Jon, I have not lost my mind.

    I have two Rev B boards.· If I UNPLUG the Stamp from the boardm there is no power on Stamp Vdd Pin 21, nor on the Vdd pin of the AppMod header.

    There is a power trace running from Stmp Vdd to AppMod Vdd, but on the bottom of the board nothing is connected to the Vdd pin of the AppMod - no traces, no cap, no·nothing.· AppMod Vdd is NOT connected to the external regulator even though the schematic says it is.

    Chris, pull the Stamp from one of your Rev B boards and see if you still have power on Stamp pin 21.

    The reset trace from the Stamp goes to the AppMod header between P14 and Vdd, then turns downward to the reset button at the bottom of the board, so there is no way a power trace could continue from Vdd to the external regulator.· If you would like to check my Rev B board I will be happy to send it to you.

    I have not checked my Rev C board yet so I don't know about that one.

    Look at the bottom of the Rev B boards - you will see that AppMod Vdd has nothing connected to it.

    Sid
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-09-03 21:26
    Ok Sid,

    ·· You are right...Vdd on the Stamp is NOT connected to the output of the external regulator.· Now here is why I was wrong...I tested the Vdd at the top of the breadboard, assuming that Vdd was common all the way through the board.· This is not the case.· The Vdd terminals above the breadboard are connected to the output of the external regulator, the Vdd from the Stamp and going to the AppMod header is not connected to the External Regulator.

    ·· I have to admit, I am sure glad you had me do this, because I can see where there is the·potential for problems, if you don't realize you're sucking current from the Stamp's on-board regulator.

    shocked.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • NewzedNewzed Posts: 2,503
    edited 2004-09-03 21:53
    I'm glad you found the same thing, Chris.· This presents a real problem for some of my Piggybacks unless I can come up with a fix.· The clock and the EEPROM won't be a problem but the MCP23016 definitely will be· Using all 16 ports you could easily draw 170ma.

    I can fix my boards but I have to come up with something that will work on someone else's board.· Oh, the agony of it all !!

    No wonder I fried my BS2E and the BS2P.

    Sid
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-09-04 00:13
    Well, I wouldn't necessarily call the BS2pe and the BS2p dead for good yet.· If memory serves, Parallax has a repair program that shouldn't be too bad...I mean it's got to be better than buying 2 new chips!

    But, here is a solution that I offer that the Parallax techs can either agree with, or not...

    Since the lines are supposed to be tied together anyway, why not just tie them together on your BOE?· I would double check the traces, but it seems to me you should be able to do this without incident.· I fully understand where you're coming from, and I am as stumped as you are.

    As I said, I tested my BOE Rev B from the Vdd pins above the header, since I had an AppMod in the way of the stamp.· When you asked me to unplug my stamp, I wentand removed the AppMod and unplugged the stamp.· So that's why I too was sure it was fed from the output of the external regulator.

    Well, now we know...Good luck with hopefully getting your stamps repaired.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • NewzedNewzed Posts: 2,503
    edited 2004-09-04 00:19
    Yes, I'm getting my Stamps repaired, Chris.· Thank goodness!

    I plan on running a jumper on the bottom of the board from the AppMod Vdd pin to the most convenient point from the external regulator.· Haven't figured out exactly what that point is - probably the Vdd strip at the top of the breadboard.· 22 ga. wire should be adequate.

    I posted the new code for the Stamp Tester.· Did you download it?

    Have a nice weekend.· We are waiting for Frances and whatever she might bring us.· A bunch of wind and water for sure.

    Sid
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-09-04 00:32
    Sid,

    ·· Bite your tongue!· Frances isn't welcome!· Yes, I got the new code, thanks!· And I too will be modding my BOE Rev B. to make the necessary adjustments.· I have 2, but one is a BOE-Bot with the Crawler Kit (See My Web Page).· So I am not too worried about that, but I will keep it in mind for future AppMod considerations.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
Sign In or Register to comment.