PDA

View Full Version : SEROUT2 and SERIN2 commands



bangunprayogi
- 4th August 2005, 07:14
Hi, I have some quetions about the use of serin2 and serout2 commands:
1). I have circuit with master-slave connection (both are PIC16F84A),

The slave will send characters in string format just like:
SEROUT2, So, 396,("13201150")
And the master will receive that characters with SERIN2, such:
SERIN2, Si, 396,[wait ("13201150"), B0)
Then I want to display the value of B0 (should is "13201150") with

command:
LCDOUT $fe,1
LCDOUT #B0
But it is failed. The result on display is just like the ASCII value.

Do i make some mistakes here?
2). I have find out that the SEROUT2 and SERIN2 command can send and

receive one character only.If in slave I use command:
SEROUT2, So, 396,("a")
Then in master I use command:
SERIN2, Si, 396,[wait ("a"), B0]
And on LCD I use:
LCDOUT $fe,1
LCDOUT B0 ------->>> WITHOUT #
Then it does work well. Can someone explain it?
3) I want an example of the using of WAITSTR ArrayVar command....
4) Can the master received some characters only?Such us: if I want

that the master received the value of characters from "a" to "j" only,

so while the slave send character that out of range the value, then it

will be denied, and viceversa.what the SERIN2 command in master will

gonna be?
Thanks guys....

SuB-ZeRo
- 4th August 2005, 09:03
I am a beginner too but i can explain what # do
if u put a # infront of a value or a String the chip will send the characters in ASII format.See the ASII format table.