XE167FH CAN PIN Config Fehler

Gast #4120655
Lesenswert?

Hallo Forum !

XE167FH CAN PIN Config Fehler für den Pin11.01
der geht nicht als TXD -->CAN
raus, fehlt da der Pull-Up,+-Push-Pull,
aber der  P2.05 PIN als TXD Port geht am CAN Bus als TXD-CAN raus,
aber der 'Remapped Pin Pin11.01 geht dagegen nicht ''alternativ als
TXD -->CAN-PIN.

Was macht der wohl für ein re_remappe da für den spezi. -Chip
Typ: XE167FH
haben ?
Wer kennt sich mit dem Chip von Infineon aus ?

Gruss Holger.
######################################################################## 
#
1
void CAN_vInit(void)
2
{
3
  MCAN_KSCCFG  =  0x0003;      // load Kernel State Configuration Register Âêëþ÷àåì can ìîäóëü
4
  _nop_();  // one cycle delay 
5
  _nop_();  // one cycle delay 
6
  ///  - the CAN module clock = 40,00 MHz
7
  CAN_FDRL     =  0x43FF;      // load Fractional Divider Register
8
  while(CAN_PANCTRL & CAN_PANCTR_BUSY){ };   //// êîìàíäà ðàáîòû ñî ñïèñêîì âûïîëíåíà                       
9

10
  CAN_NCR0     =  0x0041; // ïðåðûâàíèÿ ðàçðåøåíû
11

12
//    P11_IOCR01 = 0x00A0;    //TXD = P11.1
13
//    CAN_NPCR0    =  0x0005;      // RXD = P11.0
14

15
   P2_IOCR05 = 0x00A0;    //set direction register
16
   CAN_NPCR0    =  0x0003;      // load node0 port control register
17
   
18
   CAN_NBTR0L   =  0x2F41; // 1 ÌÃö
19

20
   SetListCommand(0x0101,0x0002);  // MO1 for list 1 (Node 0) 
21

22
  ///  -----------------------------------------------------------------------
23
  ///  Configuration of Message Object 1: Tx, Node 0 ïåðåäà÷à
24
  ///  -----------------------------------------------------------------------
25
  CAN_MOCTR1H = 0x0EA8;        // load MO1 control register high
26
  CAN_MOCTR1L = 0x0000;        // load MO1 control register low
27
  
28
  CAN_MOAR1H = 0x630C;         // identifier 29-bit
29
  CAN_MOAR1L = 0x000D;         // load MO1 arbitration register low
30

31
  ///  Configuration of Message Object 1 Data:
32
  CAN_MODATA1HH = 0x0A0A;      //;0x556     
33
  CAN_MODATA1HL = 0x0A0A;            // data MSG_CNT in XC2000
34
  CAN_MODATA1LH = 0x0A0A;  
35
  CAN_MODATA1LL = 0x0A0A;              // load MO1 Data Bytes(DB1 & DB0)
36

37
  CAN_MOAMR1H = 0x3FFF;        // load MO1 acceptance mask register high
38
  CAN_MOAMR1L = 0xFFFF;        // load MO1 acceptance mask register low
39
  
40
  CAN_MOFCR1H = 0x0800;        // load MO1 function control register high  
41
  CAN_MOFCR1L = 0x0000;        // load MO1 function control register low
42

43
 
44
  CAN_NCR0 &= ~ (uword) 0x0041; // reset INIT and CCE
45

46

47
  CAN_PANCTRL = 0x01;          // CAN Node initialization command
48
  while(CAN_PANCTRL & CAN_PANCTR_BUSY){ };// wait until Panel has finished
49
    
50

51
} //

#####################################################################
Gruss Holger.
Gast #4120659
Lesenswert?

Topic:
XE167FH Chip derivat...
P11.1 doesn't work when set as Tx pin.
######################################################################## 
##

Hier Code für den XC2287-96F den ich habe.
Nur mal als Vergleich, was ist da so noch zu beachten, beim remapping.
der TX-CAN Pinne.
Frage: Wo bekomme ich guten Beispielcode für den  XE167FH.
1
void CAN_vInit_Node0(void)
2
{
3
/// -----------------------------------------------------------------------
4
/// Configuration of CAN Node 0:
5
/// -----------------------------------------------------------------------
6
/// General Configuration of the Node 0:
7
/// - set INIT and CCE
8
CAN_NCR0 = 0x0041; // load node 0 control register SUSEN=1
9
/// Configuration of the used CAN Port Pins: I/O PIN Configuration for CAN 1
10
CAN_NPCR0 = 0x0002; // P2.0 Rx = receive input C NO LOOP BACK
11
/// Configuration of the used CAN Port Pins: I/O PIN Configuration for CAN 1
12
P2_IOCR00 = 0x0020; // P2.0 as input (pull up)
13
P2_IOCR01 = 0x0090; // P2.1 as output (ALT1, push pull)
14
/// Configuration of the Node 0 Baud Rate:
15
/// - required baud rate = 500,000 kbaud
16
CAN_NBTR0L = BAUD_0500_000_WITH_MHZ_75; // Set Baud Rate of Node 0 at 500
17
kbaud at 75 MHz
18
/// -----------------------------------------------------------------------
19
/// Configuration of the CAN Message Object List Structure:
20
/// -----------------------------------------------------------------------
21
/// Allocate MOs for list 1/Node0:
22
SetListCommand(1, 11, CAN_INIT_LIST);
23
SetListCommand(1, 12, CAN_INIT_LIST);
24
} //End of CAN_vInit_Node0

Gruss Holger.
Gast #4120670
Lesenswert?

Holger schrieb:
> Nur mal als Vergleich
DatenBlatt: XE167Fx
http://www.keil.com/dd/docs/datashts/infineon/xe167xh_ds.pdf
Code:
http://www.pudn.com/downloads131/sourcecode/embed/detail558242.html
Code:
http://read.pudn.com/downloads131/sourcecode/embed/558242/TwinCAN/CAN.C__.htm

Noch den DavE DipFile für den XE167FH besorgen, der auf dem DAvE 
Mothersystem als Code Generator appliziert wird.
DAVE Apps DAvE Drive.

Gruss Holger.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren