comparison code_part1/OSTC_code_asm_part1/oled_samsung.asm @ 150:fc699a7460e6

Fix desat graph: + clean right part, to allow decreasing animation. + In divemode, show every 10 seconds.
author JeanDo
date Mon, 10 Jan 2011 02:57:59 +0100
parents c09b0be2e1e6
children cb055a7d75f3
comparison
equal deleted inserted replaced
149:55a763d514ed 150:fc699a7460e6
355 PLED_box: 355 PLED_box:
356 ;---- Define Window ------------------------------------------------------ 356 ;---- Define Window ------------------------------------------------------
357 movff win_width,WREG 357 movff win_width,WREG
358 bcf STATUS,C 358 bcf STATUS,C
359 rlcf WREG 359 rlcf WREG
360 movwf aa_width 360 movwf aa_width+0
361 movlw 0 361 movlw 0
362 rlcf WREG 362 rlcf WREG
363 movwf aa_width+1 363 movwf aa_width+1
364 rcall PLED_box_write 364 rcall PLED_box_write
365 365
366 ;---- Fill Window -------------------------------------------------------- 366 ;---- Fill Window --------------------------------------------------------
367 movlw 0x22 ; Start Writing Data to GRAM 367 movlw 0x22 ; Start Writing Data to GRAM
368 rcall PLED_CmdWrite 368 rcall PLED_CmdWrite
369 369
370 movff win_width,PRODH 370 clrf PRODH ; Column counter.
371 bsf oled_rs ; Data! 371 bsf oled_rs ; Data!
372 372
373 PLED_box2: ; Loop height times 373 PLED_box2: ; Loop height times
374 movff win_height,PRODL 374 movff win_height,PRODL
375 PLED_box3: ; loop width times 375
376 PLED_box3: ; loop width times
376 movff win_color1,PORTD 377 movff win_color1,PORTD
377 bcf oled_rw 378 bcf oled_rw
378 bsf oled_rw ; Upper 379 bsf oled_rw ; Upper
379 movff win_color2,PORTD 380 movff win_color2,PORTD
380 bcf oled_rw 381 bcf oled_rw
381 bsf oled_rw ; Lower 382 bsf oled_rw ; Lower
382 383
383 movff win_color1,PORTD 384 movff win_color1,PORTD
384 bcf oled_rw 385 bcf oled_rw
385 bsf oled_rw ; Upper 386 bsf oled_rw ; Upper
386 movff win_color2,PORTD 387 movff win_color2,PORTD
387 bcf oled_rw 388 bcf oled_rw
388 bsf oled_rw ; Lower 389 bsf oled_rw ; Lower
389 390
390 decfsz PRODL,F 391 decfsz PRODL,F ; row loop finished ?
391 bra PLED_box3 392 bra PLED_box3 ; No: continue.
392 decfsz PRODH,F 393
393 bra PLED_box2 394 incf PRODH,F ; column count ++
394 395
395 movlw 0x00 ; NOP, to stop Address Update Counter 396 movff win_bargraph,WREG ; current column == bargraph ?
396 bra PLED_CmdWrite ; returns... 397 cpfseq PRODH
398 bra PLED_box4 ; No: just loop.
399
400 clrf WREG ; Yes: switch to black
401 movff WREG,win_color1
402 movff WREG,win_color2
403 PLED_box4:
404 movff win_width,WREG
405 cpfseq PRODH
406 bra PLED_box2
407
408 movlw 0x00 ; NOP, to stop window mode
409 rcall PLED_CmdWrite
410
411 setf WREG ; Reset bargraph mode...
412 movff WREG,win_bargraph
413 return
397 414
398 ;============================================================================= 415 ;=============================================================================
399 ; PLED_ClearScreen: An optimized version of PLEX_box, for full screen black. 416 ; PLED_ClearScreen: An optimized version of PLEX_box, for full screen black.
400 ; Trashed: WREG, PROD 417 ; Trashed: WREG, PROD
401 418
425 442
426 movlw 0x21 ; Start Address Vertical (.0 - .319) 443 movlw 0x21 ; Start Address Vertical (.0 - .319)
427 rcall PLED_CmdWrite 444 rcall PLED_CmdWrite
428 rcall PLED_DataWrite_PROD 445 rcall PLED_DataWrite_PROD
429 446
430 movlw 0x22 ; Start Writing Data to GRAM 447 movlw 0x22 ; Start Writing Data to GRAM
431 rcall PLED_CmdWrite 448 rcall PLED_CmdWrite
432 449
433 ; See Page 101 of OLED Driver IC Datasheet how to handle rs/rw clocks 450 ; See Page 101 of OLED Driver IC Datasheet how to handle rs/rw clocks
434 bsf oled_rs ; Data! 451 bsf oled_rs ; Data!
435 452
436 movlw .160 453 movlw .160
437 movwf PRODH 454 movwf PRODH
438 PLED_ClearScreen2: 455 PLED_ClearScreen2:
439 movlw .240 456 movlw .240
440 movwf PRODL 457 movwf PRODL
441 PLED_ClearScreen3: 458 PLED_ClearScreen3:
442 459
443 clrf PORTD ; Need to generate trace here too. 460 clrf PORTD ; Need to generate trace here too.
444 bcf oled_rw 461 bcf oled_rw
445 bsf oled_rw ; Upper 462 bsf oled_rw ; Upper
446 463
447 clrf PORTD ; Need to generate trace here too. 464 clrf PORTD ; Need to generate trace here too.
448 bcf oled_rw 465 bcf oled_rw
449 bsf oled_rw ; Lower 466 bsf oled_rw ; Lower
450 467
451 clrf PORTD ; Need to generate trace here too. 468 clrf PORTD ; Need to generate trace here too.
452 bcf oled_rw 469 bcf oled_rw
453 bsf oled_rw ; Upper 470 bsf oled_rw ; Upper
454 471
455 clrf PORTD ; Need to generate trace here too. 472 clrf PORTD ; Need to generate trace here too.
456 bcf oled_rw 473 bcf oled_rw
457 bsf oled_rw ; Lower 474 bsf oled_rw ; Lower
458 475
459 decfsz PRODL,F 476 decfsz PRODL,F
460 bra PLED_ClearScreen3 477 bra PLED_ClearScreen3
461 decfsz PRODH,F 478 decfsz PRODH,F
462 bra PLED_ClearScreen2 479 bra PLED_ClearScreen2