Shop OBEX P1 Docs P2 Docs Learn Events
Square Waves — Parallax Forums

Square Waves

RogerInHawaiiRogerInHawaii Posts: 87
edited 2009-09-27 17:18 in Propeller 1
I'm using the following

Synth.Synth("B", pinNumber_32k_Clock, 32_768)




to set up a 32KHz clock on one of the Propeller chips. This works quite well and I get a nice square trace on my oscilloscope.

Clock32K.jpg

I'm also using the following...

Synth.Synth("A", PinNumber_4Meg_Clock, 4_000_000)




to set up a 4MHz clock on one of the Propeller chips. This also works quite well, although the trace isn't quite as nice and square as the 32KHz trace.

Clock4MHz.jpg

I'm also producing a kind of clock signal on another pin just by toggling the pin from within my spin program. When I do that, the trace I get looks like this:


ClockToggle.jpg

This does not look very good. The signal goes way low before settling at a steady "off" condition and goes way high before settling on a steady "high" condition.

So, two questions:

1. Why does the 4HMz clock not have the same, nice, square wave as the 32KHz clock, since they are both run using the built-in clocking features (the synth.spin code) to create them?

2. Why does the "clock" output created by simply toggling a pin output look so very different from either of the other two?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-27 03:57
    Roger,

    It may just be the timebase setting on your scope. For example, on your 32KHz output, try setting the timebase to 1us, so you can examine an edge in detail. You may see the same over- and undershoot symptoms.

    Now, having said that, I doubt that the Propeller output actually looks like that on its own. When you apply an oscilloscope to examine a signal, you're not examining just that signal, but the entire system of signal, plus scope probe, scope leads, and scope input. If your ground lead, for example, is too long, the extra inductance imposed on the system may result in the kind of overshoots you're seeing. It may also be that your probe compensation is out of adjustment. If it's adjustable, your scope manual will show you how to tweak it.

    -Phil
  • LeonLeon Posts: 7,620
    edited 2009-09-27 08:50
    Those look like scope artifacts, as Phil has said.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Nick MuellerNick Mueller Posts: 815
    edited 2009-09-27 09:09
    To me, it even looks like a misaligned probe!

    Nick

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never use force, just go for a bigger hammer!

    The DIY Digital-Readout for mills, lathes etc.:
    YADRO
  • DroneDrone Posts: 433
    edited 2009-09-27 12:17
    I agree, this looks like something external to the Propeller. What kind of scope are you using, analog, digital, type of probe? Check that you've leveled your probe and you're measuring as close to the pin as possible with nothing else connected to the pin. What Propeller board are you using? Is the Propeller on a plug-in proto-board?

    Rgds, David
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-09-27 14:16
    I would have expected some overshoot to appear on the 32K trace, if the probe comp was out. Most 'scope cal pulses are a lot lower in freq than that. It looks like good old differentiation. It the scales have not beel altered, the tip of the overshoot to the resting level is 3.XXX units ( 1V/Div ??)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-27 15:48
    Toby Seckshund said...
    I would have expected some overshoot to appear on the 32K trace
    It may still be there but be too skinny to see at that timescale. That's why I suggested examining a single edge using a shorter timebase.

    -Phil
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-09-27 16:41
    I was guessing that the last trace, which doesn't have the slow rise and fall that the 4MHz trace, and has much brighter tops and bottoms indicated a lower freq with slower timebase.

    Roger.

    What is the last trace's freq, and where was it measured ??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • pmrobertpmrobert Posts: 677
    edited 2009-09-27 16:47
    I can make my old Tek 2213 analog scope do exactly the same thing by forgetting to ground either of the probes or not grabbing a good ground.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-09-27 16:50
    Toby,

    I'm betting that the probing conditions for that last trace were different from the other two. (Bad ground connection?)

    -Phil

    Update: pmrobert beat me to it!
  • W9GFOW9GFO Posts: 4,010
    edited 2009-09-27 17:18
    I once had a trace like the bottom one. It was (at least partially) because I had the X10 switch on the probe turned on.

    Rich H

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Servo Boss, a 12 channel servo tester kit from Gadget Gangster.
Sign In or Register to comment.