MikroElektronika PIC Microcontrollers PIC16 Datový list Strana 139

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 194
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 138
Programming PIC Microcontrollers in BASIC - mikroElektronika
Example
dim rec as byte
...
SPI_Read(rec)
5.2.15.4 SPI_Write – Sends data via SPI
Prototype sub procedure SPI_Write(dim Data as byte)
Description Routine writes <Data> to SSPBUF and immediately starts the transmission.
Example
SPI_Write(7)
5.2.16 USART Library
USART (Universal Synchronous Asynchronous Receiver Transmitter) hardware module is available with a number of PIC MCU
models. You can easily communicate with other devices via RS232 protocol (for example with PC, see the figure at the end of this
chapter - RS232 HW connection). You need a PIC MCU with hardware integrated USART (for example, PIC16F877). Then,
simply use the functions and procedures described below.
Note: Some PIC micros that have two USART modules, such as P18F8520, require you to specify the module you want to use.
Simply append the number 1 or 2 to procedure or function name, e.g. USART_Write2(Dat).
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (97 sur 112)05/11/2004 02:20:55
Zobrazit stránku 138
1 2 ... 134 135 136 137 138 139 140 141 142 143 144 ... 193 194

Komentáře k této Příručce

Žádné komentáře