18F14K50, PORT C as outputs


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,605


    Did you find this post helpful? Yes | No

    Default Re: 18F14K50, PORT C as outputs

    Hi,
    I've been looking thru the datasheet to figure out what might be going on but I honestly can't find it.
    So, I'm going to sugest that you might have a hardware issue, is this on a breadboard by any chance? Faulty contacts?

    Going thru the datasheet I also noted the follwing regarding setting all those registers to 0 in your code:

    REFCON0=0 (pg.247)
    Defaults to 16 at POR which means that the FVR is set to 1.024V but disabled, setting it to 0 shouldn't be needed.
    Instead, it specifically says not to use the value 0....

    REFCON1=0 (pg.248)
    Defaults to 0 at POR, DAC disabled, setting it to 0 shouldn't be needed.

    ADCON1=0 (pg.216)
    Defaults to 0 at POR, setting it to 0 shouldn't be needed.

    ADCON2=0 (pg.217)
    Defaults to 0 at POR, setting it to 0 shouldn't be needed.

    ANSEL = 0 (pg.98)
    Defaults to 248 at POR, setting it to 0 IS needed to enable the digital input buffers.

    ANSELH = 0 (pg.99)
    Defaults to 15 at POR, setting it to 0 IS needed to enable the digital input buffers.

    CM1CON0=0 (pg.229)
    Defaults to 0 at POR, comparator is disabled, setting it to 0 shouldn't be needed.

    CM2CON0=0 (pg.230)
    Defaults to 0 at POR, comparator is disabled, setting it to 0 shouldn't be needed.

    SRCON0=0 (pg.242)
    Defaults to 0 at POR, SR latch is disabled, setting it to 0 shouldn't be needed.

    SRCON1=0 (pg.243)
    Defaults to 0 at POR, SR latch is disabled, setting it to 0 shouldn't be needed.

    WPUA=0 (pg.86)
    Defaults to 56 at POR, PortA pulups enabled, setting it to 0 disables the pullups individually.
    However, INTCON2.7 is the "master switch" PortA and PortB pullups and it defaults to 1 which means pullups are disabled.
    So, if you're NOT clearing INTCON2.7 there shouldn't be any need to set WPUA=0

    WPUB=0 (pg.91)
    Defaults to 240 at POR, PortB pullups enabled, setting it to 0 disables the pullups individually.
    However, INTCON2.7 is the "master switch" PortA and PortB pullups and defaults to 1 which means pullups are disabled.
    So, if you're NOT clearing INTCON2.7 there shouldn't be any need to set WPUA=0

    /Henrik.

  2. #2
    Join Date
    Feb 2012
    Posts
    57


    Did you find this post helpful? Yes | No

    Default Re: 18F14K50, PORT C as outputs

    Thank you Henrik for your time and effort.
    I think you are right, setting states that are the same as after POR are not very useful...
    I think I give up for today. Tomorrow there's an other day...

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: 18F14K50, PORT C as outputs

    Have you tried AllDigital?

    http://www.picbasic.co.uk/forum/showthread.php?t=11100

    Robert

Similar Threads

  1. 18f14k50 low speed
    By mpardinho in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 21st May 2013, 18:20
  2. Hello World help please 18F14K50 config
    By Bonxy in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th August 2011, 17:35
  3. Replies: 2
    Last Post: - 22nd January 2011, 01:58
  4. 18F2520 - problem configuring fuse for port B as digital port.
    By hwhisperer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th October 2010, 11:41
  5. Replies: 3
    Last Post: - 24th September 2010, 07:10

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