Remote-processing CAMBASIC Manual do Utilizador Página 151

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 208
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 150
Commands - 118
SPI
FUNCTION
SYNTAX: a = SPI(channel,out_length,data, delay,in_length)
Where:
channel = 0 to 2, the SPI channel number.
out_length = 0 to 16, data output length in bits. W hen zer o, no data is shifted out. data can be any
value but must be included.
data = 0 to 65,535, command/data to send to SPI device.
delay = time to wait before r etrieving inform ation from SPI por t after the last bit is shifted out.
Time in micro-seconds is calculated as follows: time = delay * 1.1 + 4. If 0, there is no delay.
Use 0 if there is no data to retrieve (i.e. sending to D/A).
in_length = 0 to 16, data input length in bits. W ill return a number from 0 to 65535.
PURPOSE: Writes to and receives data from SPI port. This port is not on all boards. Refer to hardware
manual.
REMARK S: SPI (Serial Peripheral Interface) is used to communicate with a number of IC’s. These include
D/A’s, A/D ’s, U ART’s, a nd other devices. The num ber of ports is har dware dependent.
The SPI function is used to read and wr ite data. Unfortunately, SPI has a variety of data formats.
Data to send and receive from a device can be anywhere from 8 to 24 bits. The clock polarity can
idle high or low and the phase when data is latched.
The SPI function supports the follow ing form at:
Clock idle polarity: low
Clock-data phase: low
This format supports the Maxim MAX186/ 188 and Burr-Br own ADS7843 IC’s.
If your form at needs are differ ent, the C AMBA SIC prog ram (SP IDEM O. BAS) can be used as a
basis to read and wr ite to other SPI devices.
Some boards (such as the RPC-2350) have pre-assigned ports. Refer to your hardware m anual for
specific information.
Not all boards support this command (such as the RPC-150 and RPC-2300).
RELATED: none
EXAMPLE: 10 SPI(2,8,&e8,10,12)
ERROR: < Data neg> - for any parameters
Vista de página 150
1 2 ... 146 147 148 149 150 151 152 153 154 155 156 ... 207 208

Comentários a estes Manuais

Sem comentários