PDA

View Full Version : Need help or idea how to



phoenix_1
- 16th May 2008, 15:49
I use 16f877 and 4x4 matrix keyboard with rutine by mister_e.
Also I use Hardware usart in PicMicro for rx-tx data to PC .
Program work on next way:
User use 4x4 keyboard and if he press key PicMicro send at that moment No:. of key from 1 to 16,taht work extra,when PC receive key No:. it return some word with index like these "128DOG" Becouse 4x20 LCD what I use have locations for chr from 128 -231 it simple to PicMicro know where must display word "DOG" .

Question hove to I thel Pic in same time when user type on keyboard to data is received from PC when I know to PicMicro can't work multitasking !

All thing must work like PC terminal and PC never send more then 8 chr to PicMicro.
Like "128ABCDE" include position in front word like you see.

Any suggest are welcome .

Regards Robert

mister_e
- 16th May 2008, 18:19
This will be a time slicing thingy. You could use a Timer interrupt to scan the Keyboard (look for SCAN_ONCE in my routine) + Usart interrupt for RX.

OR simply USART RX interrupt.

phoenix_1
- 16th May 2008, 18:50
Can you give me short example please.
For now you always give extra good ideas and help then one time more ;-).

When I finish project I will give it full for all with hardvare and software I promice that.
Maybe someone will need same as me.
I need that terminal becouse I dont have place for standard monitor or pc lcd and classic keyboard where i use pc for some job that is core of my problem.

mackrackit
- 17th May 2008, 04:47
I have not used USART interrupts myself yet, but these might get you started.
http://darreltaylor.com/DT_INTS-18/
http://www.microengineeringlabs.com/resources/samples/x1/pbp/serbufx.bas
http://www.melabs.com/resources/samples/pbp/usart.bas
http://www.picbasic.co.uk/forum/showthread.php?t=8089&highlight=serial+interrupt