Jump to content



Photo
- - - - -

fx-CG50 Reading the Keys


  • Please log in to reply
No replies to this topic

#1 Insoft

Insoft

    Newbie

  • Members
  • Pip
  • 1 posts

  • Calculators:
    Ti-83, CASIO fx-CG50, HP Prime

Posted 02 April 2024 - 06:41 PM

I'm currently examining the `keyboard_register = (unsigned short*)0xA44B0000` line and I'm interested in understanding how CASIO handles keyboard inputs. Specifically, I'm curious if it registers both key presses and releases. I've managed to decipher some aspects of its functionality, I would greatly appreciate any additional insights from anyone familiar with this aspect, as it would help expedite my understanding.

 

 

The Casio fx-CG50, like many calculators and embedded systems, handles key presses
at a low level through direct memory access (DMA) to a specific memory-mapped register.
Each key on the calculator corresponds to a specific bit or set of bits within this
register.

 

When a key is pressed, the corresponding bit or bits in the register are set
to indicate the key press event. Conversely, when a key is released, the corresponding
bit or bits are cleared to indicate the key release event.


                                                                 Row : 16-bit (reg 0-4)
     +-------------------------------------------------------------+
     |   [F1]    [F2]    [F3]    [F4]    [F5]    [F6]              | 9 = (4)
     |                                                             |
     |   [SHIFT] [OPTN]  [VARS]  [MENU]  [LEFT]  [ UP ]            | 8 = (4)
     |                                                             |
     |   [ALPHA] [X^2]   [x√]    [EXIT]  [DOWN]  [RIGHT]           | 7 = (3)
     |                                                             |
     |   [A]     [LOG]   [LN]    [SIN]   [COS]   [TAN]             | 6 = (3)
     |                                                             |
     |   [abc]   [S<>D]  [(]     [)]     [,]    [-->]              | 5 = (2)
     |                                                             |
     |   [7]     [8]     [9]     [DEL]                             | 4 = (2)
     |                                                             |
     |   [4]     [5]     [6]     [x]     [/]                       | 3 = (1)
     |                                                             |
     |   [1]     [2]     [3]     [+]     [-]                       | 2 = (1)
     |                                                             |
     |   [0]     [.]     [PI]    [(-)]   [EXE]                     | 1 = (0)
     |                                                             |
     |                                                   [AC/ON]   | 0 = (0)
     +-------------------------------------------------------------+
  Col    7       6       5       4       3       2       1

*Bit    9       10      11      12      13      14      15
**Bit    1       2       3       4       5       6       7

* When Row is even
** When Row is odd

Edited by Insoft, 05 April 2024 - 10:27 PM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users