|
ME Labs, Inc. 719-520-5323 |
|
|
|
ME Labs, Inc. | 1-719-520-5323 | Example Program - HSERX18.pbpPICBASIC PRO program to Send and receive from the hardware serial port. LED counts characters and flashes error if none received for 10 seconds.' Name : HSERX18.pbp
' Compiler : PICBASIC PRO Compiler 2.6
' Assembler : PM or MPASM
' Target PIC : PIC16F88 or similar
' Hardware : LAB-X18 Experimenter Board
' Oscillator : 4MHz external crystal
' Keywords : HSERIN, HSEROUT
' Description : PICBASIC PRO program to Send and receive from the hardware
' serial port. LED counts characters and flashes error if none received for
' 10 seconds.
'
char Var Byte ' Storage for serial character
led Var PORTB.0 ' Alias LED pin
TRISB = %11111110 ' Set PORTB.0 to output
LED = 0 ' Turn off LED
loops:
Hserin 10000, allon, [char] ' Get a char from serial port
Hserout [char] ' Send char out serial port
TOGGLE led ' Toggle LED
Goto loops ' Do it all over again
allon:
HIGH led ' Error - no character received
Pause 500 ' Blink LED
LOW led
Pause 500
Goto allon
End
Download the program file. |
|
Copyright 2022 ME Labs, Inc. PO Box 8250 Asheville NC 28814 (719) 520-5323 (719) 520-1867 fax email: support@melabs.com |
|