RA6 & RA7 I/O setting on the 16F88


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Hi Everyone. I've only used the 'F88 once. I didn't have any problem with this header file:

    OSCCON = $60 'set int osc to 4mhz
    ANSEL = 0 'ALL INPUTS DIGITAL
    ADCON0 = 0 'AD MODULE OFF
    CMCON = 7 'COMPARATORS OFF
    TRISA = %SELECT YOUR I/O'S
    TRISB = %SELECT YOUR I/O'S
    @ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peterdeco1 View Post
    @ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON
    Now I get it...I think.

    INTRC_OSC works when using PM as an assembler.

    _INTRC_IO works with MPASM.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Smile

    Hi guys, thanks for the responce!

    I have been doing a few projects based on the 16F88 and they all have turned out a success until this time, the first time I needed RA6 & RA7 as I/O’s.

    I use MPASAM and the first part of my code looks like this:

    define OSC 8

    OSCCON =%01110000

    @__config_INTRC_IO ‘ added today, compiled OK but no I/O on RA6 or RA7

    TRISB = %00000000

    TRISA = %11001100

    ANSEL = %00000000

    CMCON = 7



    All the other ports works just fine so.....


    Thanks for being here!

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    At least it compiles

    Try what skimask suggested
    INTRC_CLKOUT
    Or compile with PM and use
    @ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON

    One of them has to work.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    This chip as 2 ADCON registers too
    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
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Default

    I tried the “INTRC_CLKOUT” with MPASM it compiled well but still no I/O!
    I use the 16F88.inc file as is, not edited.

    There must be something I miss here; “INTRC_CLKOUT” does not make sense to me (no offence)! The “INTRC_IO” statement seems more logic to me, of curse I might be of the tracks here but that’s how I see it.

    Referring to the 16F88 datasheet page 130 way down;

    Bit 4, 1-0 FOSC<2:0>: Oscillator Selection bits.

    I believe what I need is the fourth alternative:

    “100 = INTRC oscillator; port I/O function on both RA6/OSC2/CLKO pin and RA7/OSC1/CLKI pin”.

    Or… am I loosing it? (apart from my hair!)



    Thanks guys!

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PICante View Post
    I tried the “INTRC_CLKOUT” with MPASM it compiled well but still no I/O!
    I use the 16F88.inc file as is, not edited.
    Have you commented out the shebang line in the inc?
    http://www.picbasic.co.uk/forum/show...75&postcount=5
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Smile

    This is the last part of my untouched inc file:

    Code:
     ;==========================================================================
    ;
    ;       Configuration Bits
    ;
    ;==========================================================================
    
    _CONFIG1                     EQU     H'2007'
    _CONFIG2                     EQU     H'2008'
    
    
    ;Configuration Byte 1 Options
    _CP_ALL                      EQU     H'1FFF'
    _CP_OFF	                     EQU     H'3FFF'
    _CCP1_RB0		     EQU     H'3FFF'
    _CCP1_RB3                    EQU     H'2FFF'
    _DEBUG_OFF                   EQU     H'3FFF'
    _DEBUG_ON                    EQU     H'37FF'
    _WRT_PROTECT_OFF             EQU     H'3FFF'	;No program memory write protection
    _WRT_PROTECT_256             EQU     H'3DFF'	;First 256 program memory protected
    _WRT_PROTECT_2048            EQU     H'3BFF'	;First 2048 program memory protected
    _WRT_PROTECT_ALL             EQU     H'39FF'	;All of program memory protected
    _CPD_ON                      EQU     H'3EFF'
    _CPD_OFF                     EQU     H'3FFF'
    _LVP_ON                      EQU     H'3FFF'
    _LVP_OFF                     EQU     H'3F7F'
    _BODEN_ON                    EQU     H'3FFF'
    _BODEN_OFF                   EQU     H'3FBF'
    _MCLR_ON		     EQU     H'3FFF'
    _MCLR_OFF                    EQU     H'3FDF'
    _PWRTE_OFF                   EQU     H'3FFF'
    _PWRTE_ON                    EQU     H'3FF7'
    _WDT_ON                      EQU     H'3FFF'
    _WDT_OFF                     EQU     H'3FFB'
    _EXTRC_CLKOUT		     EQU     H'3FFF'
    _EXTRC_IO		     EQU     H'3FFE'
    _INTRC_CLKOUT                EQU     H'3FFD'
    _INTRC_IO		     EQU     H'3FFC'
    _EXTCLK			     EQU     H'3FEF'
    _HS_OSC                      EQU     H'3FEE'
    _XT_OSC                      EQU     H'3FED'
    _LP_OSC                      EQU     H'3FEC'
    
    
    ;Configuration Byte 2 Options
    _IESO_ON                     EQU     H'3FFF'
    _IESO_OFF                    EQU     H'3FFD'
    _FCMEN_ON                    EQU     H'3FFF'
    _FCMEN_OFF                   EQU     H'3FFE'
    
    
    
    ; 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
    
    
    
            LIST

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