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.12. CREADSyntax :Overview :Operators :Example :Variable = CREAD AddressRead data from anywhere in memory.Variable is a user-defined variable.Address is a constant, variable, or expression, that represents anyvalid address within the PIC.‘ Read memory locations within the PICDEVICE 16F877 ‘ Needs to be a 16F87x type PICDIM Var as BYTEDIM Wrd as WORDDIM Address as WORDAddress=1000 ‘ Address now holds the base addressVar = CREAD 1000 ‘ Read 8-bit data at address 1000 into VarWrd = CREAD Address+10 ‘ Read 14-bit data at address 1000+10Notes :The CREAD command takes advantage of the new self-modifyingfeature that is available in the newer 16F87x range of devices.If a WORD size variable is used as the assignment, then a 14-bitWORD will be read. If a BYTE sized variable is used as the assignment,then 8-bits will be read.Because the 14-bit core devices are only capable of holding 14 bits toa WORD, values greater than 16383 ($3FFF) cannot be read.See CDATA for an alternative method for locating the address of aCDATA table.The configuration fuse setting WRTE must be enabled beforeCDATA, CREAD, and CWRITE may be used, this is the default setting.This enables the self-modifying feature. If the CONFIG directiveis used, then the WRTE_ON fuse setting must be included in the list: -CONFIG WDT_ON , XT_OSC , WRTE_ONSee also :CDATA, CONFIG, CWRITE, ORG39Copyright Crownhill 2001

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

Saved successfully!

Ooh no, something went wrong!