PDA

View Full Version : serin,serout



andrewwaack
- 7th July 2006, 17:50
can any one give me the correct syntax and expressions for serin and serout
any help would be great

DynamoBen
- 7th July 2006, 18:24
This information is in the user manual.

http://www.melabs.com/resources/pbpmanual/


Is there something specific you are trying to do that isn't working?

andrewwaack
- 8th July 2006, 00:00
that is where the code i am useing came from
i use 16f84a pics
microcode studio and pic basic pro
it is incorect according to microcode
this is driving me crazzy keep geting bad expresion errors

thanks andrew

DynamoBen
- 8th July 2006, 00:05
OK so you're having an issue with the example code.

Can you post the code you have, we can then review it for errors or problems?

andrewwaack
- 8th July 2006, 11:59
here is the example code

' SERIN & SEROUT Commands
'
' Upper case serial filter.

Include "modedefs.bas" ' Include serial modes

SO con 0 ' Define serial out pin
SI con 1 ' Define serial in pin
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

thanks for any help

Christopher4187
- 8th July 2006, 14:56
I would try something like this:

Include "modedefs.bas" ' Include serial modes

SO var portb.0 ' Define serial out pin <-------You have to define a port
SI var portb.1 ' Define serial in pin <--------You have to define a port
B0 var byte

loop:
Serin SI,396,[B0]' B0 = input character
If (B0 < "a") or (B0 > "z") Then ' If lower case, convert to upper
B0 = B0 - $20
endif
Serout SO,396,[B0] ' Send character <------You don't need print command
Goto loop ' Forever


Try this and see what happens.

Chris

andrewwaack
- 8th July 2006, 19:21
finally the write code for serin\out thanks for all your help