Start Back Next End
  
ZBasic System Library
207
ZBasic Microcontrollers
the bit rate selector is the CPU frequency (F_CPU, typically 14.7456MHz for ZX devices).  For the
software SPI implementation, the number of cycles per bit is a minimum of about 50 so the
implementation runs at full speed with either the f/4 or f/16 speed settings.
For devices that have multiple SPI controllers (e.g. xmega-based devices), the most significant byte of the
flags parameter specifies the index of the SPI controller to use (0=PortD, 1=PortC, 2=PortE, 3=PortF). 
See the Resource Usage sub-section SPI Controllers for information about the available hardware SPI
controllers for the various ZBasic devices and the control and data pins for each.
The rxDelay parameter, which defaults to zero if not present, specifies the amount of time to delay
before beginning the SPI cycle for each byte received, if any, during the second half of the SPICmd()
process.  See the description of SPICmd() for more details.
Caution
For ZX devices that use an external SPI EEPROM for user program storage, you must avoid doing
anything that will interfere with the SPI commands to that device.  SPI communication by direct
manipulation of the processor SPI control registers is not supported and may cause your program to
malfunction.
Compatibility
BasicX does not support the double speed option, the active high chip select, the optional rxDelay
parameter, or the bit-bang mode.  The same is true for ZX devices based on the ATmega32 processor. 
See Also
Previous page Top Next page