data shown on LCD not working correctly

Discussion in 'The Projects Forum' started by RG23, May 25, 2011.

  1. RG23

    Thread Starter Active Member

    Dec 6, 2010
    301
    2
    When the value of count321 is 2,

    "I have to make the cursor blink when I am on line1 and same if cursor is on line 2"

    Code ( (Unknown Language)):
    1.  
    2. label733:////////////////used to check if cursor is on line 1 or 2
    3.         btfsc  usereg,2  
    4.         goto   label753///////if cursor is on line2
    5.         incf   count320,1
    6.         movf   count320,0
    7.         sublw  d'1'
    8.         btfsc  STATUS,Z
    9.         call   label730////////////to make the cursor blank
    10.         movf   count320,0
    11.         sublw  d'2'
    12.         btfsc  STATUS,Z
    13.         call   label731////////////to make the cursor solid
    14.         return
    15.  
    16. label730:
    17.         movlw  d'1'
    18.         movwf  count320
    19.         movlw  0x8F
    20.         movwf  PORTD
    21.         call   SND_CMD////////brings the cursor to line 1 last position
    22.         movlw  0x20
    23.         movwf  PORTD
    24.         call   SND_DTA///////displays blank on line 1 last position
    25.         return
    26.  
    27. label731:
    28.         movlw  d'0'
    29.         movwf  count320
    30.         movlw  0x8F///////////////////brings the cursor to line 1 last position
    31.  
    32.         movwf  PORTD
    33.         call   SND_CMD
    34.         movlw  0x3C///////displays solid cursor on line 1 last position
    35.  
    36.         movwf  PORTD
    37.         call   SND_DTA
    38.         return
    39.  
    40. //////////same procedure above I repeat for line 2 also
    41.  
    42. label753:///////////same approach as label733 for line1
    43.         incf   count320,1
    44.         movf   count320,0
    45.         sublw  d'1'
    46.         btfsc  STATUS,Z
    47.         call   label750
    48.         movf   count320,0
    49.         sublw  d'2'
    50.         btfsc  STATUS,Z
    51.         call   label751
    52.         return
    53.          
    54. label750://///////:///////////same approach as label730 for line1
    55.         movlw  d'1'
    56.         movwf  count320
    57.         movlw  0xCF
    58.         movwf  PORTD
    59.         call   SND_CMD
    60.         movlw  0x20
    61.         movwf  PORTD
    62.         call   SND_DTA
    63.         return
    64. label751:://///////:///////////same approach as label731 for line1
    65.  
    66.         movlw  d'0'
    67.         movwf  count320
    68.         movlw  0xCF
    69.         movwf  PORTD
    70.         call   SND_CMD
    71.         movlw  0x3C
    72.         movwf  PORTD
    73.         call   SND_DTA
    74.         return
    75.  
    76. When the value of count321 becomes 3, I call label734 to repeat the process
    77.  
    78. label734:
    79.         movlw d'1'
    80.         movwf count321
    81.         return
    82.  
    Now the problem I am facing is when count321 becomes 3;
    I need to make the cursor solid irrespective of whether I am in line 1 or 2 blank mode.

    It didn't work for me though.

    If anyone has an idea please let me know

    Thanks
     
    Last edited by a moderator: May 26, 2011
Loading...