Positron Compiler Documentation

Compiler commands and directives — quick reference

Positron8 · Revision 4.0.6.5 · PDF pages 115–118

Peripheral and Interfacing Commands

ADinRead the on-board Analogue to Digital Converter (ADC) peripheral.
BstartSend a Start condition to the I2C bus.
BstopSend a Stop condition to the I2C bus.
BrestartSend a Restart condition to the I2C bus.
BusAckSend an Acknowledge condition to the I2C bus.
BusNackSend an Not Acknowledge condition to the I2C bus.
BusinRead bytes from an I2C device.
BusoutWrite bytes to an I2C device.
ButtonDetect and debounce a key press.
CounterCount the number of pulses occurring on a pin.
DTMFoutProduce a DTMF Touch Tone note.
FreqoutGenerate one or two tones, of differing or the same frequencies.
HbStartSend a Start condition to the I2C bus using the MSSP module.
HbStopSend a Stop condition to the I2C bus using the MSSP module.
HbRestartSend a Restart condition to the I2C bus using the MSSP module.
HbusAckSend an Ack condition to the I2C bus using the MSSP module.
HbusNackSend a Not Ack condition to the I2C bus using the MSSP module.
HbusinRead from an I2C device using the MSSP module.
HbusoutWrite to an I2C device using the MSSP module.
High (PinHigh)Make a pin or port high.
HPWMGenerate PWM signals using the device’s CCP peripherals.
I2CinRead bytes from an I2C device with user definable SDA\SCL lines.
I2CoutWrite bytes to an I2C device with user definable SDA\SCL lines.
InkeyScan a matrix keypad.
Input (PinInput)Make a pin or port an input.

Output (PinOutput) Make a pin or port an output.

OreadReceive data from a device using the Dallas 1-wire protocol.
OwriteSend data to a device using the Dallas 1-wire protocol.
Low (PinLow)Make a pin or port low.
PotRead a potentiometer on specified pin using an RC method.
PinClearClear a pin of a port using a variable as the pin number.
PinGetRead a pin from a port using a variable as the index
PinModeMake a specified Pin an input, output, or enable internal pull-up resistors.
PinPullupEnable or disable a specified Port or Pin internal pull-up resistor or resistors.
PinSetSet a pin of a port using a variable as the pin number.
PulseInMeasure the pulse width on a pin.
PulseOutGenerate a pulse from a pin.
PWMOutput a Pulse Width Modulated signal from an I/O pin.
RCinMeasure a pulse width on a pin.
ServoControl a servo motor.
ShinSynchronous serial input. i.e. SPI
ShoutSynchronous serial output. i.e. SPI
SoundGenerate a tone or white-noise from a specified pin.
Sound2Generate 2 tones from 2 separate pins.
ToggleReverse the state of a port's pin.
USBinitInitialise the USB on devices that contain a USB peripheral.
USBinReceive data via a USB endpoint on devices that contain a USB peripheral.
USBoutTransmit data via a USB endpoint on devices that contain a USB peripheral.
XinReceive data using the X10 protocol.
XoutTransmit data using the X10 protocol.
View original PDF page 115Open page in PDFOriginal PDF page 115

LCD Commands

BoxDraw a square on a graphic LCD.
CircleDraw a circle on a graphic LCD.
ClsClear the LCD.
CursorPosition the cursor on the LCD.
LCDreadRead a single byte from a Graphic LCD.
LCDwriteWrite bytes to a Graphic LCD.
LineDraw a line in any direction on a graphic LCD.
LineToDraw a straight line in any direction on a graphic LCD, starting from the

previous Line command's end position.

PixelRead a single pixel from a Graphic LCD.
PlotSet a single pixel on a Graphic LCD.
PrintDisplay characters on an LCD.
Toshiba_CommandSend a command to a Toshiba T6963 graphic LCD.
Toshiba_UDGCreate User Defined Graphics for Toshiba T6963 graphic LCD.
UnPlotClear a single pixel on a Graphic LCD.

Async Serial Commands

HRsinReceive data from the serial port on devices that contain a USART.
HRsoutTransmit data from the serial port on devices that contain a USART.
HRsoutLnTransmit data from the serial port on devices that contain a USART

and transmit a terminator value or values.

HSerinReceive data from the serial port on devices that contain a USART.
HSeroutTransmit data from the serial port on devices that contain a USART.
HSeroutLnTransmit data from the serial port on devices that contain a USART

and transmit a terminator value or values.

HRsin2Same as HRsin but using a 2nd USART if available.
HRsout2Same as HRsout but using a 2nd USART if available.
HRsout2LnSame as HRsoutLn but using a 2nd USART if available.
HSerin2Same as HSerin but using a 2nd USART if available.
HSerout2Same as HSerout but using a 2nd USART if available.
HSerout2LnSame as HSeroutLn but using a 2nd USART if available.
HRsin3Same as HRsin but using a 3rd USART if available.
HRsout3Same as HRsout but using a 3rd USART if available.
HRsout3LnSame as HRsoutLn but using a 3rd USART if available.
HSerin3Same as HSerin but using a 3rd USART if available.
HSerout3Same as HSerout but using a 3rd USART if available.
HSerout3LnSame as HSeroutLn but using a 3rd USART if available.
HRsin4Same as HRsin but using a 4th USART if available.
HRsout4Same as HRsout but using a 4th USART if available.
HRsout4LnSame as HRsoutLn but using a 4th USART if available.
HSerin4Same as HSerin but using a 4th USART if available.
HSerout4Same as HSerout but using a 4th USART if available.
HSerout4LnSame as HSeroutLn but using a 4th USART if available.
RsinAsynchronous serial input from a fixed pin and Baud rate.
RsoutAsynchronous serial output to a fixed pin and Baud rate.
RsoutLnAsynchronous serial output to a fixed pin and Baud rate,

and transmit a terminator value or values.

SerinReceive asynchronous serial data (i.e. RS232 data).
SeroutTransmit asynchronous serial data (i.e. RS232 data).
View original PDF page 116Open page in PDFOriginal PDF page 116

Comparison and Loop Commands

BoundReturns the element size of an array – 1 element. For use in Loops.
BranchComputed GoTo (equiv. to On..GoTo).
BranchLBranch out of page (long Branch).
BreakExit a loop prematurely.
ContinueCause the next iteration of the enclosing loop to begin.
Do...LoopExecute a block of instructions until a condition is true or an infinite loop.

For…To…Next…Step Repeatedly execute statements.

If..Then..ElseIf..Else..EndIfConditionally execute statements.
On GoSubCall a Subroutine based on an Index value. For 18F devices only.
On GoToJump to an address in code memory based on an Index value.

(Primarily for smaller devices)

On GoToL Jump to an address in code memory based on an Index value.

(Primarily for larger devices)

Tern A form of Ternary Operator and has the same mechanism as a

C compiler's '?' directive.

Repeat...UntilExecute a block of instructions until a condition is true.
Select..Case..EndSelectConditionally run blocks of code.
SizeOfReturns the size of a variable, in bytes

or the amount of elements in an array

While…Wend Execute statements while condition is true.

General BASIC Commands

AddressOfGet the address of a variable or label.
CallCall an assembly language subroutine.
ClearPlace a variable or bit in a low state, or clear all RAM area.
ClearBitClear a bit of a variable, using a variable index.
DecDecrement a variable.
DelayCsDelay with a 1 instruction cycle resolution.
DelayMsDelay milliseconds.
DelayUsDelay microseconds.
DigReturn the value of a decimal digit.
GetBitExamine a bit of a variable, using a variable index.
GoSubCall a BASIC subroutine at a specified label.
GoToContinue execution at a specified label.
IncIncrement a variable.
LoadBitSet or Clear a bit of a variable, using a variable index.
RandomGenerate a pseudo-random number.
ReturnContinue at the statement following the last GoSub.
RolRotate a variable left, with or without the microcontroller’s Carry flag.
RorRotate a variable right, with or without the microcontroller’s Carry flag.
SeedSeed the random number generator, to obtain a more random result.
SetPlace a variable or bit in a high state.
SetBitSet a bit of a variable, using a variable index.
SleepPower down the processor for a period of time.
SnoozePower down the processor for short period of time.
StopStop program execution.
SwapExchange the values of two variables.
View original PDF page 117Open page in PDFOriginal PDF page 117

RAM String Variable Commands

LenFind the length of a String variable.
Left$Extract n amount of characters from the left of a String.
Mid$Extract characters from a String beginning at n characters from the left.
Right$Extract n amount of characters from the right of a String.
StrLoad a Byte array with values.
StrnCreate a null terminated Byte array.
Str$Convert the contents of a variable to a null terminated String.
ToLowerConvert the characters in a String to lower case.
ToUpperConvert the characters in a String to upper case.
ValConvert a null terminated String to an integer value.

Flash memory and EEPROM Commands

cPtr8, cPtr16, cPtr24, cPtr32 Indirectly read flash memory using a variable as the address.

CdataPlace information into flash memory. For access by Creadx.
CreadRead data from flash memory.

Cread8, Cread16, Cread24, Cread32 Read a single or multi-byte value from a flash memory table with more efficiency than Cread.

CwriteWrite data to flash memory.
EdataDefine initial contents of on-board EEPROM.
EreadRead a value from on-board EEPROM.
EwriteWrite a value to on-board EEPROM.
LookDownSearch a constant lookdown table for a value.
LookDownLSearch constant or variable lookdown table for a value.
LookUpFetch a constant value from a lookup table.
LookUpLFetch a constant or variable value from lookup table.

Directives

Asm-EndAsmInsert assembly language code section.
ConfigSet or Reset programming fuse configurations.
DeclareAdjust library routine parameters.
DeviceChoose the type of PICmicro™ to compile for.
DimCreate a RAM variable or a Flash memory table.
EndStop execution of the BASIC program.
IncludeLoad a file into the source code.

On_Hardware_Interrupt Point to the subroutine that a hardware interrupt will jump too.

On_Low_InterruptPoint to a subroutine for a Low Priority interrupt on an 18F device.
Set_OSCCALCalibrate the internal oscillator found on some PICmicro™ devices.
Sub-EndSubCreate a subroutine unit.
SymbolCreate a constant or an alias.
View original PDF page 118Open page in PDFOriginal PDF page 118