Generating a clock

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • canadaboy25
    What is normal?
    • May 2013
    • 509
    • Canada

    #1

    Generating a clock

    Hey guys,

    I'm needing to generate an adjustable clock signal (preferably a sine wave). I don't have a function generator so I need another alternative.

    I'm wondering if there is any way I can output a clock from my pc's serial or parallel port. If so I need to be able to adjust the frequency live by pressing the arrow keys or something.

    Does anyone know how to do this?

    I also have a raspberry pi if that could be useful for anything.
    canadaboy25

    -Sometimes the light at the end of a tunnel is an on-coming train
  • stj
    Great Sage 齊天大聖
    • Dec 2009
    • 30965
    • Albion

    #2
    Re: Generating a clock

    use the soundcard - maybe.
    you didnt say the frequency range you need.
    Last edited by stj; 03-18-2015, 09:55 PM.

    Comment

    • canadaboy25
      What is normal?
      • May 2013
      • 509
      • Canada

      #3
      Re: Generating a clock

      Well as high as I can get basically. I really don't know the exact frequency, thats why it needs to be adjustable.

      How would I be able to use my soundcard?
      canadaboy25

      -Sometimes the light at the end of a tunnel is an on-coming train

      Comment

      • stj
        Great Sage 齊天大聖
        • Dec 2009
        • 30965
        • Albion

        #4
        Re: Generating a clock

        use the headphone/speaker socket to get the signal,
        there are softwarez for generating waves - you can get atleast 40khz from most cards.

        if you use Linux or the Pi there is a soft called spiralsynth

        a quick 1 second play with a search engine gives you:
        https://duckduckgo.com/?q=soundcard+...t-wt&kv=1&kh=1

        Comment

        • canadaboy25
          What is normal?
          • May 2013
          • 509
          • Canada

          #5
          Re: Generating a clock

          Well I'll have a look but my sound card is really, really old.

          The on-board audio on my mobo is fried so I have an old Sound Blaster sb0060 card
          canadaboy25

          -Sometimes the light at the end of a tunnel is an on-coming train

          Comment

          • stj
            Great Sage 齊天大聖
            • Dec 2009
            • 30965
            • Albion

            #6
            Re: Generating a clock

            those are probably better.

            Comment

            • budm
              Badcaps Legend
              • Feb 2010
              • 40746
              • USA

              #7
              Re: Generating a clock

              http://www.radio.imradioha.org/pc_based_test_gear.htm
              Never stop learning
              Basic LCD TV and Monitor troubleshooting guides.
              http://www.badcaps.net/forum/showthr...956#post305956

              Voltage Regulator (LDO) testing:
              http://www.badcaps.net/forum/showthr...999#post300999

              Inverter testing using old CFL:
              http://www.badcaps.net/forum/showthr...er+testing+cfl

              Tear down pictures : Hit the ">" Show Albums and stories" on the left side
              http://s807.photobucket.com/user/budm/library/

              TV Factory reset codes listing:
              http://www.badcaps.net/forum/showthread.php?t=24809

              Comment

              • canadaboy25
                What is normal?
                • May 2013
                • 509
                • Canada

                #8
                Re: Generating a clock

                The max frequency that any software will let me output is 22 KHz.

                Is there any way to write a python program to output higher?
                canadaboy25

                -Sometimes the light at the end of a tunnel is an on-coming train

                Comment

                • eccerr0r
                  Solder Sloth
                  • Nov 2012
                  • 8689
                  • USA

                  #9
                  Re: Generating a clock

                  Usually the highest bandwidth is dependent on your soundcard, as most sound cards are 44.1KHz sample rate the best frequency output is half that, 22.05KHz. This will be a nasty looking triangle wave if it's not filtered properly so you'll have harmonics.

                  There are some higher end sound cards that can go to 96KHz or possibly higher but likely you'll not see that many as that's way past hearing range and nobody would overdesign.

                  Another possibility is to get your pc speaker output and program the 8254 timer to get a higher frequency. I'm not sure how high this will go but it should also get into several KHz, but it will definitely max out well before 1MHz).

                  Again, what kind of frequencies will you need? Likely there are no PC solutions without additional hardware that will get you something past probably 1MHz or so, and that likely is kind of tough as it is.

                  Likely you won't get any other stable clock source from the PC, if you just want random pulses you could just keep on writing 0x55 0xAA to the parallel or serial port but who knows what that "clock" will look like -- tons of jitter.
                  Last edited by eccerr0r; 03-19-2015, 07:12 PM.

                  Comment

                  • canadaboy25
                    What is normal?
                    • May 2013
                    • 509
                    • Canada

                    #10
                    Re: Generating a clock

                    Even 44 khz would be fine. I'm just having trouble finding free software that will do that.
                    canadaboy25

                    -Sometimes the light at the end of a tunnel is an on-coming train

                    Comment

                    • eccerr0r
                      Solder Sloth
                      • Nov 2012
                      • 8689
                      • USA

                      #11
                      Re: Generating a clock

                      As stated, chances are you won't get 44KHz with a rudimentary sound card, so you'll not find software to do that. You'll need a "high end" card to get 44KHz - the limit for most common sound systems is 24KHz.

                      The PC speaker output you probably can get ~ 60KHz or so, maybe more, if you can find a pc speaker driver program that will set the beep frequency that high. The hardware should be able to do it... plus this should be a good squarewave.

                      Comment

                      • stj
                        Great Sage 齊天大聖
                        • Dec 2009
                        • 30965
                        • Albion

                        #12
                        Re: Generating a clock

                        that is a high end soundcard with a dsp on it - the problem may be drivers.
                        from what i see in the linux driver, they sold about 8 identical cards at different prices, the only difference was the pci id in the eeprom.
                        the official driver enabled various options based on the i.d.

                        Comment

                        • eccerr0r
                          Solder Sloth
                          • Nov 2012
                          • 8689
                          • USA

                          #13
                          Re: Generating a clock

                          I just reread the first post, you want a sine wave. How good of a sinewave do you want? You're not getting even a good sine wave with a 44.1KHz/48KHz sound card, at nyquist frequency you're getting a 22.05KHz/24KHz "sine wave" which will most likely will look more like a triangle wave (unless you have a "good" sound card which has a good low pass filter).
                          You'll probably get a better result if you reduced the frequency more, to say 11KHz/12KHz, then at least you'll have 4 samples of a sine wave per cycle.... sounds like this pretty much sucks right? Indeed it does.

                          Scratch what I said about the pc speaker (square) and forget about parallel/serial ports (also digital). Unfortunately you will have to get an external DDS with a faster DAC or just get signal generator. I ended up doing that, but may end up getting or building a DDS for the heck of it. There are many several MHz DDS chips out there, or you can do it in software, but you'll quickly find out software DDS runs out of steam pretty quickly... and you still need a good DAC.

                          I've been thinking about building this DDS at some point

                          http://www.myplace.nu/avr/minidds/index.htm

                          I'm sure there are other designs out there.

                          Comment

                          • R_J
                            Badcaps Legend
                            • Jun 2012
                            • 9535
                            • Canada

                            #14
                            Re: Generating a clock

                            There are premade sinewave generator on ebay starting around $10.00 http://www.ebay.com/bhp/sine-wave-generator
                            or build one using a 555 timer ic and clean up the output to get a sine wave.
                            or this one for $22.00
                            Attached Files

                            Comment

                            Related Topics

                            Collapse

                            • shelby5041
                              clock radio / radio lifespan?
                              by shelby5041
                              hi
                              ive got a modern digital clock radio approx 15yrs old

                              my question is how long can a clock radio or a simple radio last ss farcas operating hours?

                              since elec components have limited hour lifecspan i would imagine the radio or clock radio would eventually fail.

                              the reason i ask is because i have my clock radio on radio function 24/7 for the past 7 years and its still working fine....i leave the radio on ..never turn off past 7years...thats approx 60000 hours

                              it uses very little power just a few watts i would imagine that may have something...
                              09-14-2024, 03:30 AM
                            • TinkerTron
                              Schematic vs. Reality: Where Are the Resistors on My Sharp Clock Radio? Model FY-70CH
                              by TinkerTron
                              Hey everyone,

                              I'm currently working on a mid-70s Sharp Electronic Digital Clock Radio, Model FY-70CH. I found the service manual online, printed it out, and have been studying it for a while. My main reasons for tackling this are: (1) I want to learn electronics and figured I'd start with something I had on hand, and (2) I want to fix its issues. Right now, the radio sounds awful, has about 5V DC at the speaker terminals, and the alarm time setting doesn't work. But I'm not asking how to fix these problems.

                              Instead, here's what's been bugging me so far:
                              The schematic...
                              03-06-2025, 02:03 PM
                            • Fontana
                              71R-H14BW6-T830, clock stops when shutdown
                              by Fontana
                              Hi!
                              Funny problem. I have a board, model 71r-h14bw6-t830, it's a shuttle board used commonly on a lot of cheap laptops/AIOs.
                              The clock (RTC) is not working when the machine is turned off. Doesn't matter if it is connected to dc power or not. When the PC is powered on, the clock works fine.
                              I tried replacing Y6 and Y7 (picture below), but it doesn't seem to be an oscillator problem.
                              I don't have the exact schematic for this board, but I'll provide one that is similar (a variation of the same board).

                              Any suggestions?

                              OBS: when the pc is off,...
                              09-28-2022, 09:57 AM
                            • kjchatman
                              no display on ps4 slim ddc i2c clock shorted
                              by kjchatman
                              i replaced the hdmi port first with no luck then i noticed that it wouldn't do the two beeps for safe mode unless the televison wasn't connected to the console. Turns out that the ddc data bus has an issue. the clock signal is shorted to ground whenever the display is connected. Even if the console isn't plugged into the outlet. i'm not sure why the clock signal goes to ground. i removed the safety zener diode to rule that out as a culprit.
                              12-09-2024, 08:23 PM
                            • jaroslav.psenicka
                              Raspberry PI-TOP v3 schematics
                              by jaroslav.psenicka
                              Hi all,

                              just wonder whether the Raspberry PI-TOP v3 schematic is available?
                              not the Raspberry PI itself, but this little add-on board:



                              thanks,

                              -jp...
                              05-11-2024, 02:58 PM
                            • Loading...
                            • No more items.
                            Working...