EasyManuals Logo

Microchip Technology dsPIC33 series User Manual

Microchip Technology dsPIC33 series
116 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #73 background imageLoading...
Page #73 background image
2018 Microchip Technology Inc. DS70005340A-page 73
CAN FD Protocol Module
6.14 Resetting Transmit FIFO
A Transmit FIFO can be reset by:
Setting FRESET (C1FIFOCONxL<10>) or
Placing the module in Configuration mode (OPMOD<2:0> = 100)
Resetting the FIFO will reset the Head and Tail Pointers, and the C1FIFOSTAx register. The
settings in the C1FIFOCONxL and C1FIFOCONxH registers will not change.
Before resetting a TX FIFO using FRESET, ensure no transmissions are pending.
6.15 Resetting Transmit Queue
The Transmit Queue can be reset by:
Setting FRESET (C1TXQCONL<10>) or
Placing the module in Configuration mode (OPMOD<2:0> = 100)
Resetting the TXQ will reset the Head and Tail Pointers, and the C1TXQSTA register. The
settings in the C1TXQCONL and C1TXQCONH registers will not change.
Before resetting the TXQ using FRESET, ensure no transmissions are pending.
6.16 Message Transmission Code Example
Example 6-1: Message Transmission Code
#include <xc.h>
/* This code example demonstrates a method to configure the CAN FD module to transmit Standard and
Extended ID CAN FD messages. This uses CAN1, TXQ and FIFO1. TXQ size is 1 and FIFO1 size is 2. */
/* Include fuse configuration code here. */
#define MAX_WORDS 100
unsigned int __attribute__((aligned(4)))CanTxBuffer[MAX_WORDS];
/*Data structure to implement a CANFD message buffer. */
/* CANFD Message Time Stamp */
typedef unsigned long CANFD_MSG_TIMESTAMP;
/* CAN TX Message Object Control*/
typedef struct _CANFD_TX_MSGOBJ_CTRL {
unsigned DLC:4;
unsigned IDE:1;
unsigned RTR:1;
unsigned BRS:1;
unsigned FDF:1;
unsigned ESI:1;
unsigned SEQ:7;
unsigned unimplemented1:16;
} CANFD_TX_MSGOBJ_CTRL;
/* CANFD TX Message ID*/
typedef struct _CANFD_MSGOBJ_ID {
unsigned SID:11;
unsigned long EID:18;
unsigned SID11:1;
unsigned unimplemented1:2;
} CANFD_MSGOBJ_ID;

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Microchip Technology dsPIC33 series and is the answer not in the manual?

Microchip Technology dsPIC33 series Specifications

General IconGeneral
BrandMicrochip Technology
ModeldsPIC33 series
CategoryMotherboard
LanguageEnglish

Related product manuals