전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

X  

70353C 데이터시트(PDF) 37 Page - Microchip Technology

부품명 70353C
상세설명  Section 21. Enhanced Controller Area Network
PDF  76 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
제조업체  MICROCHIP [Microchip Technology]
홈페이지  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

70353C 데이터시트(HTML) 37 Page - Microchip Technology

Back Button 70353C Datasheet HTML 33Page - Microchip Technology 70353C Datasheet HTML 34Page - Microchip Technology 70353C Datasheet HTML 35Page - Microchip Technology 70353C Datasheet HTML 36Page - Microchip Technology 70353C Datasheet HTML 37Page - Microchip Technology 70353C Datasheet HTML 38Page - Microchip Technology 70353C Datasheet HTML 39Page - Microchip Technology 70353C Datasheet HTML 40Page - Microchip Technology 70353C Datasheet HTML 41Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 37 / 76 page
background image
© 2008-2011 Microchip Technology Inc.
DS70353C-page 21-37
Section 21. Enhanced Controller Area Network (ECAN™)
21
Example 21-2:
Code Example for Extended Data Frame Transmission
#include <p33Exxxx.h>
/* This code example demonstrates a method to configure the ECAN module to transmit Extended
ID CAN messages. */
/* Include fuse configuration code here. Optionally the fuse configuration can be specified via
MPLAB IDE Menu operations. */
FUSE_CONFIGURATION_MACROS_COME_HERE
#define NUM_OF_ECAN_BUFFERS 32
/* This is the ECAN message buffer declaration. Note the buffer alignment. */
unsigned int ecan1MsgBuf[NUM_OF_ECAN_BUFFERS][8]
__attribute__((aligned(NUM_OF_ECAN_BUFFERS * 16)));
int main(void)
{
unsigned long address;
/* Place code to set device speed here. For this example the device speed should be set at
40 MHz (i.e., the device is operating at 40 MIPS). */
ConfigureDeviceClockFor40MIPS();
/* The dsPIC33E device features I/O remap. This I/O remap configuration for the ECAN module
can be performed here. */
SetIORemapForECANModule();
/* Set up the ECAN1 module to operate at 250 kbps. The ECAN module should be first placed in
configuration mode. */
C1CTRL1bits.REQOP = 4;
while(C1CTRL1bits.OPMODE != 4);
C1CTRL1bits.WIN = 0;
/* Set up the CAN module for 250kbps speed with 10 Tq per bit. */
C1CFG1 = 0x47;
// BRP = 8 SJW = 2 Tq
C1CFG2 = 0x2D2;
C1FCTRL = 0xC01F; // No FIFO, 32 Buffers
/* Assign 32x8 word Message Buffers for ECAN1 in device RAM. This example uses DMA0 for TX.
Refer to 21.8.1 “DMA Operation for Transmitting Data” for details on DMA channel
configuration for ECAN transmit. */
DMA0CONbits.SIZE = 0x0;
DMA0CONbits.DIR = 0x1;
DMA0CONbits.AMODE = 0x2;
DMA0CONbits.MODE = 0x0;
DMA0REQ = 70;
DMA0CNT = 7;
DMA0PAD = (volatile unsigned int)&C1TXD;
DMA0STAL = (unsigned int) &ecan1msgBuf;
DMA0STAH = (unsigned int) &ecan1msgBuf;
DMA0CONbits.CHEN = 0x1;



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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76


데이터시트 다운로드

Go To PDF Page


링크 URL



ALLDATASHEET 가 귀하에 도움이 되셨나요?  [ DONATE ] 

Alldatasheet는?   |   광고문의   |   운영자에게 연락하기   |   개인정보취급방침   |   링크 투 데이터시트    |   링크교환   |   제조사별 검색
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