using SERIN to read keypad on LK204-25
rhugg
Posts: 14
Having a curious problem reading data from an LK204-25 LCD display/keypad interface from Matrix Orbital. I can read the version number and type of display, buy not when trying to read the keypad:
SEROUT ioA8Tx,LCDBaud,[noparse][[/noparse]254]
SEROUT ioA8Tx,LCDBaud,[noparse][[/noparse]79]··· 'AUTO keypress off
SEROUT ioA8Tx,LCDBaud,[noparse][[/noparse]254]· 'poll for a character
SEROUT ioA8Tx,LCDBaud,[noparse][[/noparse]38]
SERIN ioA9rx, LCDBAUD, [noparse][[/noparse]value] 'tried several·variants of this, including timeouts etc
DEBUG HEX value," was read"
but the above lines hang when trying to read the keypad. from what i can tell, SERIN needs to be terminated by a non-numeric character, is this a possibility. i have it in my mind that it the BSP40 that i am using is reading the byte, then waiting for a termination character that never arrives.
Any insightss? - thanks
SEROUT ioA8Tx,LCDBaud,[noparse][[/noparse]254]
SEROUT ioA8Tx,LCDBaud,[noparse][[/noparse]79]··· 'AUTO keypress off
SEROUT ioA8Tx,LCDBaud,[noparse][[/noparse]254]· 'poll for a character
SEROUT ioA8Tx,LCDBaud,[noparse][[/noparse]38]
SERIN ioA9rx, LCDBAUD, [noparse][[/noparse]value] 'tried several·variants of this, including timeouts etc
DEBUG HEX value," was read"
but the above lines hang when trying to read the keypad. from what i can tell, SERIN needs to be terminated by a non-numeric character, is this a possibility. i have it in my mind that it the BSP40 that i am using is reading the byte, then waiting for a termination character that never arrives.
Any insightss? - thanks
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I would consolidate your SEROUT statements…By using SEROUT so many times you will waste valuable program memory.
SEROUT ioA8Tx, LCDBaud, [noparse][[/noparse]254, 79] 'AUTO keypress off
SEROUT ioA8Tx, LCDBaud, [noparse][[/noparse]254, 38] 'poll for a character
Of course, on the second line I would recommend doing this different…You set the mode at the beginning of your program. You poll when ready for the key press. Waiting for a non-numeric value has nothing to do with your code. You’re not using a formatter that requires that. The I/O lines you’re using on the BS2p40, are they on the MAIN or AUX ports?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support