| Electronic Components Datasheet Search |
|
70353C Datasheet(PDF) 36 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
70353C Datasheet(HTML) 36 Page - Microchip Technology |
|
36 / 76 page ![]() dsPIC33E/PIC24E Family Reference Manual DS70353C-page 21-36 © 2008-2011 Microchip Technology Inc. Example 21-1: Code Example for Standard Data Frame Transmission (Continued) A code example to transmit an extended frame using Message Buffer 2 is shown in Example 21-2. /* Configure Message Buffer 0 for Transmission and assign priority */ C1TR01CONbits.TXEN0 = 0x1; C1TR01CONbits.TX0PRI = 0x3; /* At this point the ECAN1 module is ready to transmit a message. Place the ECAN module in Normal mode. */ C1CTRL1bits.REQOP = 0; while(C1CTRL1bits.OPMODE != 0); /* Write to message buffer 0 */ /* CiTRBnSID = 0bxxx1 0010 0011 1100 IDE = 0b0 SRR = 0b0 SID<10:0>= 0b100 1000 1111 */ ecan1MsgBuf[0][0] = 0x123C; /* CiTRBnEID = 0bxxxx 0000 0000 0000 EID<17:6> = 0b0000 0000 0000 */ ecan1MsgBuf[0][1] = 0x0000; /* CiTRBnDLC = 0b0000 0000 xxx0 1111 EID<17:6> = 0b000000 RTR = 0b0 RB1 = 0b0 RB0 = 0b0 DLC = 0b1111 */ ecan1MsgBuf[0][2] = 0x0008; /* Write message data bytes */ ecan1MsgBuf[0][3] = 0xabcd; ecan1MsgBuf[0][4] = 0xabcd; ecan1MsgBuf[0][5] = 0xabcd; ecan1MsgBuf[0][6] = 0xabcd; /* Request message buffer 0 transmission */ C1TR01CONbits.TXREQ0 = 0x1; /* The following shows an example of how the TXREQ bit can be polled to check if transmission is complete. */ while(C1TR01CONbits.TXREQ0 == 1); /* Message was placed successfully on the bus */ while(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 |