![Infineon 82C900 Application Note Download Page 15](http://html1.mh-extra.com/html/infineon/82c900/82c900_application-note_2055171015.webp)
AP29002
Standalone TwinCAN Controller
Using special features of the 82C900
Application Note
14
V 1.0, 2004-02
Application Example
With the SSC data transfer routines shown in chapter 3.1 you are able to create a
CAN application with the 82C900. The application example sets up two CAN message
objects, one for receiving and one for transmitting.
As soon as a CAN message that has the same CAN identifier as this receive object is
received, an interrupt service routine is called. This interrupt service routine copies the
data received from the CAN message to the transmit object and transmits it on the
same CAN node. The source code for this example is in the SSC directory of the code
for this ApNote.
void main(void)
{
Project_Init();
SLS = 1;
// slave not selected
// set up CAN node A, 1 Mbaud
SSC_SendByte(ACR, 0x41);
// set bit CCE in ACR
SSC_SendByte(ABTR+1,
0x23);
// set DIV8X=0, TSEG2=3, TSEG1=4
SSC_SendByte(ABTR, 0x02);
// set SJW=1, BRP=2
SSC_SendByte(AIMR0,
0x01);
// take IMC0 into account for INTID generation
SSC_SendByte(ACR, 0x00);
// clear INIT, CCE in ACR
This part of the code initializes the microcontroller and sets up CAN node A in the
82C900 for operation at 1 MBaud. To be able to change the configuration, bit CCE in
ACR must be set and then be reset again after the configuration has been changed.