Shop OBEX P1 Docs P2 Docs Learn Events
Oscilloscope & I2C — Parallax Forums

Oscilloscope & I2C

Earl FosterEarl Foster Posts: 185
edited 2006-03-21 22:42 in BASIC Stamp
I am writing and reading data to a 24LC32 using the I2C command.·· My breadboard layout works perfect.· My PCB layout does not.· I have checked the wiring against the schematic many times and I can’t find any issues.· I have done continuity and voltage checks against the 2 circuits and they are the same. ·
·
So now I am running the O-scope against the circuit and they are different but even the working circuit doesn’t look the way I expected.· I was expecting something along the lines of the Phillips I2C documentation graphs so I figure I must be doing something wrong.· I have attached an I2COUT trace with my settings and ran·code 24LC32.bsp to capture the read statement. ·The blue trace is data and the red trace is clock.
·
I am looking for guidance so I can properly troubleshoot this circuit with the O-Scope.·

Thanks

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-20 16:40
    Earl,

    ·· What exactly is happening with your EEPROM?· What results are you getting?· One thing I see in your schematic is your WP line is floating.· Now this may not be an issue, but I would think you would want it tied LOW if you're not using it.· I wonder if the line is floating and possibly causing problems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Earl FosterEarl Foster Posts: 185
    edited 2006-03-20 17:26
    I have never used the WP and all the schematics show it not connected. As far as what is happening to the EEPROM, it is failing the read test using the 24LC32.BSP code. I have slowed the program down so I could watch each write and read and it passes the write stage but fails the read stage. In my PCB circuit it is failing the read stage as well but on the breadboard is works like a champ.
  • ForrestForrest Posts: 1,341
    edited 2006-03-20 17:30
    You're running a Camera servo, a GPS, DS1620 and a 24LC32 all off the Vdd pin of a BS2P24. I'm not sure the BS2P24 voltage regulator has enough power to drive all those devices.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-20 17:37
    Forrest,

    ·· Good catch, I hadn't noticed that until you mentioned it.· It begs the question though, how did this work on the breadboard?· Perhaps everything wasn't connected there?· In any event that is correct.· There will not be enough power from the BS2p VDD pin to run these items.· In fact you should really try to avoid using this pin at all in most cases.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Earl FosterEarl Foster Posts: 185
    edited 2006-03-20 19:24
    All the devices are connected on the breadboard and everything is working. I have ran the breadboarded circuit around in my car for a couple of hours and didn't have any problems. I have to say that I do find that statement of not using Vdd kinda funny since the Applied Sensors SIC does exactly that (Figure 6-5, page 154). Now granted I might be pushing it but it is working on the breadboard.

    Turning back to my current issus the only piece I am having a problem with on the PCB is the 24LC32. In order to troubleshoot the 24LC32 all other components have been removed from the PCB so I could isolate that circuit. So I am still looking for some suggestions on what else I can do to troubleshoot the problem. I am thinking a comparsion between the working and non-working circuit but I need a good baseline of the working circuit and as I said I don't think I output I have is correct.

    So I guess what I am asking is if you were going to monitor communications between the Stamp and the 24LC32 using the I2CIN and I2COUT statement during a read and write cycle what settings and probe connections on the Parallax O-Scope would provide me the best results?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-20 20:05
    Earl,

    ·· You would monitor the SDA and SCL lines using the two channels.· You would connect ground to VSS.· It also appears as though you're connecting the two VDD supplies from each Stamp Module through a Reed Relay?· I guess the main point I wanted to get across to you in that a servo alone draws more than the on-board regulator can provide.· We would never recommend using that for just the servo, but then you have the other circuitry.· If it was just the DS1620 and the 24LC32 then that would probably be okay.· I guess I would also recommend tying WP low to see if it helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Earl FosterEarl Foster Posts: 185
    edited 2006-03-20 20:35
    I appreciate the advise and I can easily move a wire directly to the power supply for the primary computer. After relooking at the specs of the P stamp I have pushed the limit. The secondary computer Vdd is only appling power to the GPS if the primary power fails. A single line swap and DS1620, GPS, servo, and AD592 components can be powered by the regulated power supply. The reed switches have a 500 ohm coil so the current is no larger then what a LED would pull.

    Getting back the O-scope. That is how I connected the probes but it doesn't look right and I am thinking that my timing is off and I can't get over how much noise there is in the trace. Currently it is set to 100us with a 2 volt division. Perhaps I can need to adjust the timing or write a new program that will generate a single read and write and capture that trace.

    Well I will work on that tonight.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-20 21:48
    Earl,

    ·· Are you using the same power supply in both systems?· Also, there is something else to consider here.· I have been designing and building circuits for many years, and one thing I learned early on is that breadboards have some capacitance which can eliminate some noise in a system.· I didn't see any .1uF capacitors in your schematic and I can't help but wonder if you're experiencing noise on the lines.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • kelvin jameskelvin james Posts: 531
    edited 2006-03-21 06:43
    Your circuit diagram shows the I2c leads wired wrong from the stamp. P0 should be be SDA.

    kelvin
  • Earl FosterEarl Foster Posts: 185
    edited 2006-03-21 20:27
    It shouldn't matter as long as you adjust the code
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-03-21 21:05
    Earl,

    ·· Kelvin is correct.· On the BS2p when using the I2CIN/I2COUT commands the root pin (Which must be P0 or P8) must be connected to SDA.· The next highest pin is automatically SCL.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Earl FosterEarl Foster Posts: 185
    edited 2006-03-21 22:42
    Well thank you very much Kevin and Chris.· I was not aware of that little important fact.· I am sure it is documented but I missed it.· And funny enough - I have it wired correctly on the breadboard and thats why it works there and not the PCB.

    I just finished making the swap and it works like a champ·hop.gif· Thanks again

    Post Edited (Earl) : 3/21/2006 11:28:40 PM GMT
Sign In or Register to comment.