![Infineon 82C900 Application Note Download Page 45](http://html1.mh-extra.com/html/infineon/82c900/82c900_application-note_2055171045.webp)
AP29002
Standalone TwinCAN Controller
Using special features of the 82C900
Application Note
44
V 1.0, 2004-02
The application configures via SSC P0-P3 of the 82C900 as output and P4-P7 as
inputs and creates MSG0 as a transmitting object with one data byte for OUTMSG and
MSG1 as receiving object with one data byte for INMSG. The configuration for the
parallel port of the 82C900 is made in the registers IOMODE0/2 and for IN/OUTMSG
in the register CANIO.
If the 82C900 receives a message in OUTMSG with an ID of 1, it puts the first data
byte automatically in OUTREG. The contents of the register can be seen on all pins
that are configured as output (P4-P7). The receive interrupt of MSG0 triggers EX2IN of
the C167CR. The interrupt routine reads out P2.4-P2.7 and writes the data to P2.0-
P2.3. Now the contents of INREG can be read out with a remote frame with the ID 2
(INMSG).
If the first data byte of the send message is 0xC0, the first data byte of the message
that contains the data of INREG will be 0xCC. The values that are written to as input
configured pins have no influence on the value of the pins. But the INREG contains the
actual values of all pins even if they are configured as output. So all not used bits of
the INMSG-data should be masked out.
Figure 13
Configuration of the 82C900
C AN -B us 125K B aud
N ode A
M SG 0 (O UT M SG)
ID 1, 1 data byte,
receiving object
D 1 D 2 D 3 D 4 D 5 D 6 D 7 D 8
O U TR EG
D 1 D 2 D 3 D 4 D 5 D 6 D 7 D 8
P1I
P2I
P3I
P4O
P5O
P6O
P7O
P0I
IN RE G
M SG 1 (IN M SG)
ID 2, 1 data byte,
transm itting object
P 2.4-P2.7
P 2.0-P2.3
82C900
C167C R