SID13700F01 LCD controller Problem

Discussion in 'Embedded Systems and Microcontrollers' started by dXri, Oct 4, 2010.

  1. dXri

    Thread Starter New Member

    Oct 4, 2010
    3
    0
    Hello.
    I try to display the message "EPSON" in LCD such as it is shown the example 15.1.2 in page 108 ( i use indirect mode M6800 ). I can't clean the first and the second layer such as the steps 8 & 9 show. I disable the second and the third layer and now the LCD displays except the text and another characters. Next i tried to fill the layers by calling the MWRITE command and then i filled 1000 bytes with 20Hex. After that, without calling again the MWRITE even if i sent only one byte with 00Hex the displays cleans completely and doesn't show any character. I believe that the problem is the cleaning of the layers. Please can you tell me with which way can i clean the layers such as it is shown at the example 15.1.2 (Initalization Example).

    Regards dXri.


    Code ( (Unknown Language)):
    1. CALL LCD_DELAY
    2. ;SYSTEM_SET
    3. MOVLW 0x40
    4. CALL L_C_WRITE
    5. NOP
    6. CALL LCD_DELAY
    7. MOVLW 0x38
    8. CALL L_D_WRITE
    9. NOP
    10. CALL LCD_DELAY
    11. MOVLW 0x87
    12. CALL L_D_WRITE
    13. NOP
    14. CALL LCD_DELAY
    15. MOVLW 0x07
    16. CALL L_D_WRITE
    17. NOP
    18. CALL LCD_DELAY
    19. MOVLW 0x3F
    20. CALL L_D_WRITE
    21. NOP
    22. CALL LCD_DELAY
    23. MOVLW 0x49
    24. CALL L_D_WRITE
    25. NOP
    26. CALL LCD_DELAY
    27. MOVLW 0x7F
    28. CALL L_D_WRITE
    29. NOP
    30. CALL LCD_DELAY
    31. MOVLW 0x80
    32. CALL L_D_WRITE
    33. NOP
    34. CALL LCD_DELAY
    35. MOVLW 0x00
    36. CALL L_D_WRITE
    37. NOP
    38.  
    39.  
    40. ;SCROLL
    41. MOVLW 0x44
    42. CALL L_C_WRITE
    43. NOP
    44. MOVLW 0x00
    45. CALL L_D_WRITE
    46. NOP
    47. MOVLW 0x00
    48. CALL L_D_WRITE
    49. NOP
    50. MOVLW 0x40
    51. CALL L_D_WRITE
    52. NOP
    53. MOVLW 0x00
    54. CALL L_D_WRITE
    55. NOP
    56. MOVLW 0x10;3333
    57. CALL L_D_WRITE
    58. NOP
    59. MOVLW 0x40
    60. CALL L_D_WRITE
    61. NOP
    62. MOVLW 0x00
    63. CALL L_D_WRITE
    64. NOP
    65. MOVLW 0x04
    66. CALL L_D_WRITE
    67. NOP
    68. MOVLW 0x00
    69. CALL L_D_WRITE
    70. NOP
    71. MOVLW 0x30
    72. CALL L_D_WRITE
    73. NOP
    74.  
    75.  
    76. ;HDOT SCR
    77. MOVLW 0x5A
    78. CALL L_C_WRITE
    79. NOP
    80. MOVLW 0x00
    81. CALL L_D_WRITE
    82. NOP
    83.  
    84.  
    85. ;OVLAY
    86. MOVLW 0x5B
    87. CALL L_C_WRITE
    88. NOP
    89. MOVLW 0x01
    90. CALL L_D_WRITE
    91. NOP
    92.  
    93.  
    94. ;DISP ON/OFF
    95. MOVLW 0x58
    96. CALL L_C_WRITE
    97. NOP
    98. MOVLW 0x56
    99. CALL L_D_WRITE
    100. NOP
    101.  
    102. MWRITE
    103. MOVLW 0x42
    104. CALL L_C_WRITE
    105. NOP
    106. MOVLW 0x10
    107. MOVWF REG3
    108. CALL WWW
    109. DECFSZ REG3,F
    110. GOTO $-2
    111.  
    112.  
    113. ;MOVLW 0x01
    114. ;MOVWF REG4
    115. ;CALL AAA
    116. ;DECFSZ REG4,F
    117. ;GOTO $-2
    118. ;MOVLW 0xFF
    119. ;MOVWF REG4
    120. ;CALL QQQQ
    121. ;DECFSZ REG4,F
    122. ;GOTO $-2
    123. ;MOVLW 0xFF
    124. ;MOVWF REG4
    125. ;CALL QQQQ
    126. ;DECFSZ REG4,F
    127. ;GOTO $-2
    128.  
    129.  
    130. ;CSRW
    131. MOVLW 0x46
    132. CALL L_C_WRITE
    133. NOP
    134. MOVLW 0x00
    135. CALL L_D_WRITE
    136. NOP
    137. MOVLW 0x00
    138. CALL L_D_WRITE
    139. NOP
    140.  
    141.  
    142. ;CSRFORM
    143. MOVLW 0x5D
    144. CALL L_C_WRITE
    145. NOP
    146. MOVLW 0x04
    147. CALL L_D_WRITE
    148. NOP
    149. MOVLW 0x86
    150. CALL L_D_WRITE
    151. NOP
    152.  
    153. CALL DELAY_NOISE
    154. ;DISP ON/OFF
    155. MOVLW 0x59
    156. CALL L_C_WRITE
    157. NOP
    158.  
    159. ;CSR DIR
    160. MOVLW 0x4C
    161. CALL L_C_WRITE
    162. NOP
    163.  
    164. ;MWRITE
    165. MOVLW 0x42
    166. CALL L_C_WRITE
    167. NOP
    168. MOVLW 0x20
    169. CALL L_D_WRITE
    170. NOP
    171. MOVLW 0x45
    172. CALL L_D_WRITE
    173. NOP
    174. MOVLW 0x50
    175. CALL L_D_WRITE
    176. NOP
    177. MOVLW 0x53
    178. CALL L_D_WRITE
    179. NOP
    180. MOVLW 0x4F
    181. CALL L_D_WRITE
    182. NOP
    183. MOVLW 0x4E
    184. CALL L_D_WRITE
    185. NOP
    186.  
    187.  
    188.  
    189. LOP
    190. GOTO LOP
    191.  
    192. QQQ
    193. MOVLW 0x20
    194. CALL L_D_WRITE
    195. NOP
    196. RETURN
    197. QQQQ
    198. MOVLW 0x00
    199. CALL L_D_WRITE
    200. NOP
    201. RETURN
    202.  
    203. WWW
    204. MOVLW 0xFF
    205. MOVWF REG2
    206. CALL QQQ
    207. DECFSZ REG2,F
    208. GOTO $-2
    209. MOVLW 0xFF
    210. MOVWF REG2
    211. CALL QQQ
    212. DECFSZ REG2,F
    213. GOTO $-2
    214. MOVLW 0xFF
    215. MOVWF REG2
    216. CALL QQQ
    217. DECFSZ REG2,F
    218. GOTO $-2
    219. MOVLW 0xFF
    220. MOVWF REG2
    221. CALL QQQ
    222. DECFSZ REG2,F
    223. GOTO $-2
    224. RETURN
    225.  
    226.  
    227.  
    228. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~DISPLAY DATA AND CURSOR ADDRESS READ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    229.  L_C_WRITE
    230.  BANK3
    231. ;  MOVF   TEMP_COMMAND,W
    232.   BCF    PORTG,0      ; CS
    233.    BSF    PORTG,1      ; A0
    234.   BCF    PORTG,2      ; R/W
    235.   BSF    PORTG,3      ; E
    236.   MOVWF  PORTF
    237.   NOP
    238.   BCF    PORTG,3      ; E
    239.   NOP
    240.   RETURN
    241.  
    242. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~DISPLAY DATA AND CURSOR ADDRESS READ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    243.  L_D_WRITE
    244.  BANK3
    245. ;  MOVF   TEMP_DATA,W
    246.   BCF    PORTG,0      ; CS
    247.    BCF    PORTG,1      ; A0
    248.   BCF    PORTG,2      ; R/W
    249.   BSF    PORTG,3      ; E
    250.   MOVWF  PORTF
    251.   NOP
    252.   BCF    PORTG,3      ; E
    253.   NOP
    254.   RETURN
    255.  
    256. ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~LCD DELAY~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    257.  LCD_DELAY ;10ms
    258.      MOVLW D'10' ;Y --> 10*10^-3=(Y*[(3*256+4)+1]*10^-6 --> Y~10  2 KATAXORITES (0.2sec max)
    259.      MOVWF LCD_DELAY1
    260.   ;$-5
    261.      MOVLW D'256' ;X
    262.      MOVWF LCD_DELAY2
    263.  ;$-1
    264.      DECFSZ LCD_DELAY2,1
    265.   GOTO $-1
    266.       DECFSZ LCD_DELAY1,1
    267.   GOTO $-5
    268.  RETURN
    269.  
    270.  END
     
  2. dXri

    Thread Starter New Member

    Oct 4, 2010
    3
    0
    Hello. Could anyone tell me who can i avoid the 4 times displaying EPSON and other characters in the LCD.

    Regards dXri.
     
Loading...