DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

PIC18LF4682-I/ML 查看數據表(PDF) - Microchip Technology

零件编号
产品描述 (功能)
生产厂家
PIC18LF4682-I/ML Datasheet PDF : 484 Pages
First Prev 281 282 283 284 285 286 287 288 289 290 Next Last
PIC18F2682/2685/4682/4685
EXAMPLE 23-3: TRANSMITTING A CAN MESSAGE USING BANKED METHOD
; Need to transmit Standard Identifier message 123h using TXB0 buffer.
; To successfully transmit, CAN module must be either in Normal or Loopback mode.
; TXB0 buffer is not in access bank. And since we want banked method, we need to make sure
; that correct bank is selected.
BANKSEL TXB0CON
; One BANKSEL in beginning will make sure that we are
; in correct bank for rest of the buffer access.
; Now load transmit data into TXB0 buffer.
MOVLW MY_DATA_BYTE1
; Load first data byte into buffer
MOVWF TXB0D0
; Compiler will automatically set “BANKED” bit
; Load rest of data bytes - up to 8 bytes into TXB0 buffer.
...
; Load message identifier
MOVLW 60H
; Load SID2:SID0, EXIDE = 0
MOVWF TXB0SIDL
MOVLW 24H
; Load SID10:SID3
MOVWF TXB0SIDH
; No need to load TXB0EIDL:TXB0EIDH, as we are transmitting Standard Identifier Message only.
; Now that all data bytes are loaded, mark it for transmission.
MOVLW B’00001000’
; Normal priority; Request transmission
MOVWF TXB0CON
; If required, wait for message to get transmitted
BTFSC TXB0CON, TXREQ
; Is it transmitted?
BRA
$-2
; No. Continue to wait...
; Message is transmitted.
DS39761B-page 286
Preliminary
© 2007 Microchip Technology Inc.

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]