error in lcd 16x2


+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: error in lcd 16x246 days old

  1. #1
    Junior Member
    Join Date
    Feb 2020
    Posts
    9
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Unhappy error in lcd 16x2

    best regards friends


    Well, I designed a code with pic 18f2550, this code is for measuring resistors and capacitors, but when simulating in proteus I get the following error
    controller received data whilst busy.

    this is my code


    Device 18F2550
    Xtal = 48


    DelayMS 100
    CMCON = 7
    All_Digital = TRUE
    Declare LCD_Type = 0
    Declare LCD_DTPin = PORTB.4
    Declare LCD_RSPin = PORTB.1
    Declare LCD_ENPin = PORTB.0
    Declare LCD_Interface = 4
    Declare LCD_Lines = 2



    Dim VALOR As Word
    Dim R As Float
    Dim C As Float


    Cls
    LAZO:
    High PORTC.0
    DelayMS 1
    VALOR = RCIn PORTC.0 , High
    Print At 1,1, "TEST RCIN JOSE JOSE"


    R = VALOR /(1450 * 0.1)
    C = VALOR /(1450 * 10)


    Print At 2,2,"R:",Dec1 R , " "
    Print At 2,9,"C:",Dec2 C , " "




    GoTo LAZO



    I hope you can help me thanks


    jose
    Attached Thumbnails Attached Thumbnails error in lcd 16x2.jpg‎  

  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 charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,397
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: error in lcd 16x2

    Your code shows the four data bits to the LCD as RB4,5,6 and 7. But the diagram shows RB3,5,6 and 7.

  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
    Junior Member
    Join Date
    Feb 2020
    Posts
    9
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: error in lcd 16x2

    that is to say that the fault is in the declaration of the variables of the lcd or do I have it in the electrical connection of the circuit?

  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
    Junior Member
    Join Date
    Feb 2020
    Posts
    9
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: error in lcd 16x2

    I have corrected the electrical connections of the circuit and the simulation presents the same error.
    Could it be that I need an additional instruction?Click image for larger version

Name:	It does not display a message on the lcd 16x2 and the simulation in proteus presents an error.jpg
Views:	7
Size:	102.2 KB
ID:	3888

  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
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,397
    Thumbs Up
    Received: 48
    Given: 40
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: error in lcd 16x2

    Can you try it on actual hardware Jose?

    Charlie

  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
    Junior Member
    Join Date
    Feb 2020
    Posts
    9
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: error in lcd 16x2

    I still do not have the necessary hardware to perform the real test, I also believe that in the summation in proteus it presents an error, sure that in the real test it will happen the same, do not you think, friend?
    :Confusión:

  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.

  13. #7
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,858
    Thumbs Up
    Received: 90
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: error in lcd 16x2

    Does it print to LCD if you comment out the "Valor= ....." line?
    What version of the compiler are you using?
    John

  14. 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.

  15. #8
    Junior Member
    Join Date
    Feb 2020
    Posts
    9
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: error in lcd 16x2

    It does not print on the value line, the compiler version is 3.6.0.2.
    download it from the following link
    http://www.protonbasic.co.uk/vbdownloads.php?do=download&downloadid=416

    Is it a compiler problem or does my code need an instruction?


  16. 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.

  17. #9
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    534
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.87 GB

    0 Not allowed!

    Default Re: error in lcd 16x2

    I tried it on read hardware that required the following changes due to its configuration...

    Device = 18F4550
    Xtal = 20
    LDC on Port D, as that is where I had it connected using the same display as your simulation

    Software changes made other than those required for the hardware

    Added fuse configuration, most people use the configurator plugin available here. If you don't already have it I recommend installing you install it.
    Added TRISD (TRISB in your case) = $00 before the LDC declares to set I/O pins used for the LCD to outputs, maybe the compiler does that for you but I like to do it myself just to be sure.

    With compiler version 3.7.2.5 I got a correct display on the LDC when connected to PortD, however having tried several things I have so far been unable to get any display when connected to PortB.

    Note:
    For a real device you will need to do more than just declare the Xtal as 48 and add a fuse configuration to get it operate at that frequency. I suggest you read this as a guide on how to do that (page 2 is particularly relevant) as depending on what your crystal frequency is will depend on if you only need to use the PLL or if you have to also write to registers to set up pre and/or post scallers to make the system clock speed equal the declared speed.

  18. 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.

  19. #10
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    534
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.87 GB

    0 Not allowed!

    Default Re: error in lcd 16x2

    The reason I could not get it to work on PortB was that PortB.5 never went high due to the Low Voltage Programming bring enabled which over rides all other settings keeping that pin as in input - Doh!

    Unfortunately the Low voltage programming mode is enable by default, I don't know if Proteus or the compiler automatically turns that off or not so try entering a fuse configuration into your code that has the LVP function turned off and see if that makes a difference and keep an eye on pin status in the simulation to see if it remains low or not, if it does that that could explain the display issues in the simulation.
    Last edited by Stephen Moss; 21st February 2020 at 12:56.

  20. 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.

  21. #11
    Prolific Poster rcurl's Avatar
    Join Date
    Mar 2002
    Posts
    1,865
    Thumbs Up
    Received: 31
    Given: 55
    Total Downloaded
    2.38 GB

    0 Not allowed!

    Default Re: error in lcd 16x2

    Quote Originally Posted by Stephen Moss View Post
    The reason I cannot get the LCD to work with PortB on my hardware is that PortB.5 never goes high, I have tried 2 devices and it is the same on both so either they have the same fault or there is something I'm missing.
    Hi Stephen- Are you sure low voltage programming is turned off in the fuse configuration? That will keep B.5 from becoming an output.

    -Rick

  22. 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.

  23. #12
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    534
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.87 GB

    0 Not allowed!

    Default Re: error in lcd 16x2

    Hi Rick,
    thanks. I had just worked that out myself and was updating my previous post while you sent yours.

    I don't know why they made on the default when it can easily be overlooked and cause such problems.

  24. 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.

  25. #13
    Junior Member
    Join Date
    Feb 2020
    Posts
    9
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Unhappy Re: error in lcd 16x2

    I have made the settings in the code using pic 18f4550 and the 20 mhz crystal, I have changed port b with port d, and now in the ldc the message is displayed but what is not displayed in the results of the values of the resistance and capacitors to measure.
    Attached simulation in proteus and the circuit of connection to the pic to measure resistors and capacitors.
    Click image for larger version

Name:	DO NOT display results in lcd 16x2.jpg
Views:	3
Size:	100.8 KB
ID:	3889Click image for larger version

Name:	Pic-Connection-Circuit.jpg
Views:	2
Size:	12.1 KB
ID:	3890

    I hope and help me again
    thanks

  26. 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.

  27. #14
    Junior Member
    Join Date
    Feb 2020
    Posts
    9
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Question Re: error in lcd 16x2

    which of all plugins should I install for the proton ide version 3.6.0.2
    I attach the link

    http://www.protonbasic.co.uk/content.php/157-Plugins


  28. 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.

  29. #15
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,517
    Thumbs Up
    Received: 319
    Given: 153
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: error in lcd 16x2

    Never trust simulation software 100%. It depends on which model they based their Hitachi chipset for the LCDs, and the timings used for it. An example of this type of issue is the Isis model of the KS0108 graphic LCD, because they used an internal clock so slow, it cannot be fully operated with a microcontroller running over approx 20MHz.

    The Hitachi "compatible" chipsets each tend to have a different timing within them. The compiler does not use the R/W pin of the LCD to read the STATUS from the LCD because it was written when devices only had 18 pins and very few I/O lines, so the R/W line was not needed because the only hitachi chipsets out there were actually Hitachi chipsets and not Chinese clones.

    You could try adding the declares that slow down or speed up the command and data timings sent to the LCD:

    Code:
    Declare LCD_CommandUs = 2000
    Declare LCD_DataUs = 50
    The values above are the default timings used within the compiler if the declares are not issued in the program.

  30. 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. [SOLVED !] DS2408 and LCD 16x2
    By Shaman in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 10th March 2015, 18:44
  2. [SOLVED !] 8 bit 16x2 LCD Code for 16F84A
    By Jessica in forum Absolute Beginners Section
    Replies: 11
    Last Post: 1st September 2014, 16:51
  3. [SOLVED !] Where to buy enclosure box for 16x2 lcd display?
    By picprotonguy in forum The Lounge
    Replies: 11
    Last Post: 29th October 2012, 17:37
  4. Problem with 16X2 LCD and PIC16F877A for Proton
    By lexma89 in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 8th December 2011, 13:35
  5. Alpha 16x2 LCD
    By rrakke in forum Wish List / Product Feedback
    Replies: 0
    Last Post: 18th March 2003, 13:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts