wrong positive and negative voltages on lcd 20x4


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: wrong positive and negative voltages on lcd 20x4

    when corrected for a 2 line display as depicted in your code
    Code:
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTC
    DEFINE LCD_RSBIT 0
    DEFINE LCD_EREG PORTC
    DEFINE LCD_EBIT 1
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    it works in proteus much as expected

    Name:  jose.jpg
Views: 46595
Size:  490.3 KB
    Warning I'm not a teacher

  2. #2
    Join Date
    Jul 2022
    Posts
    26


    Did you find this post helpful? Yes | No

    Default Re: wrong positive and negative voltages on lcd 20x4

    Name:  Problems with mathematical equations in Symmetric Font.jpg
Views: 23801
Size:  246.6 KB
    Quote Originally Posted by richard View Post
    when corrected for a 2 line display as depicted in your code
    Code:
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTC
    DEFINE LCD_RSBIT 0
    DEFINE LCD_EREG PORTC
    DEFINE LCD_EBIT 1
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    it works in proteus much as expected

    Attachment 9354
    previously I had this code using pic 16f877a​

    DEFINE LCD_DREG PORTD
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTE
    DEFINE LCD_RSBIT 0
    DEFINE LCD_EREG PORTE
    DEFINE LCD_EBIT 1
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2

    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_ SAMPLEUS 50

    TRISC.6 = 0
    TRISC.7 = 1
    TRISA = 255
    ADCON1 = %11000010
    TRISB.6 = %0

    LED VAR PORTB.6
    B1 VAR WORD
    B2 VAR WORD
    VALOR1 VAR BYTE
    VALOR2 VAR BYTE

    STAR:
    ADCIN 1, B1
    ADCIN 2, B2
    VALOR1=B1/9
    VALOR2=B2/12

    SEROUT2 PORTC.6,188,["$", "$", DEC4 B1,"$", "$",DEC4 B2,10,13]
    LCDOUT $FE,2," SYMMETRIC FONT "
    LCDOUT $FE,$C4," JOSE LUIS "
    LCDOUT $FE,$90," VOLTAGE NEGATIVE:-",DEC2 VALOR1
    LCDOUT $FE,$D0," VOLTAGE POSITIVE:+",DEC2 VALOR2
    HIGH LED
    GOTO STAR​

    If you look at the image you will see that the voltages registered in the 20x4 lcd are different from the voltages registered in the proteus dc voltmeter.
    I had errors in the floating point and I was able to correct it with the 32-bit library.
    and the other code is an improvement, but it still has errors, and in the simulation it shows it.
    I hope you can help me correct the code and thanks again​



  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: wrong positive and negative voltages on lcd 20x4

    VALOR1=B1/9
    VALOR2=B2/12
    b1 = 329 , b1/9 =35 target is 12.2 why divide by 9 ?
    b2 = 360 , b2/12=30 target is 12.3 why divide by 12 ?


    to get more resolution
    dummy = b1*100
    VALOR = div32 26
    result = 1226 ie 12.26 *100

    an even more accurate result is possible using */
    Warning I'm not a teacher

  4. #4
    Join Date
    Jul 2022
    Posts
    26


    Did you find this post helpful? Yes | No

    Default Re: wrong positive and negative voltages on lcd 20x4

    Quote Originally Posted by richard View Post
    b1 = 329 , b1/9 =35 target is 12.2 why divide by 9 ?
    b2 = 360 , b2/12=30 target is 12.3 why divide by 12 ?


    to get more resolution
    dummy = b1*100
    VALOR = div32 26
    result = 1226 ie 12.26 *100

    an even more accurate result is possible using */
    In my previous code I had many errors due to the mathematical equations and I was able to partially correct these errors using the fp2032.bas library.
    even the code continues with the errors in mathematical equations, for that reason I went to the lighthouse to see if they could help correct the code, thanks


  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: wrong positive and negative voltages on lcd 20x4

    I went to the lighthouse to see if they could help correct the code
    if you don't understand the math / pbp language then you can seek assistance
    in this section of the forum [Commercial - Assistance Required] , your problem
    description and solution attempts make little sense to me
    Warning I'm not a teacher

  6. #6
    Join Date
    Jul 2022
    Posts
    26


    Did you find this post helpful? Yes | No

    Thumbs up Re: wrong positive and negative voltages on lcd 20x4

    Quote Originally Posted by richard View Post
    if you don't understand the math / pbp language then you can seek assistance
    in this section of the forum [Commercial - Assistance Required] , your problem
    description and solution attempts make little sense to me
    I will try and thank you very much for your help

Similar Threads

  1. Monitoring negative voltages
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th August 2014, 04:17
  2. Pic18f452 with 20x4 LCD Help
    By djmachine in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th November 2008, 22:43
  3. Measuring negative voltages
    By sammy in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th June 2006, 01:36
  4. 20x4 LCD and P18F2680
    By microuser in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th June 2006, 19:26
  5. LCD 20X4 connect with DS1820
    By jojokatada in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th March 2005, 11:04

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