Datasheet

Programming PIC Microcontrollers in BASIC - mikroElektronika
Prototype
sub procedure Soft_SPI_Config(dim byref Port as byte, const SDI, const
SD0, const SCK)
Description Routine configures and initializes software SPI with the following defaults:
Set MCU to master mode,
Clock = 50kHz,
Data sampled at the middle of interval,
Clock idle state low
Data transmitted at low to high edge.
SDI pin, SDO pin, and SCK pin are specified by the appropriate parameters.
Example
Soft_SPI_Config(PORTB, 1, 2, 3)
' SDI pin is RB1, SDO pin is RB2, and SCK pin is RB3.
5.2.19.2 Soft_SPI_Read – Reads the received data
Prototype sub function Soft_SPI_read(dim Buffer as byte) as byte
Description Routine provides clock by sending <Buffer> and reads the received data at the end of the period.
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (105 sur 112)05/11/2004 02:20:55