Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

PIC18F4685-I/SP Datasheet(PDF) 289 Page - Microchip Technology

Part # PIC18F4685-I/SP
Description  28/40/44-Pin Enhanced Flash Microcontrollers with ECAN Technology, 10-Bit A/D and nanoWatt Technology
PDF  484 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC18F4685-I/SP Datasheet(HTML) 289 Page - Microchip Technology

Back Button PIC18F4685-I/SP Datasheet HTML 285Page - Microchip Technology PIC18F4685-I/SP Datasheet HTML 286Page - Microchip Technology PIC18F4685-I/SP Datasheet HTML 287Page - Microchip Technology PIC18F4685-I/SP Datasheet HTML 288Page - Microchip Technology PIC18F4685-I/SP Datasheet HTML 289Page - Microchip Technology PIC18F4685-I/SP Datasheet HTML 290Page - Microchip Technology PIC18F4685-I/SP Datasheet HTML 291Page - Microchip Technology PIC18F4685-I/SP Datasheet HTML 292Page - Microchip Technology PIC18F4685-I/SP Datasheet HTML 293Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 289 / 484 page
background image
© 2007 Microchip Technology Inc.
Preliminary
DS39761B-page 287
PIC18F2682/2685/4682/4685
EXAMPLE 23-4:
TRANSMITTING A CAN MESSAGE USING WIN BITS
; 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.
Use WIN bits to map it to RXB0 area.
MOVF
CANCON, W
; WIN bits are in lower 4 bits only.
Read CANCON
; register to preserve all other bits.
If operation
; mode is already known, there is no need to preserve
; other bits.
ANDLW
B’11110000’
; Clear WIN bits.
IORLW
B’00001000’
; Select Transmit Buffer 0
MOVWF
CANCON
; Apply the changes.
; Now TXB0 is mapped in place of RXB0.
All future access to RXB0 registers will actually
; yield TXB0 register values.
; Load transmit data into TXB0 buffer.
MOVLW
MY_DATA_BYTE1
; Load first data byte into buffer
MOVWF
RXB0D0
; Access TXB0D0 via RXB0D0 address.
; Load rest of the data bytes - up to 8 bytes into “TXB0” buffer using RXB0 registers.
...
; Load message identifier
MOVLW
60H
; Load SID2:SID0, EXIDE = 0
MOVWF
RXB0SIDL
MOVLW
24H
; Load SID10:SID3
MOVWF
RXB0SIDH
; No need to load RXB0EIDL:RXB0EIDH, 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
RXB0CON
; If required, wait for message to get transmitted
BTFSC
RXB0CON, TXREQ
; Is it transmitted?
BRA
$-2
; No.
Continue to wait...
; Message is transmitted.
; If required, reset the WIN bits to default state.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com