![Infineon 82C900 Application Note Download Page 11](http://html1.mh-extra.com/html/infineon/82c900/82c900_application-note_2055171011.webp)
AP29002
Standalone TwinCAN Controller
Using special features of the 82C900
Application Note
10
V 1.0, 2004-02
The following example sets up the SSC interface of an Infineon 16 bit microcontroller.
The code was actually tested on the C167CR and C161PI microcontrollers (on Phytec
KitCon evaluation boards). The Code is generic and should work on most other
Infineon 16-bit controllers.
void SSC_Init(void)
{
SSCEN = 0;
// SSC baudrate generator/reload register
// baudrate = 100 KBaud
SSCBR = 0x0031;
// load P3.13 output latch (SCLK) with the
// desired clock idle level(high)
P3 |= 0x2000;
// set P3.13 direction control (SCLK output)
DP3 |= 0x2000;
// ---------- SSC Control Register ----------
/// Master Mode
/// transfer data width is 8 bit
/// transfer/receive MSB first
/// shift transmit data on the leading clock edge, latch on
/// trailing edge
/// idle clock line is high, leading clock edge is
/// high-to-low transition
/// ignore receive error
/// ignore phase error
SSCCON = 0xC057;
DP3 &= 0xFEFF;
// reset P3.8 dir control (MRST input)
P3 |= 0x0200;
// set P3.9 output latch (MTSR)
DP3 |= 0x2240;
// set P3 dir control
}
As you can see from the source code, there is nothing special about the SSC
initialization.
For transferring data to a register we need to specify its 11-bit address. But since the
SSC interface on the 82C900 is only able to handle 8 bits at a time and one of these is
used for Read/Write indication, the rest of the address has to be specified in a different
way. Therefore, when using the SSC interface, the 82C900’s address space is divided
into pages. Every page is 128 bytes wide.