Prolem with 1 x 16 alpha LCD when connected on PortA


Go to last post By: pic-ignorant
Today 20:24
Forum: CAN Module
Starter: RGV250
Views: 0
Replies: 5
Go to last post By: pic-ignorant
Today 20:12
Forum: The Lounge
Starter: pic-ignorant
Views: 0
Replies: 0
Today 19:45
Forum: LCD module
Starter: charliecoultas
Views: 0
Replies: 35
Today 15:38
Forum: Proton Plus Compiler v3
Starter: Frizie
Views: 0
Replies: 2
Today 10:11
Forum: The Lounge
Starter: Tim
Views: 0
Replies: 0
Yesterday 23:16
Forum: The Lounge
Starter: keytapper
Views: 0
Replies: 8
Yesterday 22:07
Forum: Proton Users File Server
Starter: top204
Views: 0
Replies: 0
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member yvesmazzon's Avatar
    Join Date
    Jul 2006
    Posts
    207
    Thumbs Up
    Received: 11
    Given: 32
    Total Downloaded
    10.40 GB

    0 Not allowed!

    Default Prolem with 1 x 16 alpha LCD when connected on PortA

    Hello
    I'm having some problem with LCD when connected on PortA. I'm using the 18F25k22 at 8Mz. The LCD print ok for a while then start printing gibberish. PortA.4 is pull-up with 1.5K resistor as it is an open drain. Is there any particular setup I should add for PortA? My setup is as follow:

    Output PORTA
    PORTA = 000000 ' Clear port contents first
    ANSELA =000000 'PORTA SET FOR ALL DIGITAL I/O
    Declare LCD_Type = 0
    Declare LCD_DTPin PORTA.0 ' Used for 4-line interface.
    Declare LCD_ENPin PORTA.4 'Pin 6 Open Drain
    Declare LCD_RSPin PORTA.5 'Pin 7

    Declare LCD_Interface 4
    Declare LCD_Lines 2
    Declare LCD_CommandUs 5000
    Declare LCD_DataUs 254
    Print Cls
    DelayMS 500

    Regards,
    Yves
    Last edited by yvesmazzon; 6th April 2019 at 07:07.

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,098
    Thumbs Up
    Received: 191
    Given: 170
    Total Downloaded
    4.82 GB

    0 Not allowed!

    Default Re: Prolem with 1 x 16 alpha LCD when connected on PortA

    If I read the ds correctly only RB1,RB2, RC3 and RC4 are open drain and only when in I2C mode.
    Do you have a TRISA setting?
    I suspect that the gibberish is caused by writting to the LCD to quickly. This might happen if the actual clock speed were higher than the declared Xtal. IIWY I'd write a blinky program and confirm that your declared Xtal is correct alternatley show the code you are using to set the clock.
    George.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,300
    Thumbs Up
    Received: 381
    Given: 137
    Total Downloaded
    1.60 GB

    1 Not allowed!

    Default Re: Prolem with 1 x 16 alpha LCD when connected on PortA

    George is correct. The 18F25K22 device does not seem to have any open drain pins, according to the datasheet.

    I've just tested this code on the Amicus18 board using a PIC18F25K22, and the LCD worked as expected:

    Code:
        Device = 18F25K22
        Declare Xtal = 8
           
        Declare LCD_DTPin = PORTA.0
        Declare LCD_ENPin = PORTA.4 
        Declare LCD_RSPin = PORTA.5 
        Declare LCD_Type = Alpha
        Declare LCD_Interface = 4
        Declare LCD_Lines = 2
    
        Dim MyWord As Word = 0    
        
    Main:
        DelayMS  100 
        
        Cls
        Do
            Print At 1, 1, Dec MyWord, "    "
            Inc MyWord
        Loop
    1.5K Ohms seems a bit low for a pull-up resistor, and maybe this is causing problems. Remove the resistor and try again, and as stated, make sure the device is actually running at 8MHz. If using the latest compiler version, it automatically makes all pins digital, disables the comparators and disables the slew rates on the pins and makes them TTL before a user's program starts. Press the F2 button in the IDE and see the Asm file:

    Code:
    proton#main#start
        clrf BPF,0
    F1_SOF equ $ ; 18F25K22_ALPHA_LCD.BAS
        movlb 0X0F
        clrf  ANSELA,1
        clrf  ANSELB,1
        clrf  ANSELC,1
        clrf  CM1CON0,0
        clrf  CM2CON0,0
        clrf  SLRCON,0
    The above asm code is performed before the user's program starts.
    Last edited by top204; 6th April 2019 at 19:09.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Member yvesmazzon's Avatar
    Join Date
    Jul 2006
    Posts
    207
    Thumbs Up
    Received: 11
    Given: 32
    Total Downloaded
    10.40 GB

    0 Not allowed!

    Default Re: Prolem with 1 x 16 alpha LCD when connected on PortA

    Many thanks,
    Yes you are all right PortA.4 is not an open drain. I have been working with 16F876A for so long that it was stuck in my mind that PortA.4 is always an open drain. I have removed the pull-up resistor and now it is all fine. Many thanks for your time.

    Regards,

    Yves

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,715
    Thumbs Up
    Received: 126
    Given: 33
    Total Downloaded
    3.99 GB

    0 Not allowed!

    Default Re: Prolem with 1 x 16 alpha LCD when connected on PortA

    Just an aside Yves, some 1x16 LCD displays are strange in that the first 8 characters are line one while the characters 9-16 are on line two.
    I know your LCD isn't one of them but someone seeing this thread may come across the problem one day.
    John

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,098
    Thumbs Up
    Received: 191
    Given: 170
    Total Downloaded
    4.82 GB

    0 Not allowed!

    Default Re: Prolem with 1 x 16 alpha LCD when connected on PortA

    The 18F25K22 device does not seem to have any open drain pins, according to the datasheet.
    As I guess is common with mc datasheets, it's kindda contradictory. In the table 1.2 none of the pins are OD (indeed OD is not even in the legend) but later on when dealing with I2C 15.3 thet state "Both the SCLx and SDAx connections are bidirectional open-drain lines".

    Go figure.
    George.

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Alpha LCD
    By craig in forum The Lounge
    Replies: 3
    Last Post: 18th October 2016, 19:08
  2. Interfacing with a 40 x 4 alpha LCD display
    By rcurl in forum Proton Plus Compiler v3
    Replies: 46
    Last Post: 15th June 2010, 07:31
  3. Help on ALPHA LCD for newbye
    By bolkan in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 4th May 2010, 19:28
  4. TRISE + alpha LCD anomaly
    By wastrix in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 22nd December 2008, 03:37
  5. Alpha 16x2 LCD
    By rrakke in forum Wish List / Product Feedback
    Replies: 0
    Last Post: 18th March 2003, 13:10

Members who have read this thread : 37

Actions :  (Set Date)

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