Newbie here


Closed Thread
Results 1 to 3 of 3

Thread: Newbie here

  1. #1
    Join Date
    Aug 2006
    Location
    Arizona
    Posts
    5

    Smile Newbie here

    Hi, I just got my PicBasic compiler last week, with an Epic programmer, so I'm pretty much brand new to this. I've been reading the posts on here and learning some good stuff. Anyways, I'm trying to figure out how to write to just a particular bit in a register. I'm using a 16F818 which has an internal osc. I' m trying to set the clock speed, so I used:

    Write $8FE,%00010000

    I only want to change bits 4, 5, and 6. The datasheet says that bit 2 is IOFS. I don't know what that is, or what the default setting is, so I'm trying to just change the bits that I want to and leave bit 2 at default. The others besides 2, 4, 5, and 6 are unused.

    Thanks in advance for any help.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    PicBasic or PICBASIC Pro?

    I guess you talk about OSCCON register @8F.. right?

    you can't write to bit IOFS.. well you can but it will never do something.. it's a read-only bit. This bit tell you when the internal OSC frequency is stable.. not much

    Let's say you want to set frequency to 8MHZ

    PBP:
    OSCCON=%01110000
    OR if you want...
    OSCCON.6=1
    OSCCON.5=1
    OSCCON.4=1

    PicBasic... i can be wrong...
    POKE $8F,%01110000

    HTH
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Aug 2006
    Location
    Arizona
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    PicBasic
    I think I tried that second example, and it wouldn't compile. But I'll try it again. Maybe I typed something wrong.
    I did type it wrong, I tried your example and it compiled ok. I was typing in an h after the F.
    Thanks.
    Last edited by FastEddie; - 14th August 2006 at 00:12.

Similar Threads

  1. Newbie making an ignition timer
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 5th August 2012, 17:45
  2. Newbie HELP :(
    By TheOne in forum mel PIC BASIC
    Replies: 3
    Last Post: - 27th March 2009, 17:15
  3. Newbie: Temperature measurements
    By Budda in forum General
    Replies: 10
    Last Post: - 30th March 2007, 09:56
  4. PIC Newbie
    By azmax100 in forum Schematics
    Replies: 7
    Last Post: - 23rd February 2007, 04:52
  5. request for a newbie forum
    By nimonia in forum Forum Requests
    Replies: 1
    Last Post: - 20th May 2006, 09:01

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