18F6680 and portd problems.


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Default

    Hi jkbh,

    I didn't take the time to look up the data sheet on this micro but:

    "Y3 var latd.3" At what point did you declare Portd.3 = latd.3?

    All of your X variables have been assigned to a port pin but none of the Y variables have a specific port assignment. I'm still a beginner at programming but this stood out to me.

    BobK

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    What are your config fuse settings?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Just recall that: why using Y3 var latd.3 instead of Y3 VAR PORTD.3?

    Just out of curiosity!!!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    On the 18F series, when you have a mixture of inputs & outputs on the
    same port, writing to the LAT register VS the port bit directly avoids the
    read-modify-write problem.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Thanks Bruce,

    I'll put that note in my handbook! That's what I like about this site. You always learn something!

    BobK

  6. #6
    jkbh's Avatar
    jkbh Guest


    Did you find this post helpful? Yes | No

    Default

    I´m gonna check my config bits tomorrow,but I think I have got it right.
    I know I have set:
    HS PLL mode.
    Power on timer enabled.
    Turned off watchdog.

    What config bits shall I use if I just want to use PORTD as Digital I/Os.
    /Jimmy

  7. #7
    jkbh's Avatar
    jkbh Guest


    Did you find this post helpful? Yes | No

    Default

    Hers my current Configuration Bits.

    I have put these in the 18F6680.INC file in the PBP directory.
    Is this the right way to do it?

    __CONFIG _CONFIG1H, _OSC_HSPLL_1H
    __CONFIG _CONFIG2L, _PWRT_ON_2L
    __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H
    __CONFIG _CONFIG4L, _LVP_OFF_4L & _STVR_OFF_4L
    __CONFIG _CONFIG5H, _CPD_OFF_5H
    __CONFIG _CONFIG6H, _WRTD_OFF_6H

    /Jimmy

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