| Electronic Components Datasheet Search |
|
AN247 Datasheet(PDF) 21 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN247 Datasheet(HTML) 21 Page - Microchip Technology |
|
21 / 32 page ![]() 2003 Microchip Technology Inc. DS00247A-page 21 AN247 ; ***************************************************************************** ; Function: VOID _ReadWriteMemory() ; ; PreCondition:Enter only after _CANMain(). ; Input: None. ; Output: None. ; Side Effects: N/A. ; 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 is the memory I/O engine. A total of eight data ; bytes are received and decoded. In addition two control ; bits are received, put/get and control/data. ; ; A pointer to the buffer is passed via FSR0 for reading or writing. ; ; The control register set contains a pointer, some control bits ; and special command registers. ; ; Control ; <PG><CD><ADDRL><ADDRH><ADDRU><_RES_><CTLBT><SPCMD><CPDTL><CPDTH> ; ; Data ; <PG><CD><DATA0><DATA1><DATA2><DATA3><DATA4><DATA5><DATA6><DATA7> ; ; PG bit: Put = 0, Get = 1 ; CD bit: Control = 0, Data = 1 ; ; ***************************************************************************** _ReadWriteMemory: btfscCAN_CD_BIT ; Write/read data or control registers bra _DataReg ; ***************************************************************************** ; This routine reads or writes the bootloader control registers, ; then executes any immediate command received. _ControlReg lfsr 1, _bootCtlMem _ControlRegLp1 #ifdef ALLOW_GET_CMD btfsc CAN_PG_BIT ; or copy control registers to buffer movff POSTINC1, POSTINC0 btfss CAN_PG_BIT ; Copy the buffer to the control registers #endif movff POSTINC0, POSTINC1 decfsz WREG1, F bra _ControlRegLp1 #ifdef ALLOW_GET_CMD btfsc CAN_PG_BIT bra _CANSendResponce; Send response if get #endif ; ********************************************************* ; This is a no operation command. movf _bootSpcCmd, W; NOP Command bz _SpecialCmdJp2; or send an acknowledge ; ********************************************************* |
|
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 |
| 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 |