soft_spi

General discussion on mikroBasic for AVR.
Post Reply
Author
Message
granel
Posts: 142
Joined: 13 Feb 2007 11:01

soft_spi

#1 Post by granel » 25 Feb 2007 19:43

Soft_Spi_Init(PORTB, 6, 5, 7,

SOFT_SPI_PRESCALER_256, SOFT_SPI_LO_2_HI_IDLE_LO, SOFT_SPI_MODE_8)
---what is it?

and for AT90S2313 PORTB.6 is miso_do
portb.5 is mosi_di
portb.7 is sck
in help
Soft_Spi_Init(PORTB, 6, 5, 7 ) === Soft_Spi_Init(PORTB,sdi,sdo,sck)
its true?
and i dont see Soft_Spi_Init, only
Soft_Spi_Config ??

goranp
mikroElektronika team
Posts: 82
Joined: 29 Jan 2007 16:14

#2 Post by goranp » 28 Feb 2007 09:09

SOFT_SPI_PRESCALER_256, SOFT_SPI_LO_2_HI_IDLE_LO, SOFT_SPI_MODE_8
These are the parameters for the SPI communication. After compiling your project, select the parameter and use Ctrl+Space to see all of the constants available or Ctrl+Shift+Space to see the description of the parameter. Here 's the list of the constants you will find that way:

Code: Select all

  SOFT_SPI_HI_2_LO_IDLE_HI = 0;
  SOFT_SPI_HI_2_LO_IDLE_LO = 1;
  SOFT_SPI_LO_2_HI_IDLE_HI = 2;
  SOFT_SPI_LO_2_HI_IDLE_LO = 3;

  SOFT_SPI_PRESCALER_2   = 1;
  SOFT_SPI_PRESCALER_4   = 2;
  SOFT_SPI_PRESCALER_8   = 3;
  SOFT_SPI_PRESCALER_16  = 4;
  SOFT_SPI_PRESCALER_32  = 5;
  SOFT_SPI_PRESCALER_64  = 6;
  SOFT_SPI_PRESCALER_128 = 7;
  SOFT_SPI_PRESCALER_256 = 8;

  SOFT_SPI_MODE_8  = 8;
  SOFT_SPI_MODE_16 = 16;
The library configures SPI to master mode, so MISO (Master In Slave Output) is the same as SDI and MOSI (Master Output Slave In) is the same as SDO.

Post Reply

Return to “mikroBasic for AVR General”