PDA

View Full Version : Syntax SEROUT2 and SERIN2 commands



crocodilebobbie
- 6th October 2005, 04:39
Hi:

I cannot get the SEROUT2 and SERIN2 commands to compile. No matter what
the settings are.

I am able to get SEROUT and SERIN to work. I am transmitting a voltage/count from a PIC 16F684 to a PIC 16F877A output on LCD.

command on 16F877A
SERIN PortC.0, T300, [170, 170, TempIn]

command on 16F684
SEROUT portC.0, T300, [170,170], TempOut is the syntax.

The voltage count is displayed on a 4x20 LCD, but the result is always,
64, 128, which is binary 100000, and 1000000. Anyone, some ideas on how to make this simple setup work flawlessly?

bobbie

hawk72500
- 6th October 2005, 15:35
INCLUDE "modedefs.bas"
TRISB=%00000010
B0 VAR BYTE


loop:
SerOut2 PORTB.0,84,["Put a number",13,10]
SerIn2 PORTB.1,84,[DEC B0]
SerOut2 PORTB.0,84,["I took number:",DEC B0,13,10]

GoTo loop

------------------------------
For me this code has worked.You must connect your serial port with PORTB.0
and PORTB.1 with your computer.If you open terminal (Start->Accesories->Communications->Hyperterminal and set up a communication of 9600 (that means the number 84 in the above code) you must see "Put a number".

I don;t know if i helped you....