Abl-electronic PIC Microcontrollers PIC16 Manuel d'utilisateur Page 266

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 312
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 265
mikroC provides library which implement software SPI. These routines are hard-
ware independent and can be used with any MCU. You can easily communicate
with other devices via SPI: A/D converters, D/A converters, MAX7219, LTC1290,
etc.
Note: These functions implement time-based activities, so interrupts need to be
disabled when using the library.
Soft_Spi_Config
Soft_Spi_Read
Soft_Spi_Write
mikroC
- C Compiler for Microchip PIC microcontrollers
mikroC
making it simple...
258
MikroElektronika:
Development
tools
-
Books
-
Compilers
page
Software SPI Library
Library Routines
Prototype
void Soft_Spi_Config(char *port, const char SDI, const char SD0,
const char SCK);
Description Configures and initializes software SPI. Parameter port specifies port of MCU on which
SDI, SDO, and SCK pins will be located. Parameters SDI, SDO, and SCK need to be in
range 0–7 and cannot point at the same pin.
Soft_Spi_Config needs to be called before using other functions from Soft SPI
Library.
Example This will set SPI to master mode, clock = 50kHz, data sampled at the middle of interval,
clock idle state low and data transmitted at low to high edge. SDI pin is RB1, SDO pin
is RB2 and SCK pin is RB3:
Soft_Spi_Config(PORTB, 1, 2, 3);
Soft_Spi_Config
Vue de la page 265
1 2 ... 261 262 263 264 265 266 267 268 269 270 271 ... 311 312

Commentaires sur ces manuels

Pas de commentaire