RA6 & RA7 I/O setting on the 16F88


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Thumbs up

    Quote Originally Posted by peterdeco1 View Post
    Sorry if I wasn't clear. It works for me without a modified inc file. And the LED's connect from the port pins to ground. Now come on. You knew that didn't you Skimask?
    Yep, just quietly pointing out a few 'options'!

  2. #2
    Join Date
    Mar 2006
    Posts
    41


    Did you find this post helpful? Yes | No

    Smile Config bits

    If using MPASM use this!!! Use both config!!!

    ; To use the Configuration Bits, place the following lines in your source code
    ; in the following format, and change the configuration value to the desired
    ; setting (such as CP_OFF to CP_ALL). These are currently commented out here
    ; and each __CONFIG line should have the preceding semicolon removed when
    ; pasted into your source code.

    ;Program Configuration Register 1
    ; __CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC

    ;Program Configuration Register 2
    ; __CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF

  3. #3
    Join Date
    Mar 2006
    Posts
    41


    Did you find this post helpful? Yes | No

    Smile Config bits

    ;************************************************* ***************
    ;* 16F88.INC *
    ;* *
    ;* By : Leonard Zerman, Jeff Schmoyer *
    ;* Notice : Copyright (c) 2004 microEngineering Labs, Inc. *
    ;* All Rights Reserved *
    ;* Date : 01/07/04 *
    ;* Version : 2.45 *
    ;* Notes : *
    ;************************************************* ***************
    don't forget to comment out the following in the 16F88.INC file


    NOLIST
    ifdef PM_USED
    LIST
    include 'M16F88.INC' ; PM header
    ; device pic16F88, hs_osc, wdt_on, lvp_off, protect_off
    XALL
    NOLIST
    else
    LIST
    LIST p = 16F88, r = dec, w = -302
    INCLUDE "P16F88.INC" ; MPASM Header
    ; __config _CONFIG1, _HS_OSC & _WDT_ON & _LVP_OFF & _CP_OFF
    NOLIST
    endif
    LIST

  4. #4
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Smile

    Thanks guys,

    Just returned from my vacation!

    >leisryan: I tried your suggestion but I get two warnings compiling and the PIC hangs if I program it despite the warnings.

    Is there no possible way to set the CONFIG1 (FOSC) bit 4, 1 and 0 to (%1XX00) in the code without disturbing other settings?

    Thank you!

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PICante View Post
    Is there no possible way to set the CONFIG1 (FOSC) bit 4, 1 and 0 to (%1XX00) in the code without disturbing other settings?
    You're asking the exact same question as in the original post and you have been given the answers you need to figure out how to do what you want to do.
    Just as described in the link in post #19. It will cure almost 99.99999999999999999999% of your (and anybody else's) CONFIG fuse woes...if you read and comprehend the text of the post.

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


    Did you find this post helpful? Yes | No

    Default

    Hi PICante,
    Lots of speculation going on here, please give this a try:
    Code:
    @ __config _CONFIG1,_INTRC_IO
    OSCCON =126 ' or 1111110 or $7E for 8mhz, 1101110 for 4mhz, 1011110 for 2 mhz . . .
    page 40 of the data sheet I am looking at, sect. 4.6.3
    Osccon bits 6:4 set osc speed, bit 3 when set makes primary clock, bit 2 set= stable, not set= not stable, bit 1:0 set as 10 = internal R/C as system clock<br>
    edit: 1111110 = 126 not 62
    Last edited by Archangel; - 13th August 2008 at 00:01.
    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.

  7. #7
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Default

    Thanks skimask, I have read through what you suggested and all the links and I am sorry to say it did not get me anywhere. I tried a few things without really knowing what I was doing and none of it worked. Most of it was about the PIC18F family which is (in my view) much more advanced compared to the 16F88 which I am trying to figure out. I mean I have to learn to crawl before I can run. Reading stuff that reefer to things way beyond where my knowledge are at this point just messes up my head. I understand that looking from your level of knowledge this might look ridiculous.

    Joe S. > Thank you, I will try it this evening and let you know.

Similar Threads

  1. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  2. Setting I/O ports on 16f629
    By Optech in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2008, 21:51
  3. 16F88 RA6 and RA7 troubles
    By gandora in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 3rd August 2007, 02:57
  4. 16F88 - CCPMX strange fuse setting for HWPM
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th April 2007, 22:33
  5. Making RA6 (OSC2) an output on a 18F2525
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th September 2006, 17:51

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