PDA

View Full Version : serin question?



sachymo
- 26th July 2008, 13:04
Hi

I have learned recently that "Serin" does not have a buffer therefore it needs some time to decode the data it receives. If I have multiple serin sequences one after the other, how long do I need to wait in order for the code to be received correctly. Below is an example of what I am asking:

SerIn porta.0, T2400, Data1
delayms ???
SerIn porta.1, T2400, Data2
delayms ???
SerIn porta.2, T2400, Data3
delayms ???

Continue with code*********

skimask
- 26th July 2008, 18:48
SerIn porta.0, T2400, Data1
delayms ???
SerIn porta.1, T2400, Data2
delayms ???
SerIn porta.2, T2400, Data3
delayms ???


Try this statement:
Proton Basic <> MeLabs PicBasicPro

sachymo
- 26th July 2008, 21:43
Maybe I should reiterate what I asked:

Hi

I have learned recently that "Serin" does not have a buffer therefore it needs some time to decode the data it receives. If I have multiple serin sequences one after the other, how long do I need to wait in order for the code to be received correctly. Below is an example of what I am asking:

SerIn porta.0, T2400, Data1
pause ???
SerIn porta.1, T2400, Data2
pause ???
SerIn porta.2, T2400, Data3
pause ???

Continue with code*********

gringobomba14
- 26th July 2008, 21:47
I would suggest that that PIC won't carry on to the next instruction until it has finished dealing with the previous one.
IF I'm wrong I'm sure Ski will dive in and let me know in some spectacular fashion

skimask
- 26th July 2008, 23:01
I would suggest that that PIC won't carry on to the next instruction until it has finished dealing with the previous one.
IF I'm wrong I'm sure Ski will dive in and let me know in some spectacular fashion
Nope, you're 100% right...for most (like 99.9%) cases.
If you've got any assembly going on, for instance DT's Instant Interrupt's, they might get a chance to execute in the middle of most PBP commands, but otherwise, one statement at a time.

Maybe I should reiterate what I asked:
I have learned recently that "Serin" does not have a buffer therefore it needs some time to decode the data it receives. If I have multiple serin sequences one after the other, how long do I need to wait in order for the code to be received correctly. Below is an example of what I am asking:
SerIn porta.0, T2400, Data1
pause ???
SerIn porta.1, T2400, Data2
pause ???
SerIn porta.2, T2400, Data3
pause ???
Continue with code*********
SERIN hardly needs any time to decode anything, maybe if you're using some of the SERIN/SERIN2 modifiers, those might need a few instruction cycles to execute.
But any 'decoding' that needs to be done needs to be done by the person behind the keyboard.
SERIN doesn't know A from B, doesn't know that it needs to jump to here if it gets an A, or set this to that if it receives a B. That's all you. It's up to you to figure out how to receive data continuously and how to process it without missing any data coming in.

sachymo
- 27th July 2008, 10:04
Thankyou, that has made things clearer