+ Reply to Thread
Results 1 to 3 of 3

Thread: pic 18f25k22 new pic to play with

  1. #1
    Licensed User peterc's Avatar
    Join Date
    Mar 2011
    Location
    lancashire
    Posts
    5

    Lightbulb pic 18f25k22 new pic to play with

    Hi all and a happy new year


    I have always used external xtal's with my projects but would like to make a very simple tacho for my lathe and would like to keep the component count to the minimum! but can anyone help with coding for setting this pic up using its internal Osc?

    Hi, its great to see you visiting our forum. Why not try Proton Compiler for FREE?

    Download the FREE version of Proton Compiler, Its called Amicus18 and its available from HERE

    Already using proton Compiler??? Get rid of these pesky messages... get LICENSED USER STATUS





    Thanks for any guidance you can spare

    Peter


  2. If you're a Licensed user of PROTON DEVELOPMENT SUITE, apply for Licensed User Status to remove these pesky messages
     and get access to additional forum areas, Beta test downloads and more!

  3. #2
    Licensed User hadv215's Avatar
    Join Date
    Sep 2009
    Location
    Amstelveen, The Netherlands
    Posts
    171


    Default Re: pic 18f25k22 new pic to play with

    Hi Peter,
    I did this for a 18F26K22, but they're in the same datasheet so it should be OK!

    Config_Start
    ieso = off
    fosc = intio67
    Config_End
    (Of course there's more here, but I just show the oscillator stuff)

    ; oscillator control
    Symbol IRCF2 OSCCON.6
    Symbol IRCF1 OSCCON.5
    Symbol IRCF0 OSCCON.4
    ; 16MHz
    IRCF2 = 1
    IRCF1 = 1
    IRCF0 = 1
    ; osctune = 0

    Note that bits 0 and 1 of OSCCON are 0 by default so the osc directive from the Config is used.
    It's all in the datasheet (Register 2.1 and ) but, as often, you'll have to know where have to start looking and how to 'read' it.
    Please take a look at Register 2.3...you can even use the PLL with INTOSC (but only if it's running at 8 or 16 MHz) so you can have 32 MHz or even a massive 64 MHz.
    Look at Chapter 24>Register 24.1 for the various choices for the oscillator (note that you'll have to use the description MPASM understands...it's not always obvious so take a look at the the file MPASM Suite\P18F25K22.inc).

    As you may know you can use osctune to tune your specific oscillator. I found I did not have to do that with mine, but you're never sure...

    Greetz,
    Harm

  4. #3
    Licensed User peterc's Avatar
    Join Date
    Mar 2011
    Location
    lancashire
    Posts
    5


    Default Re: pic 18f25k22 new pic to play with

    Hi Harm

    Thanks for the code I will give a go tomorrow on the breadboard

    Peter

+ Reply to Thread

Similar Threads

  1. 18F25K22 and Pickit2
    By RGV250 in forum The Lounge
    Replies: 2
    Last Post: 30th July 2011, 23:11
  2. 18F25K22 bootloader
    By moonshadow in forum Proton Plus Compiler v3
    Replies: 16
    Last Post: 27th February 2011, 14:56
  3. DAC on the 18F25K22, how to use it with Proton
    By PhilJ1 in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 13th October 2010, 21:55
  4. Play Station Controller
    By the.fox in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 5th July 2006, 21:07
  5. Pic Voice Record/Play to HD DEMO
    By normnet in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 5th December 2005, 09:55

Members who have read this thread since 2nd May 2012, 19:38 : 1

Actions :  (Set Date)  (Clear Date)

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