| Electronic Components Datasheet Search |
|
AN247 Datasheet(PDF) 20 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN247 Datasheet(HTML) 20 Page - Microchip Technology |
|
20 / 32 page ![]() AN247 DS00247A-page 20 2003 Microchip Technology Inc. movwf RXF1SIDL ; receive event movlw CAN_RXF0EIDH movwf RXF0EIDH movlw CAN_RXF0EIDL movwf RXF0EIDL movlw CAN_RXM0SIDH ; Set mask movwf RXM0SIDH movlw CAN_RXM0SIDL movwf RXM0SIDL movlw CAN_RXM0EIDH movwf RXM0EIDH movlw CAN_RXM0EIDL movwf RXM0EIDL movlw CAN_BRGCON1 ; Set bit rate movwf BRGCON1 movlw CAN_BRGCON2 movwf BRGCON2 movlw CAN_BRGCON3 movwf BRGCON3 movlw CAN_CIOCON ; Set IO movwf CIOCON clrf CANCON ; Enter Normal mode ; ***************************************************************************** ; ***************************************************************************** ; This routine is essentially a polling loop that waits for a ; receive event from RXB0 of the CAN module. When data is ; received, FSR0 is set to point to the TX or RX buffer depending ; upon whether the request was a 'put' or a 'get'. ; ***************************************************************************** _CANMain: bcf RXB0CON, RXFUL ; Clear the receive flag btfss RXB0CON, RXFUL ; Wait for a message bra $ - 2 clrwdt #ifdef ALLOW_GET_CMD btfss CAN_PG_BIT ; Put or get data? bra _CANMainJp1 lfsr 0, TXB0D0 ; Set pointer to the transmit buffer movlw 0x08 movwf _bootCount ; Setup the count to eight movwf WREG1 bra _CANMainJp2 #endif _CANMainJp1 lfsr 0, RXB0D0 ; Set pointer to the receive buffer movf RXB0DLC, W andlw 0x0F movwf _bootCount ; Store the count movwf WREG1 bz _CANMain ; Go back if no data specified for a put _CANMainJp2 ; ***************************************************************************** |
|
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 |