11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PICBASIC</strong> <strong>PLUS</strong> Compiler5.61. RSINSyntax : Variable = RSIN , { Timeout Label }orRSIN { Timeout Label }, Variable { , Variable...}Overview :Operators :Example :Receive one or more bytes from a predetermined pin at a predeterminedbaud rate in standard asynchronous format using 8 data bits,no parity and 1 stop bit (8N1). The pin is automatically made an input.Variable can be any user defined variable.An optional Timeout Label may be included to allow the program tocontinue if a character is not received within a certain amount of time.Timeout is specified in units of 1 microsecond and is specified by usinga DECLARE directive.DECLARE RSIN_TIMEOUT 20000 ‘ Timeout after 20msDIM Var as BYTEDIM Wrd as WORDVar = RSIN , {Label}RSIN Var , WrdRSIN { Label } , Var , WrdLabel: { do something when timed out }Declares : There are four DECLARES for use with RSIN. These are : -DECLARE RSIN_PIN PORT . PINAssigns the Port and Pin that will be used to input serial data by theRSIN command. This may be any valid port on the PIC.If the DECLARE is not used in the program, then the default Port andPin is PortB.1.DECLARE RSIN_MODE INVERTED , TRUE or 1 , 0Sets the serial mode for the data received by RSIN. This may be invertedor true. Alternatively, a value of 1 may be substituted to representinverted, and 0 for true.If the DECLARE is not used in the program, then the default mode isINVERTED.DECLARE SERIAL_BAUD 0 to 65535 bps (baud)Informs the RSIN and RSOUT routines as to what baud rate to receiveand transmit data.113Copyright Crownhill 2001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!