Problems with PORTD on 18F658


Closed Thread
Results 1 to 4 of 4
  1. #1
    blainecf's Avatar
    blainecf Guest

    Unhappy Problems with PORTD on 18F458

    Greetings all you brain trusts!

    Using the 44pin PLCC version of this chip to control a bank of relays.

    Thought I did all the standard stuff; all the relays hooked to PORTB worked as expected, none of the relays hooked to PORTD worked.

    However, when I changed the code to:

    OUTPUT PORTD.7

    ...

    HIGH PORTD.7

    the relays work just fine.

    Previously, I was using TRISB and TRISD, then setting the individual ports on or off using PORTD.7 = %1, which worked on PORTB but not on PORTD. (Syntax was identical)

    Any ideas?
    Last edited by blainecf; - 13th June 2006 at 17:28.

  2. #2
    Join Date
    Apr 2006
    Location
    Michigan
    Posts
    70


    Did you find this post helpful? Yes | No

    Default

    I am by far an expert at this stuff and I have never used this particular chip, but when I do an A to B comparison of Ports B and D the only difference seems to be PSP. Looking at page 153 of the datasheet it says that you need to set bit 4 of the PSPCON register to 0 to make it general IO. Did you do this? It may be that way by default. I would try PSPCON=%00000000.

  3. #3
    blainecf's Avatar
    blainecf Guest


    Did you find this post helpful? Yes | No

    Default Thanks!!!

    Proving once again, it's not what you know, but whether you have access to a (literate) genius.

    Worked great!

  4. #4
    Join Date
    Apr 2006
    Location
    Michigan
    Posts
    70


    Did you find this post helpful? Yes | No

    Default

    That is the new rule I live by come 2 days ago. Whenever IO doesn't work right I probably didn't set a register right.

Similar Threads

  1. Unable to get 2 inputs to work
    By rangerdoc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st June 2008, 03:16
  2. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  3. Input problems with PortD on Pic16F874A
    By Petter in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 26th August 2006, 11:30
  4. 18F6680 and portd problems.
    By jkbh in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 6th June 2005, 10:54
  5. Display problems
    By rossfree in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th November 2004, 23:36

Members who have read this thread : 1

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