MikroElektronika PIC Microcontrollers PIC16 Arkusz Danych Strona 74

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 73
Programming PIC Microcontrollers in BASIC - mikroElektronika
Prototype
sub procedure CANSPISetBaudRate(dim SJW as byte, dim BRP as byte, dim
PHSEG1 as byte, dim PHSEG2 as byte, dim PROPSEG as byte, dim
CAN_CONFIG_FLAGS as byte)
Description The procedure sets CAN Baud Rate. CAN must be in Configuration mode or else these values will be ignored.
Parameters:
SJW value as defined in 18XXX8 datasheet (must be between 1 thru 4)
BRP value as defined in 18XXX8 datasheet (must be between 1 thru 64)
PHSEG1 value as defined in 18XXX8 datasheet (must be between 1 thru 8)
PHSEG2 value as defined in 18XXX8 datasheet (must be between 1 thru 8)
PROPSEG value as defined in 18XXX8 datasheet (must be between 1 thru 8)
CAN_CONFIG_FLAGS - Value formed from constants (see section below)
Output:
Given values are bit adjusted to fit in 18XXX8 and BRGCONx registers and copied. CAN bit rate is set as per
given values.
Example
CANSPISetBaudRate(1, 1, 3, 3, 1, aa)
5.2.4.5 CANSPISetMask – Sets the CAN message mask
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (32 sur 112)05/11/2004 02:20:52
Przeglądanie stron 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 193 194

Komentarze do niniejszej Instrukcji

Brak uwag