83Plus:RAM:8447: Difference between revisions

From WikiTI
Jump to navigationJump to search
No edit summary
 
→Comments: example comments, linkage, use of 000B
 
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
'''Memory Address:''' 8447h
'''Memory Address:''' 8447h


'''Length:''' 1 byte.
'''Length:''' 1 byte


This area holds the system contrast value. When you press 2nd+Up or 2nd+Down while in a GetKey, GetKey automatically increases or decreases this value and updates the LCD's contrast. The accepted range of this value is 00h ~ 27h.
This area holds the system contrast value. When you press 2nd+Up or 2nd+Down while in a [[83Plus:BCALLs:4972|GetKey]], GetKey automatically increases or decreases this value and updates the LCD's contrast. The accepted range of this value is 00h ~ 27h.


== Comments ==
== Comments ==
Changing this value does not "instantly" update the LCD contrast; you must manually update the LCD. To set the LCD contrast to match the calculator's, add D8h to the read value and output to [[83Plus:Ports:10|Port 10h]]:
Changing this value does not "instantly" update the LCD contrast; you must manually update the LCD. To set the LCD contrast to match the calculator's, add D8h to the read value and output to [[83Plus:Ports:10|Port 10h]]:
  <nowiki> ld a, (contrast)
  ld a, (contrast)
  add a, 0D8h
  add a, 0D8h
  out (10h), a
CALL 000Bh ; Wait for LCD driver to be ready
CALL 000Bh ;Delay required time, or find some other way to waste/use 60 cycles.
  out [[83Plus:Ports:10|(10h)]], a
</nowiki>


This simple routine sets both the system contrast and the LCD contrast to whatever is in A (valid range is 00~27h, does nothing if out of range).
This simple routine sets both the system contrast and the LCD contrast to whatever is in A (valid range is 00~27h, does nothing if out of range).
  <nowiki> cp 28h
  cp 28h
  ret nc ;NC means >= which is bad, so bail out.
  ret nc ; return if the value given is >= 28h
  ld (contrast), a
  ld (contrast), a
  push af
  push af
  add a, 0D8h
  add a, 0D8h
  out (10h), a
CALL 000Bh ; Wait for LCD driver to be ready
  out [[83Plus:Ports:10|(10h)]], a
  pop af
  pop af
  ret
  ret
;Waste/Use ~45 cycles before accessing LCD directly.
</nowiki>

Latest revision as of 21:46, 21 April 2005

Synopsis

Official Name: contrast

Memory Address: 8447h

Length: 1 byte

This area holds the system contrast value. When you press 2nd+Up or 2nd+Down while in a GetKey, GetKey automatically increases or decreases this value and updates the LCD's contrast. The accepted range of this value is 00h ~ 27h.

Comments

Changing this value does not "instantly" update the LCD contrast; you must manually update the LCD. To set the LCD contrast to match the calculator's, add D8h to the read value and output to Port 10h:

ld a, (contrast)
add a, 0D8h
CALL 000Bh ; Wait for LCD driver to be ready
out (10h), a

This simple routine sets both the system contrast and the LCD contrast to whatever is in A (valid range is 00~27h, does nothing if out of range).

cp 28h
ret nc ; return if the value given is >= 28h
ld (contrast), a
push af
add a, 0D8h
CALL 000Bh ; Wait for LCD driver to be ready
out (10h), a
pop af
ret