Having problems with I/O ports F & G on 16F946


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2009
    Posts
    6

    Default Having problems with I/O ports F & G on 16F946

    Anyone using port F & G as general outputs?

    I cannot get these ports to work correctly as general I/O's.

    I have set all the LCDSe to 0 (set pins as I/O based on DS)

    They always act funny like not really true in/outs.

    Some clear some do not, none of them work as inputs etc.

    I assuemd it is something to do with the LCD module stuff.

    I turned it all off but these ports still acts weird.

    I have tried setting bit, seetin whole port, setting tris, setting single tris etc.
    Nothing changes.

    Can anyone simulate this?

    All the other ports and pins work just like expected but wehn I try it on those ports it goes goofy.

    ZM

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


    Did you find this post helpful? Yes | No

    Default

    I don't have this one in stock, but I would try
    Code:
    LCDCON = %01000000
    Steve

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

  3. #3
    Join Date
    Mar 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    I don't have this one in stock, but I would try
    Code:
    LCDCON = %01000000
    Wow, thanks Mister-E that was a fast response.

    DataSheet states:

    Once the module is configured, the LCDEN bit of the
    LCDCON register is used to enable or disable the LCD
    module. The LCD panel can also operate during Sleep
    by clearing the SLPEN bit of the LCDCON register.

    Are these settings order specific?
    Setup other regs. first then set LCDCON (off) etc?


    I have all the LCD settings off, but did not try LCDCON = %0100000 as you mentioned. Does it make a difference since I never sleep my pic?
    I will try that setting and see what happens.
    This is just baffling me to no end.

    Code:
    LVDCON = 0
    LCDCON = 0
    LCDPS = 0
    LCDSE0 = 0
    LCDSE1 = 0
    LCDSE2 = 0
    LCDSE3 = 0
    LCDSE4 = 0
    LCDSE5 = 0
    
    TRISF = 0
    TRISG = 0

    Z

  4. #4
    Join Date
    Mar 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    I don't have this one in stock, but I would try
    Code:
    LCDCON = %01000000
    Setting that bit did nothing.

    But I found this out today after some testing.

    If I add a micro second delay between any H-L or L-H output on those pins it works fine and no other pins act up.

    So I assume there is some internal LCD element charge/time issue on these pins before the data state is valid?

    Since any value below 4 micro seconds does weird things on pins and even reboots the pic from time to time.

    I also added some delays in the setting of directions (tris) and other settings but that had no effect.

    Does this make since, anyone else use LCD pins normally and not have this issue?

    Mz

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


    Did you find this post helpful? Yes | No

    Default

    Can you post your code?

    Are you writing to the whole port or some PORT bits here and there?
    Steve

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

Similar Threads

  1. Setting I/O ports on 16f629
    By Optech in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2008, 21:51
  2. Port 'a' problems
    By Robotica1 in forum mel PIC BASIC
    Replies: 14
    Last Post: - 14th July 2007, 15:17
  3. managing the I/O ports of the 16F84A
    By skyler_91600 in forum mel PIC BASIC
    Replies: 7
    Last Post: - 28th April 2005, 03:52
  4. PIC16F676 I/O Problems.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2005, 16:37
  5. making ports outputs on a 12F629
    By bartman in forum mel PIC BASIC
    Replies: 2
    Last Post: - 14th November 2004, 17:47

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