Electronic Components Datasheet Search
  English  ▼

X  

AN247 Datasheet(PDF) 19 Page - Microchip Technology

Part # AN247
Description  A CAN Bootloader for PIC18F CAN Microcontrollers
PDF  32 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

AN247 Datasheet(HTML) 19 Page - Microchip Technology

Back Button AN247 Datasheet HTML 15Page - Microchip Technology AN247 Datasheet HTML 16Page - Microchip Technology AN247 Datasheet HTML 17Page - Microchip Technology AN247 Datasheet HTML 18Page - Microchip Technology AN247 Datasheet HTML 19Page - Microchip Technology AN247 Datasheet HTML 20Page - Microchip Technology AN247 Datasheet HTML 21Page - Microchip Technology AN247 Datasheet HTML 22Page - Microchip Technology AN247 Datasheet HTML 23Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 19 / 32 page
background image
 2003 Microchip Technology Inc.
DS00247A-page 19
AN247
; *****************************************************************************
; Function:
_bootChksm _UpdateChksum(WREG _bootChksmL)
;
; PreCondition: Nothing
; Input: _bootChksmL
; Output: _bootChksm. This is a static 16 bit value stored in the Access Bank.
; Side Effects: STATUS register is corrupted.
; Stack Requirements: 1 level.
; Overview: This function adds a byte to the current 16 bit checksum
;
count. WREG should contain the byte before being called.
;
;
The _bootChksm value is considered a part of the special
;
register set for bootloading. Thus it is not visible.
;
;***************************************************************************
_UpdateChksum:
addwf
_bootChksmL, F ; Keep a checksum
btfsc
STATUS, C
incf
_bootChksmH, F
return
; *****************************************************************************
; *****************************************************************************
; Function:
VOID _CANInit(CAN, BOOT)
;
; PreCondition: Enter only after a reset has occurred.
; Input: CAN control information, bootloader control information
; Output: None.
; Side Effects: N/A. Only run immediately after reset.
; Stack Requirements: N/A
; Overview: This routine is technically not a function since it will not
;
return when called. It has been written in a linear form to
;
save space.Thus 'call' and 'return' instructions are not
;
included, but rather they are implied.
;
;
This routine tests the boot flags to determine if boot mode is
;
desired or normal operation is desired. If boot mode then the
;
routine initializes the CAN module defined by user input. It
;
also resets some registers associated to bootloading.
;
; *****************************************************************************
_CANInit:
clrf
EECON1
setf
EEADR
; Point to last location of EEDATA
setf
EEADRH
bsf
EECON1, RD
; Read the control code
incfsz EEDATA, W
#ifdef NEAR_JUMP
bra
RESET_VECT
; If not 0xFF then normal reset
#else
goto
RESET_VECT
#endif
clrf
_bootSpcCmd
; Reset the special command register
movlw
0x1C
; Reset the boot control bits
movwf
_bootCtlBits
movlb
d'15'
; Set Bank 15
bcf
TRISB, CANTX
; Set the TX pin to output
movlw
CAN_RXF0SIDH
; Set filter 0
movwf
RXF0SIDH
movlw
CAN_RXF0SIDL
movwf
RXF0SIDL
comf
WREG
; Prevent filter 1 from causing a



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


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