Xternal oscillator signal??


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2007
    Posts
    18

    Question Xternal oscillator signal??

    Hi there all,
    My first post so howdy and all greetings. I tried to put this post in general questions (where I feel it belongs) but was blocked for some reason. I am wishing to use the clock signal from an asynchronous 555 circuit as the oscillator for a Pic16f628a. (This way I am hoping to be able to adjust the speed of the Pics output signals by adjusting the input timing signal). I am wondering how to set this up. I set ICProg to code an 'EXTClk' for the Oscillator and inputted my 55 signal to RA7 on the PIC but no joy. Could someone please tell me how I could set this up(or even whether I could set it up at all). Previously I have only ever used XTAL oscillators and never had any difficulty.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Robotica1 View Post
    I set ICProg to code an 'EXTClk' for the Oscillator and inputted my 55 signal to RA7 on the PIC but no joy. Could someone please tell me how I could set this up(or even whether I could set it up at all).
    How are you sure that ICProg is actually setting the config fuses?

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    How do you know your PIC is not working?

    Consider the test code below...
    Code:
    	LED var PortB.0
    	TRISB=%00000000
    loop:
    	Pause 1000
    	Toggle LED
    	Goto Loop
    
    	End
    If your 555 is running at 100kHz it would actually take 40 seconds before the LED lit (with PBP set to a 4MHz default - unless you've told it otherwise). What speed is your 555 running at? Is it running? Have you remembered to tie MCLR to Vdd or otherwise set it to internal?

  4. #4
    Join Date
    Jul 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Default Thanks for feedback.

    I checked my 555 oscillator with a plain LED prior to switching across. As far as setting fuses I assume that when I choose 'EXTClk' as the oscillator fuse setting in ICProg that the correct settings will be applied. Perhaps I just didn't give the PIC time to fire. I will check the frequency of my 555 oscillator and try again. Please just clarify one thing: ?I totally vanish my XTAL setup (ie crystal and caps) and replace with a signal line in to RA7 from whatever oscillator setup I wish to use?

    Here is my test code:
    device = 16f628a
    loop:
    high porta
    pause 33
    low porta
    pause 33
    goto loop

  5. #5
    Join Date
    Jul 2007
    Posts
    18


    Did you find this post helpful? Yes | No

    Red face Patience is a virtue

    Thanks again Melanie.
    Well it seems I've learned something so glaringly obvious I really do feel all gumby and shamed. A clock signal of 5hz will take significantly longer to tick over than one of 4mhz (like somewhere in the vicinity of 3999995 times slower). Long enough to make someone think something isn't clocking!! I can't believe I didn't pick that one up. (Maybe an excuse is coding at 3:00 AM ) Thanks for your help and I'll really try to think things through before asking such silly qu's in the future.

    Cheers

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Robotica1 View Post
    As far as setting fuses I assume that when I choose 'EXTClk' as the oscillator fuse setting in ICProg that the correct settings will be applied. Perhaps I just didn't give the PIC time to fire. I will check the frequency of my 555 oscillator and try again. Please just clarify one thing: ?I totally vanish my XTAL setup (ie crystal and caps) and replace with a signal line in to RA7 from whatever oscillator setup I wish to use?
    Yep, get rid of it all.
    But, a 555 output will only work as an OSC1 input to the '628A if the 555 output swings far enough high and/or low. You might have to put some sort of buffer between the 555 and the PIC.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    OK, I'm now going to kick you where it hurts with my spikey heel just to make you feel doubly bad...

    Your example code...

    Fault 1.

    The 16F628A has ANALOG feature pins on PortA. If you don't switch the ANALOG features OFF first, some of those pins won't work.

    Fault 2.

    Look at the PBP Manual. HIGH and LOW commands only work on an individual PIN and not on an entire PORT!

    Fault 3.

    Oh, and the 'device=' statement probably means you're on the wrong forum... so you defiitely deserve that kick! *smiles*

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Robotica1 View Post
    A clock signal of 5hz will take significantly longer to tick over than one of 4mhz (like somewhere in the vicinity of 3999995 times slower).
    4,000,000 / 5 = 3,999,995 ?
    How about 800,000...

    Robotica - does not compute!

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts