-
how to use SERIN???
i try to send data from vb to pic16f877a using serial port.can i use those code below???
code:
SO con 0 ' Define serial out pin
SI con 1 ' Define serial in pin
N2400 con 4 ' Set serial mode
B0 var byte
loop:
Serin SI,N2400,B0 ' B0 = input character
If (B0 < "a") or (B0 > "z") Then print ' If lower case, convert to upper
B0 = B0 - $20
print:
Serout SO,N2400,[B0] ' Send character
Goto loop ' Forever
can someone teach me how to setting the:
SO con 0 ' Define serial out pin
SI con 1 ' Define serial in pin
N2400 con 4 ' Set serial mode
B0 var byte
i use pic16f877a which the rx=portc.7 and tx=portc.6...
-
If you want to name a pin use var
And you will need [] in your SERIN statement.
And if you are using the software serial (SERIN, SERIN2) then any pin will work if it is digital, pretty much.
-
for example:
SO VAR portc.6 'tx pin for pic16f877a
SI VAR portc.7 'rx pin for pic16f877a
SERIN SI,N2400,["A"],B0 'Wait until the character “A” is received serially
am i correct???
-
-