| Electronic Components Datasheet Search |
|
70353C Datasheet(PDF) 57 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
70353C Datasheet(HTML) 57 Page - Microchip Technology |
|
57 / 76 page ![]() © 2008-2011 Microchip Technology Inc. DS70353C-page 21-57 Section 21. Enhanced Controller Area Network (ECAN™) 21 21.8 DMA CONTROLLER CONFIGURATION The ECAN module uses device RAM for the message buffers to support both transmission and reception of CAN messages. The number of message buffers to be used by the ECAN module is specified by the DMA Buffer Size bits (DMABS<2:0>) in the ECAN FIFO Control register (CiFCTRL<15:13>). The DMAxSTAL and DMAxSTAH registers in the DMA controller defines the start of the CAN buffer area. The DMA controller moves data between ECAN and the message buffers (placed in device RAM) without CPU intervention. 21.8.1 DMA Operation for Transmitting Data The user application selects a message for transmission by setting the Message Send Request bit (TXREQ) in the ECAN TX/RX Buffer m or n Control register (CiTRmnCON<3>). The ECAN controller uses DMA to read the message from the message buffer and transmit the message. The ECAN module generates a transmit data interrupt to start a DMA cycle. In response to the interrupt, the DMA channel that is configured for ECAN message transmission reads from the message buffer in device RAM and stores the message in the ECAN Transmit Data register (CiTXD). Eight words are transferred for every message transmitted by the ECAN controller. The detailed layout of the transmit message buffer is provided in 21.2 “CAN Message Formats”. A sample code for configuring the DMA channel for ECAN1 transmission is shown in Example 21-6. Example 21-6: DMA Channel 0 Configuration for ECAN1 Transmission Note: For more information on configuring and using the DMA module, refer to Section 22. “Direct Memory Access (DMA)” (DS70348) of the “dsPIC33E/PIC24E Family Reference Manual”, which is available from the Microchip web site (www.microchip.com). /* This code snippet shows an example of configuring a DMA channel for ECAN transmission. Refer to Example 21-1 for an application example */ /* Data Transfer Size: Word Transfer Mode */ DMA0CONbits.SIZE = 0x0; /* Data Transfer Direction: device RAM to Peripheral */ DMA0CONbits.DIR = 0x1; /* DMA Addressing Mode: Peripheral Indirect Addressing mode */ DMA0CONbits.AMODE = 0x2; /* Operating Mode: Continuous, Ping-Pong modes disabled */ DMA0CONbits.MODE = 0x0; /* Assign ECAN1 Transmit event for DMA Channel 0 */ DMA0REQ = 70; /* Set Number of DMA Transfer per ECAN message to 8 words */ DMA0CNT = 7; /* Peripheral Address: ECAN1 Transmit Register */ DMA0PAD = (volatile unsigned int); & CITxD; unsigned long address; DMA1STAL = (unsigned int) &ecan1msgBuf; DMA1STAH = (unsigned int) &ecan1msgBuf; /* Channel Enable: Enable DMA Channel 0 */ DMA0CONbits.CHEN = 0x1; /* Channel Interrupt Enable: Enable DMA Channel 0 Interrupt */ IEC0bits DMA0IE = 1; |
|
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 |