Keyboard to serial ASCII converter
To avoid re-inventing the wheel, I thought I would ask:
Has anyone written code to translate a PC keyboard data stream to ascii?·(KB -> serail ASCII)·I would like to have that option available instead of doing via my computer.
I have done searches without success.
Thanks
Chet
Has anyone written code to translate a PC keyboard data stream to ascii?·(KB -> serail ASCII)·I would like to have that option available instead of doing via my computer.
I have done searches without success.
Thanks
Chet
Comments
Micro Datapad entry: http://forums.parallax.com/showthread.php?p=736766
PS/2 Keyboard entry: http://forums.parallax.com/showthread.php?p=737546
I have also used the PC with Hyperterminal and the SX chips.
Thanks again
Chet
I tried using the "keyboartest_with _ascii_output.src but could not figure out how to bypass writing to the LCD in parallel mode.· What change in the code is required to get the ascii output to go to a serial output so I can send it straight to the 4x20 parallax LCD?· I cannot figure out how to get the ascii code and use it in sxbasic to do a serial send to the LCD.
I have uploaded the file in question for reference.
Any help is highly appreciated
Chet·
Is the problem that you can't figure out how to bypass writing to the LCD, or is the problem that you want to make the changes to an assembly language program using SX/B?
Thanks,
PeterM
Thanks for your time.
Regards
Chet
http://forums.parallax.com/showthread.php?p=737546
Regards
Chet
Modified keyboardtest_with_ascii_output as follows:
device sx28,osc4mhz,turbo,stackx,optionx
freq·4_000_000
irc_cal·irc_slow
LCD_PIN··PIN· ·RA.2 output
KEY_ASC··VAR·BYTE
LCD_OUT··SUB·1
program start
start:
goto jump_in
SUB LCD_OUT
key_asc = __param1
watch __param1, 8, uhex
watch key_asc, 8, uhex
break
serout LCD_PIN, n19200, key_asc
return
JUMP_IN:
ASM
key equ $0C
temp equ $0D
temp2 equ $0E
stat equ $0F
main2
mode $0f
mov stat,#0
call keyreset··'reset the keyboard
main
call scankey··'Gets one key
call NCS··'Sets Num, Caps, or Scroll lock in var stat
cja key,#$90,main
mov w,key
jmp @go2it
back2it
mov key,w
cje key,#0,main··'jump to main if key is 0
watch key, 8, uhex
call LCD_OUT··'Prints to LCD
jmp main
Remaining code for non-lcd remains the same.
Can I impose one more time...?
Thanks
Chet
Thanks for you patience
Chet