Загрузка данных


ch455g_work_handler(43) raw_code=0x5C
ch455g_work_handler(49) dig=3 seg=4
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x54
ch455g_work_handler(49) dig=2 seg=4
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x4C
ch455g_work_handler(49) dig=1 seg=4
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x44
ch455g_work_handler(49) dig=0 seg=4
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x5F
ch455g_work_handler(49) dig=3 seg=7
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x57
ch455g_work_handler(49) dig=2 seg=7
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x4F
ch455g_work_handler(49) dig=1 seg=7
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x47
ch455g_work_handler(49) dig=0 seg=7
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x5E
ch455g_work_handler(49) dig=3 seg=6
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x56
ch455g_work_handler(49) dig=2 seg=6
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x4E
ch455g_work_handler(49) dig=1 seg=6
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x46
ch455g_work_handler(49) dig=0 seg=6
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x5D
ch455g_work_handler(49) dig=3 seg=5
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x55
ch455g_work_handler(49) dig=2 seg=5
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x4D
ch455g_work_handler(49) dig=1 seg=5
ch455g_gpio_callback(70)
ch455g_work_handler(40)
ch455g_work_handler(43) raw_code=0x45
ch455g_work_handler(49) dig=0 seg=5


5.3. Keyboard scan 
The  function  of  keyboard  scan  supports  28-key  keyboard  which  is  7 ×4  matrix.  During  the 
keyboard scan period, DIG3 to DIG0 are used to column scan output, the  pins of SEG6 to SEG0 
are all have pull-down resister internal, used to row scan input. 
CH455 insert the keyboard scan regularly during display drive scan. During keyboard scan, 
DIG3 to DIG0 output high level in turns according DIG0 to DIG3, the other pins output low level; 
the output of SEG6~SEG0 are forbidden, when there is no key pressed, SEG6~SEG0 are pulled to 
low level; when there is a  key  pressed, such as the key connect DIG1 to  SEG4 is pressed, DIG1 
output  high  level  and  SEG4  has  checked  high  level;  in  order  to  avoid  the  environment,  CH455 
will  scan  twice,  and  once  the  two  result  is  the  same,  the  key  press  is  efficient.  If  CH455  has 
checked  the  efficient  key-press,  take  a  record  of  the  key-press  code,  and  generate  the  keyboard 
interrupt  which  active  with  low  level  via  INT#,  at  the  same  time,  MCU  can  read  the  key-press 
code  via  serial  interface;  before  checking  the  efficient  key-press,  CH455  will  not  generate  any 
keyboard  interrupt.  CH455  doesn’t  support  the  assembled  key-press;  it  means  that,  two  keys  or 
more  keys  can  not  be  pressed  at  the  same  time.  CH455  supports  combination  key  of  SEG1  and 
SEG0 for the same DIG, the combination  key  has the  priority. In additional, if two  keys  or  more 
keys  are  pressed,  the  key  with  lower  code  has  the  priority.  For  example,  the  two  keys  which 
connection of DIG1 with SEG1, and connection of DIG1 and SEG0, are combination key. 
The key-press code supplied by CH455 has 8 bits, the bit-7 is always 0 and bit-2 is 1, bit1 to 
bit 0 is column scan code, bit5 to bit3 is row scan code, bit 6 is state code (press key is 1, release 
key  is  0).  For  example,  the  key  connects  DIG1  to  SEG4  is  pressed,  the  key-press  code  is 
01100101B or 65H, when the key is released, the key-press code is 00100101B or 25H (maybe is 
other code, but the value is lower than 40H). The column scan code is 01B responding  to DIG1, 
the row scan code is 100B responding to SEG4. MCU can read the key-press code at any time, in 
generally,  after  checking  the  efficient  key-press,  generating  keyboard  interrupt,  then  read  the 
key-press  code.  At  this  time,  the  bit6  is  always  1.  MCU  can  read  the  key-press  code  via  check 
mode to know when the key is released, till the bit6 is 0. 
The  following  table is  key-press address  of DIG3~DIG0 and  SEG6~SEG0, also is numeric 
LED segment bit and LED array address. The  key-press  code is 8-bit, the bit-6 is always 1 when 
press  key.  When  key  is  pressed,  the  actual  key-press  code  is  the  following  address  adds  40H,  it 
means that the key-press code is between 44H and 77H.