Found a bug (I think)


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2003
    Posts
    985

    Default Found a bug (I think)

    Hi Guys,
    I can only conclude I found a bug after today’s efforts.
    I have 2x16 char LCD connected as default in the manual, except for the enable pin connected to portB bit 2,
    and also using hardware serial input, but I don’t want to use serial transmit.



    It appears I can either use the LCD or hardware serial, but not both.
    If HSERIN is ever called, the LCD routines that aren’t seen, I assume, forgets to use the enable pin,
    and the LCD never works again for the program session.

    Even after disabling the TXSTA and RCSTA registers manually after each HSERIN use, the LCD still does not work.
    Connecting the LCD enable pin to portb bit 7 instead fixes everything.

    Other than TXSTA and RCSTA registers, I don’t know what else the use of HSERIN could change that could be
    restored after each use for the LCD command to work again.
    Cheers, Art.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Found a bug (I think)

    I am sure it is because RB2 is asigned to TX of the USART.

    Ioannis

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Found a bug (I think)

    Yes, but that seems to only happen once HSERIN command is actually executed
    no matter what HSER defines are at the top of the program.
    From there, it should be possible to reverse whatever registers were changed for LCDOUT to work again,
    but that doesn’t seem to happen. All of the control bits are in either the TXSTA or RCSTA registers.

    Quote Originally Posted by Ioannis View Post
    I am sure it is because RB2 is asigned to TX of the USART.

    Ioannis

  4. #4
    Join Date
    Aug 2011
    Posts
    412


    Did you find this post helpful? Yes | No

    Default Re: Found a bug (I think)

    Check out the USART control info in the 16F628A errata document

    You should be able to get control of the pins by clearing SPEN (RCSTA.7) and restoring the TRISB pin settings.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: Found a bug (I think)

    Also I recall a system variable called FLAGS or something similar that initialize the LCD module after the system has recovered from sleep mode.

    See this post too: http://www.picbasic.co.uk/forum/show...1653#post51653

    Ioannis
    Last edited by Ioannis; - 23rd April 2016 at 15:01.

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Found a bug (I think)

    I have tried clearing various bits of the registers (including specific serial port enable bits),
    but not yet resetting the LCD.
    It would be bad though since the LCD is updated every frame, and initialisation is a few commands.
    I think maybe I’ll leave as is, and try to control and LED or such with the RB2 pin.

Similar Threads

  1. My programmer is not found!
    By timbear3 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th November 2012, 15:40
  2. Replies: 5
    Last Post: - 10th April 2011, 12:48
  3. Did I find a bug or bug found me?
    By sayzer in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 13th September 2008, 09:58
  4. I have found that ......(RF message)
    By gringobomba14 in forum General
    Replies: 0
    Last Post: - 29th June 2008, 19:17
  5. Found something strange (BUG???)
    By GrandPa in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th November 2007, 19:50

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