MikroElektronika PIC Microcontrollers PIC16 Especificações Página 153

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 186
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 152
Chapter 6 - Samples
Using the macro:
RS232init Macro for initializing RB0 pin and line for transmitting data (TX-pin).
Example: RS232init
SEND S_string Sending ASCII character. Argument is ASCII sign.
Example: SEND 'g'
SENDw Sending data found in W register.
Example: movlw 't'
SENDw
RECEIVE macro in interrupt routine receives data for RS232 and stores it in RXD register
Example:
At the beginning of the main program, we need to declare variables RS_TEMP1, RE_TEMP2, TXD,
RXD and TX pin on microcontroller. After resetting a microcontroller the program sends a greeting
message to PC computer: $ PIV16F84 on line $, and is ready to receive data from RX line.
We can send and receive data from PC computer from some communication program. When
microcontroller receives data, it will send a message: Character received from PIC16F84: x, thus
confirming that reception was successful.
http://www.mikroelektronika.co.yu/english/product/books/PICbook/6_12Poglavlje.htm (4 of 6) [4/2/2003 16:19:14]
Vista de página 152
1 2 ... 148 149 150 151 152 153 154 155 156 157 158 ... 185 186

Comentários a estes Manuais

Sem comentários