18F26K22 can't use PORTC.0 or 1


Today 18:02
Forum: Proton Plus Compiler v3
Starter: towlerg
Views: 0
Replies: 0
Today 00:44
Forum: Proton Plus Compiler v3
Starter: davroski
Views: 0
Replies: 4
+ Reply to Thread
Results 1 to 7 of 7

Thread: 18F26K22 can't use PORTC.0 or 114 days old

  1. #1
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,293
    Thumbs Up
    Received: 79
    Given: 39
    Total Downloaded
    3.36 GB

    0 Not allowed!

    Default 18F26K22 can't use PORTC.0 or 1

    Hi everybody

    I've been away for quite a while, it's good to be back.

    My favourite device is 18F26K22 but I have never used PORTC.0 and 1 as digital IOs.
    I cannot get a blinky to work on these two pins.

    ANSELC is all zeros, TRIS is set to output. The pin stays at low volts no matter what I try to put on it.

    While
    toggle portc.0
    delayus 10
    wend

    Somebody must have done this, can you share the secret with me please?

    Best regards
    Charlie

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    406
    Thumbs Up
    Received: 43
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: 18F26K22 can't use PORTC.0 or 1

    Hello Charlie,

    Me either.
    B'cause my eyes can't blink at 10us
    Try set
    DelayMS 1000
    Then you have 1sec on and 1sec off time.

    Henk.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,293
    Thumbs Up
    Received: 79
    Given: 39
    Total Downloaded
    3.36 GB

    0 Not allowed!

    Default Re: 18F26K22 can't use PORTC.0 or 1

    Neither can mine that's why I used my scope.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Junior Member Dave Purola's Avatar
    Join Date
    Jul 2004
    Posts
    52
    Thumbs Up
    Received: 14
    Given: 0
    Total Downloaded
    144.28 MB

    0 Not allowed!

    Default Re: 18F26K22 can't use PORTC.0 or 1

    Probably a RMW problem. Try setting the LATC.0 and LATC.1 register.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    406
    Thumbs Up
    Received: 43
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: 18F26K22 can't use PORTC.0 or 1

    Charlie

    If you use the internal OSC did you set;
    Config_Start
    FOSC = INTIO67 ;Internal oscillator block
    ;
    ;
    Config_End

    And set it right by example;
    OSCCON = %01110000 ; 16Mhz internal osc
    OSCTUNE= %00000000 ; %00000000 = 16MHz

    And;
    Xtal 16 ; in this example

    Retrieved from my working 18F26K22

    Or did you use external Xtal??

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,293
    Thumbs Up
    Received: 79
    Given: 39
    Total Downloaded
    3.36 GB

    0 Not allowed!

    Default Re: 18F26K22 can't use PORTC.0 or 1

    Dave: Yes, tried LATC.0 and LATC.1, no difference, no blinky.

    Hank: Yes, everything else works perfectly:

    OSCCON = 110000 ;16MHz internal oscillator block
    Nop
    OSCCON2 = 001100
    Nop
    Set OSCTUNE.6 ;enable PLL so clock now 64MHz
    Clear


    Henk: I just notiiced that I have OSCCON bit 3 set, which is the secondary oscillator. This might be it! I'll back to you in a bit......

    ANSELA = 000000
    ANSELB = 000000 ;beware - pic starts life with all analogue channels set to analogue
    ANSELC = 000000


    TRISA = 000000 ;
    TRISB = 000011 ;the keyboard generates interrupts on port B0, its data is on B1
    TRISC = 000000
    Last edited by charliecoultas; 4th August 2019 at 14:30.

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,293
    Thumbs Up
    Received: 79
    Given: 39
    Total Downloaded
    3.36 GB

    0 Not allowed!

    Default Re: 18F26K22 can't use PORTC.0 or 1

    SORTED! Thanks Henk, it was because the secondary oscillator was enabled.
    I had bit 3 of OSCCON2 set, which ties up PORTC.0 and 1.

    Charlie
    Last edited by charliecoultas; 4th August 2019 at 14:40.

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. 18f26k22
    By Gerard in forum Oscillator Modules
    Replies: 2
    Last Post: 25th November 2013, 11:06
  2. 18F2550 PORTC.4 & PORTC.5 as digital input
    By basparky in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 12th September 2011, 09:38
  3. HIGH PORTC vs. PORTC=255
    By RemonDePemon in forum The Lounge
    Replies: 6
    Last Post: 26th September 2010, 23:32
  4. RSOUT_PIN on PORTC.5 disables PORTC.4
    By pozzari in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 30th December 2006, 23:58
  5. 18F4550 and PORTC
    By knight in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 3rd February 2006, 09:49

Members who have read this thread : 78

Actions :  (Set Date)

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