RA6 & RA7 I/O setting on the 16F88


Closed Thread
Results 1 to 36 of 36

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    If you ser the fuses in code space then comment the two lines. Otherwise do like you are in the inc file.

    Personally I like to set up in the inc.

    Does it work at all now?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Question

    I commented out the two lines in the inc file and added the ” @__config _CONFIG1,_INTRC_IO& _WDT_ON & _LVP_OFF & _CP_OFF” to the code right below the “@__config_INTRC_IO” line but it refuses to compile! I get “[235] opcode expected instead of ‘_hs_osc’” error! ?

    If I remove the line it compiles and everything except RA6 & RA7 I/O run perfect as before.

    I am confused to say the least!

    Thanks for the support!

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PICante View Post
    I commented out the two lines in the inc file and added the ” @__config _CONFIG1,_INTRC_IO& _WDT_ON & _LVP_OFF & _CP_OFF” to the code right below the “@__config_INTRC_IO” line but it refuses to compile! I get “[235] opcode expected instead of ‘_hs_osc’” error! ?
    If I remove the line it compiles and everything except RA6 & RA7 I/O run perfect as before.
    I am confused to say the least!
    Thanks for the support!
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Have you tried this thread yet? And I do mean the whole thing, not just the first and/or last post, but everything in between, everything linked, and then try everything in there to get a feel for how everything works?
    Not that you'll ever need to use everything in there, but down the road, something in this thread might come up and you'll have that knowledge in the back of your head ready to go...and it'll save you loads of time...then...
    Last edited by skimask; - 10th July 2008 at 19:06.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I have an idea. Copy this code exactly and tell us if RA6 and RA7 ports flash an LED. Put about 100 ohms on 1 side of the LED. I just tried it with a 16F88 and it works for me.

    OSCCON = $60 'set int osc to 4mhz
    ANSEL = 0 'ALL DIGITAL
    CMCON = 7 'COMPARATORS OFF

    TRISA = %00000000 'ALL OUTPUTS
    TRISB = %00000000 'ALL OUTPUTS
    PORTA = 0 'PORTA LOW

    @ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON
    Pause 100 'SETTLE DOWN

    START:
    High PORTA.6 'ON LED
    High PORTA.7
    Pause 1000
    Low PORTA.6 'OFF LED
    Low PORTA.7
    Pause 1000
    GoTo START 'REPEAT FOREVER

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by peterdeco1 View Post
    I have an idea. Copy this code exactly and tell us if RA6 and RA7 ports flash an LED. Put about 100 ohms on 1 side of the LED. I just tried it with a 16F88 and it works for me.
    One question is left unanswered though...is this with or without a modified 16f88.INC file?
    And I'm not sure if an LED will flash with +5v on both sides and ground on both sides

  6. #6


    Did you find this post helpful? Yes | No

    Default

    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?

  7. #7
    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'!

  8. #8
    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

Similar Threads

  1. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 15:01
  2. Setting I/O ports on 16f629
    By Optech in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2008, 22:51
  3. 16F88 RA6 and RA7 troubles
    By gandora in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 3rd August 2007, 03:57
  4. 16F88 - CCPMX strange fuse setting for HWPM
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th April 2007, 23: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, 18: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