comparison code_part1/OSTC_code_asm_part1/display_lowlevel.asm @ 835:30136fc61392

Change power-off sequence
author heinrichsweikamp
date Sun, 30 Dec 2018 18:13:42 +0100
parents 2a0e5d884fc3
children b317df6bc367
comparison
equal deleted inserted replaced
834:f8afe90796d6 835:30136fc61392
247 247
248 ; ----------------------------- 248 ; -----------------------------
249 ; DISP Display Off 249 ; DISP Display Off
250 ; ----------------------------- 250 ; -----------------------------
251 DISP_DisplayOff: 251 DISP_DisplayOff:
252 rcall DISP_ClearScreen 252 rcall DISP_ClearScreen
253
254 movff win_flags,WREG ; Display0? win_flags is in bank0...
255 btfss WREG,1 ; Display0?
256 bra DISP_DisplayOff_display0 ; Yes
257
258 ; Display 1
253 clrf PORTD 259 clrf PORTD
254 bcf DISPLAY_hv 260 bcf DISPLAY_hv
255 bcf DISPLAY_vdd
256 bcf DISPLAY_cs 261 bcf DISPLAY_cs
257 bcf DISPLAY_e_nwr 262 bcf DISPLAY_e_nwr
258 bcf DISPLAY_rw 263 bcf DISPLAY_rw
259 bcf DISPLAY_rs 264 bcf DISPLAY_rs
260 bcf DISPLAY_nreset 265 bcf DISPLAY_nreset
266 bcf DISPLAY_vdd
261 return 267 return
268
269 DISP_DisplayOff_display0:
270 movlw 0x05
271 rcall DISP_CmdWrite
272 movlw 0x00
273 rcall DISP_DataWrite
274 movlw 0x00
275 rcall DISP_DataWrite
276 WAITMS d'32'
277 bcf DISPLAY_hv
278 WAITMS d'32'
279 movlw 0x10
280 rcall DISP_CmdWrite
281 movlw 0x00
282 rcall DISP_DataWrite
283 movlw 0x01
284 rcall DISP_DataWrite
285 WAITMS d'100'
286 clrf PORTD
287 bcf DISPLAY_cs
288 bcf DISPLAY_e_nwr
289 bcf DISPLAY_rw
290 bcf DISPLAY_rs
291 bcf DISPLAY_nreset
292 WAITMS d'10'
293 bcf DISPLAY_vdd
294 return
295
262 296
263 ;============================================================================= 297 ;=============================================================================
264 ; Fast macros to write to DISPLAY display. 298 ; Fast macros to write to DISPLAY display.
265 ; Adding a call/return adds 3 words and a pipeline flush, hence make it 299 ; Adding a call/return adds 3 words and a pipeline flush, hence make it
266 ; nearly twice slower... 300 ; nearly twice slower...