DEFINE OSC too limited


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    breogan's Avatar
    breogan Guest


    Did you find this post helpful? Yes | No

    Default Problems with OSC.

    Hi,
    I'm trying to use 20MHz oscillator with PIC16C74A, for example, I have written this program to make blink a led for 1 second, but it doesn't work, the frequency is not 1Hz (it is more slow):

    '********** Definitions **********
    DEFINE OSC 20

    '********** Main prog **********
    Main:
    high PORTA.0
    pause 500
    low PORTA.0
    pause 500
    goto Main

    End

    '***************************************

    I'm using the David Tait programmer (home made) with the PIC74.EXE program (PIC16C74 Programmer Version 1.0b Copyright (C) 1996 Paul Vollebregt.) With the options "-hp8" (HS osc), also I have triyed with "-xp8" (XT osc).

    Thanks !
    Last edited by breogan; - 21st November 2005 at 11:06.

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


    Did you find this post helpful? Yes | No

    Default

    Of course it'll be slower...

    Lets assume that Pause 500 is a perfect 500mS (which is unlikely but probably close). Your HIGH and your LOW and your GOTO all take up time too which has to be taken into account. Finally, how accurate is your Oscillator? 20.00000MHz or is it a few percent high or low?

    You want exactly 1Hz... go grab an oscillocope and trim it... now you have control in 1uS steps... but you add any other code or you nudge your room thermostat a little, and bang goes your timing!

    Main:
    high PORTA.0
    pause 499
    pauseus 1000
    low PORTA.0
    pause 499
    pauseus 1000
    goto Main

  3. #3
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Question

    Is there some way to nudge the "DEFINE" value that PBP uses when compiling?

  4. #4
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    Good answer Melanie, I agree 100% with what you say. Purists tend to focus too much on one parameter, not realizing that in the big picture, there are lots of things that affect your reading, like temperature! In engineering we typically ignore the bottom 10% and the top 90% and concentrate efforts in between, meaning we don't sweat the small stuff unless it is ABSOLUTELY necessary. A LED that doesn't blink at exactly 1.0000Hz? Who cares, unless your using to to time Longines watches.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    Quote Originally Posted by queenidog View Post
    Good answer Melanie, I agree 100% with what you say. Purists tend to focus too much on one parameter, not realizing that in the big picture, there are lots of things that affect your reading, like temperature! In engineering we typically ignore the bottom 10% and the top 90% and concentrate efforts in between, meaning we don't sweat the small stuff unless it is ABSOLUTELY necessary. A LED that doesn't blink at exactly 1.0000Hz? Who cares, unless your using to to time Longines watches.
    ... I do not know if Mel will even see your post ...

    did you notice it is a 10 years after dig out ( tadaaa, music ON ) ... add to that Mel has left this forum many years ago ... ( 2 or more ...)

    Last Activity:- 22nd February 2012 01:20
    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    Yes I saw the date, but felt compelled to answer anyway, unaware of her status on this forum.

    I had a friend who was doing some non-critical A/D conversions but was unsatisfied with the 10 bit (1:1024) resolution of his PIC and was going to employ an external A/D for the extra bits. I reminded him of the resolution and accuracy of his own DVM which was really no better. That and the fact that 10 bits over 5 volts is a resolution of about 5 mV.

    Sometimes the forest can't be seen for the trees.

  7. #7
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    Does anyone know why Melanie left the forum?
    She was a prolific poster and helped many along the way and then suddenly, nothing more.
    I have always been curious about her departure.

    I wonder if she is aware of the sad news about Darrel Taylor?

    Cheers
    Barry
    VK2XBP

  8. #8
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    Yeah I was thinking about that myself... we kind of almost get to know each other in an anonymous sort of way.

    I would be nice to hear how/what she is doing now days.
    I'm sure there are others who have left after making a real positive impact on the learning experience of microcontroller programming.

    Really a great bunch here... I wish the Basic Language would experience a sort of comeback or revival!!
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  9. #9
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    I was going to point that out, but then thought why bother.. lol.
    I have wondered the same and just assume people move on, same as I thought with Darrel for some time actually.

    It is true that the imagination can move around some limiting facts. That is a positive and true message!

  10. #10
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    Quote Originally Posted by Heckler View Post
    ... I wish the Basic Language would experience a sort of comeback or revival!!
    Won't ever happen (outside of the hobby/education market) due to its many limitations/shortcomings.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    Quote Originally Posted by Aussie Barry View Post
    Does anyone know why Melanie left the forum?
    She was a prolific poster and helped many along the way and then suddenly, nothing more.
    I have always been curious about her departure.

    I wonder if she is aware of the sad news about Darrel Taylor?

    Cheers
    Barry
    VK2XBP
    Hi, Barry

    Mel left the forum for professionnal reasons, as she was to travel a lot with her new function.
    as she wrote me she was to spend much much time flying around the world.

    Moreover she has a new Hobby : flying light aircrafts ...

    I did not have any news from her for at least two years ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  12. #12
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DEFINE OSC too limited

    Hi Alain,

    Thank you for the quick reply.
    If you still have her contact details, perhaps you could let her know about Darrel.

    Cheers
    Barry
    VK2XBP

Similar Threads

  1. RF Modules
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 44
    Last Post: - 26th June 2010, 17:42
  2. PIC16F877A analog problem
    By DeViLa_Q8 in forum mel PIC BASIC
    Replies: 0
    Last Post: - 30th July 2009, 20:19
  3. RX TX modules - intermitent communication
    By ruijc in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 11th June 2009, 00:13
  4. PIC HSERIN problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 20th July 2008, 11:08
  5. Replies: 8
    Last Post: - 17th September 2006, 17:46

Members who have read this thread : 0

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