16F88 RA6 and RA7 troubles


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2007
    Posts
    26

    Exclamation 16F88 RA6 and RA7 troubles

    I have been working with the 16F88 for sometime now, and despite that fact have yet to be able to configure and use the osc1 and osc2 pins as i/o porta.6 and porta.7.

    I know that this is an accessable feature of the 16f88 by configuring the FOSC2:FOSC0 bits to 7 (%110). So far I have not been able to figure it out even after over half a year, and I have searched everywhere online to no avail.

    Please if anyone has any information that could help me, and the many others I have found that don't have the answer either. I know the feature may be special to the 16f88 but we should still be able to access it.

    Many thanks to anyone who can give any input.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gandora View Post
    I have been working with the 16F88 for sometime now, and despite that fact have yet to be able to configure and use the osc1 and osc2 pins as i/o porta.6 and porta.7.

    I know that this is an accessable feature of the 16f88 by configuring the FOSC2:FOSC0 bits to 7 (%110). So far I have not been able to figure it out even after over half a year, and I have searched everywhere online to no avail.

    Please if anyone has any information that could help me, and the many others I have found that don't have the answer either. I know the feature may be special to the 16f88 but we should still be able to access it.

    Many thanks to anyone who can give any input.
    %110 = 6
    %111 = 7
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    A quick look would suggest you could add

    ANSEL = 0

    to the code in post #4 here and be up and running. (You would still need to set TRISA accordingly for those pins)

    http://www.picbasic.co.uk/forum/show...ighlight=16f88

    UPDATE: In fact, the ANSEL=0 would not be needed because RA6 and RA7 are never analog - should work as posted in #4
    Last edited by paul borgmeier; - 27th July 2007 at 06:42. Reason: UPDATE
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

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


    Did you find this post helpful? Yes | No

    Default

    Melanie gets her whip out and locks Paul and Joe in a room for 'retraining'.

    RA6/OSC1 and RA7/OSC2 only comes alive when you use the 16F88 in it's Internal Oscillator mode... and that is a feature of the CONFIGURATION BITS of the PIC...

    So (assuming you're using the default MeLabs PM Assembler)...

    1. At the top of your program, along with your PIC device statements you need...

    @ DEVICE INTRC_OSC_NOCLKOUT

    or

    @ DEVICE pic16F88, INTRC_OSC_NOCLKOUT

    I refer you to...

    (a) the PICs Datasheet Section 15 Special Features of the CPU, Register Table 15-1 CONFIG1 Configuration Word.

    Also (b) http://www.picbasic.co.uk/forum/showthread.php?t=543

    Only then you will be able to use RA6 and RA7.

    2. However the game hasn't finished...

    This PIC has multiple Oscillator selection (see datasheet Section 4 Oscillator Configuration)... one of the very first lines of your program must set the OSCCON Register (see Datasheet Register Table 4-2 OSCCON) for the speed you want this PIC to run... (because the Power-On default is 31.25kHz) example...

    OSCCON=%01100000 ' Set PIC to 4MHz

    There's other things you can do too, but I won't go into that at this time...

    It's all in the Datasheet... crate of beer helps...

    Oooh... and make sure your PBP is up to date... something in the back of my mind is nagging me about early versions having a problem with the 16F88... go to the MeLabs website and check in the Versions list when the fix occurred...

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Whips and Beer !

    Woooo Hoooo, Promises, promises, promises ! Now I can't remember what PIC means . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    May 2006
    Location
    MI
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Ohhh, lock me and whip me too please.

    On a more serious note, I recall reading somewhere
    (with certain programmers) there was a problem with
    erasing the F88 with internal osc configured. Keep this
    in mind if your have trouble reprogramming. Hopefully
    this won't apply to you.

  7. #7
    Join Date
    May 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default Problems

    My programmer programs no problem, but it still just doesn't work.

    I know exactly what I need to do after reading the whole darned datasheet again (without any bear ;_, but using the setting in pbp is not working.

    I need to change the osccon to %1111100 (most important are that the last two are %00 this makes the pic use the fosc2:fosc0 registry determine the osc setup.

    the fosc2:fosc0 is bit 4 1-0 (i am not 100 percent clear on what that means if u have any insight) of the configuration word 1 register whose main address is 2007h.

    According to the legend for Configuration word 1 to achieve INTRC (INTERNAL OSC) with i/o on RA6 and RA7 the Fosc2:fosc0 registers need to be changed to %100.


    I have tried the _INTRC_OSC_NOCLKOUT, and it did not work, I had the same result.

    Now i'll try to break it down a little more.

    As a note actually putting the heading 0 on the osccon registry causes the pic to fail to work stabily. It is for now my belief that pbp puts the header there for you.

    osccon %111 (first three bits set osc frequincy)
    %1(makes us primary only on osc) %1(frequincy is stable ^^)

    And with the last two you have some options:

    %00 OSC is defined by FOSC<2>
    %01 T1OSC used as clock
    %10 INTRC FOR SYSTEM CLOCK
    %11 Reserved (I have no clue what that means, but I figure I shouldn't try it ^^)


    -------------------------------------------------------------------------

    So what I am trying looks something like this.
    Code:
    _pic16f88
    _INTRC_OSC_NOCLKOUT 'hopefully this modifies the configuration word 1 but it doesn't seem to.
    
    OSCCON=%1111100 'sets the osccon register
    
    CMCOM=7  'turns comparators off.
    ANSEL=%00000000 'porta all digital.
    
    main:
    HIGH porta.6
    HIGH porta.7
    
    GOTO main:
    
    END

    Any help would be much appreciated and thankyou very much.

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Smile

    I sense more Whipping in the near future ...

    _pic16f88
    _INTRC_OSC_NOCLKOUT 'hopefully this modifies the configuration word 1 but it doesn't seem to.
    Or, you could opt for the Painless version ...

    Presetting Configuration Fuses (PIC Defines) into your Program
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    <br>
    DT

  9. #9
    Join Date
    May 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Smile Zutale! A solution!

    *jumps up and down for joy* I... I have done it!


    And now I will explain how. First of all many thanks to everyone for the help!

    First I will mention that I am using MicroPro and the 149c DIY programmer.

    After explorer fuses a bit, I found that through micropro I could tell what the fuses were set to, and so. I was able to change the fuse to INTRC_IO on the programmer. And I did not have to make any device calls in pbp at all.

    With this osilator set to INTRC_IO it just worked.

    It may be worth mentioning that the pbp default seems to be HS.

    Anyways thankyou all again!

Similar Threads

  1. RA6 & RA7 I/O setting on the 16F88
    By PICante in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 23rd August 2008, 19:32
  2. External osc defines
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 17th February 2008, 14:56
  3. 16F913 RA7 Pin control problem
    By Wayne in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th February 2007, 01:53
  4. 16f88 help
    By ccsparky in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd July 2004, 17:50

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