PDA

View Full Version : How to apply waiting time for capture data from serial port



din_kt
- 4th October 2007, 09:05
I want capture hex code (FE CA) from another pic using serin command.


B1 = First Byte
B2 = Second Byte



command for Sending : Serout TX_t,t9600,[$FE,$CA]

command for capture : Serin RX_r,t9600,B1
Serin RX_r,t9600,B2

so.... B1 = FE and B2 = CA

For this situation after sending FE CA, This PIC will receive FE CA for a 30 second, if done portb0. = high or if fail portb.1 = high.

mister_e
- 4th October 2007, 16:52
Which PIC are you going to use?

What else this PIC will do in meantime?

din_kt
- 5th October 2007, 02:44
Im using PIC 16F84A,

I think not do anything in the waiting time, just wait until 30 second.

mister_e
- 5th October 2007, 03:14
Will the 16F84A die one day? :D

Ok, well, the only thing i could suggest, even if it really don't turn me on is to do a loop and use the Timeout feature of SERIN or SERIN2 or DEBUGIN. Almost the same thing we talked about in your previous thread...
http://www.picbasic.co.uk/forum/showthread.php?t=7218

except you don't need any PAUSE, SERIN will do it for you. Read the whole SERIN or SERIN2 or DEBUGIN sections of your manual.

din_kt
- 5th October 2007, 10:25
Ok...using the previous thread....but where want to paste this serin command...
(Serin RX_r,t9600,B1)