4mhz to 8 mhz


Closed Thread
Results 1 to 7 of 7

Thread: 4mhz to 8 mhz

  1. #1
    Join Date
    Oct 2007
    Posts
    21

    Default 4mhz to 8 mhz

    When I change the microcontroller clock from 4mhz to 8 mhz I put the following code in the beginning of the program

    DEFINE OSC 8 'Set oscillator speed to 8

    Now I also have to change the values of PULSOUT to be 2 times higher
    By 4mhz = PULSOUT 100 by 8mhz = PULSOUT 200

    Would I also have to change the values of PULSIN by times 2
    by 4mhz = PULSIN 2 by 8mhz =PULSIN 4 ( I KNOW THATS NOT THE COMPLETE SYNTAX)

    Also , what effect would the oscillator change have on serially controllling an LCD screen.
    Any other changes to the program that would result by switching to a higher speed?

    would PAUSE also be affected?

  2. #2


    Did you find this post helpful? Yes | No

    Talking oscillator ext = DEFINED OSC

    If you put your oscillator of 4 and put DEFINED OSC 4 or put an oscillator, 8 and put DEFINED OSC 8 nothing happens A pause 100 will be the same in both cases.
    You must match the external oscillator with the definition put that in the compiler.
    You can not put an external oscillator of 4 and set in compiler one of 8 that does not work well.

  3. #3
    Join Date
    Oct 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default What about PULSIN / PULSOUT

    What about PULSIN and PULSOUT

    would their resolution be doubled?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Forkosh View Post
    What about PULSIN and PULSOUT

    would their resolution be doubled?
    EDIT: Disregard...wrong post...
    Last edited by skimask; - 17th December 2007 at 19:59.

  5. #5
    Join Date
    Oct 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Only in versions 7.61 and up. The manual has a good list.
    I have PICBASIC pro version 2.47 . version 7?

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Forkosh View Post
    I have PICBASIC pro version 2.47 . version 7?
    The manual talks all about how PAUSE, PAUSEUS, PULSIN, PULSOUT, SERIN/SEROUT (software based UART type commands), and various other commands are affected by changes in actual oscillator speed and the DEFINE'd oscillator speed. (i.e. faster oscillator, faster this, slower oscillator, slower that).

    PBP compensates for different DEFINE'd speeds (i.e. SEROUT using 2400 baud will be 2400 baud if you DEFINE OSC 4 or DEFINE OSC 40), but can't do anything about what you put into the OSC1/OSC2 pins or what, if anything, you end up selecting for the actual oscillator frequency, either internal or external types.
    Last edited by skimask; - 17th December 2007 at 20:09.

  7. #7
    Join Date
    Oct 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Smile thx

    Thanks skimask!

Similar Threads

  1. TSA5512/5511 code for PIC16F877/84
    By Marin in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th August 2013, 06:16
  2. Setting up a 12F683 to run at 20 Mhz
    By johnnylynx in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 3rd March 2009, 02:46
  3. saving RCREG to word
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2008, 13:51
  4. Replies: 9
    Last Post: - 31st July 2008, 08:56
  5. SEROUT on 16F876A @ 3.2768 MHz 4MHz Defined
    By brodin in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th November 2003, 01:25

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