2020/09/16 08:24:28
0x3e
Hello,
I want to configure one MCP2518FD chip to transmit one message over TX-Queue.
But my result's are error flags like IVMIF, TXBO, RXBP and endless sending frames on CAN-bus.

Config:
- 20MHz exptern Crystal
- zero fifos, 1 TXQeue, no TEF


But now configuration step by Step:
(at 2a..2c: the configuration I have it taken from the examplecode)
1. SW Reset
2. init
2a. 0x04901000 to 0x00            cicon in configmode
2b. 0x007e1f1f to 0x04            nbtcfg config for 20MHz/125k_500k
2c. 0x001e0707 to 0x08            dbtcfg config for 20MHz/125k_500k
2d. 0X00001F00 TO 0X0C            CITBC config for 20MHz/125k_500k
2e. 0xff1f0000 to 0x1c            c1int +all interrupts
2f. 0x62000495 to 0x50            citxqcon
2g. 0x00000060 to 0xe00            OSC config for 20Mhz external crystal and output 2MHz

3. change mode to normal
3a. 0x00980000 to 0x00            cicon change mode to normal
3b.     -> check MCP2518FD has changed the mode

4. configure txobj-file and write it in queue
(I have only TXQ configured, the address is 0x400 now; CiTXQUA says 0x00000000)
4a. 0x000000a1 to 0x400            WORD TE0 (ctrl with ID=a1)
4b. 0x000002c8 to 0x404            WORD TE1 (ctrl with seq=1; CAN FD Base Frame)
4c. 0x11223344 to 0x408            WORD Te2 (data)
4d. 0x55667788 to 0x40c            WORD TE3 (data)

5. ciTXQCon -> read and change UINC
4a. 0x62000195 to 0x50            citxqcon

6. ciTXQCon -> TXREQ
4a. 0x62000295 to 0x50            citxqcon

Now I can see, the bit ciTXQCon.TXREQ is always high and goes never back to low.
The chip sending endless sequences to CAN_TX pin.

Shorty after I have set citexqcon.txreq = 1 you can see the register they have changed their value:
0000    0x00101800
0018    0x40000048
001c     0xff1f8009
0030    0x00000001
0034    0x00056000
0038    0x00XX0000  (counting the TX erros; the counting is never stopping)
0050  0x62000295    (TXREQ value is always High, although the system should reset that value automatically)
0054  0x00000021
001c  0xff1fa009
0034  0x00101800

after a half minute, the register 0x00 toggles shortly to 0x00101000 and back to 0x00101800
2020/09/17 04:13:51
0x3e
Hello,
I have a little bit progress:

I have disabled the Interrupts and CiCON.RTXAT, now it want's to send one message and bits UINC and TXREQ goes clear after try to send the message.

My errors are now:
0x1c    INT.IVMIF = 1
0x34    TREC.TEC = 8
0x38     BDIAG0.DTERRCNT = 1
0x3c     BDIAG1.DBIT1ERR = 1
0x54     TXQSTA.TXERR = 1
0x54     TXQSTA.TXATIF = 1

The Config after Reset and Init
(Device is now in Normal Mode "000")
Addr    B0 B1 B2 B3
=================
0000  00 00 11 00
0004  1F 1F 7E 00
0008  00 0F 1C 00
000C  00 1F 00 00
0010  00 00 00 00
0014  00 00 00 00
0018  40 00 40 40
001C  08 00 00 00
0020  00 00 00 00
0024  00 00 00 00
0028  00 00 00 00
002C  00 00 00 00
0030  00 00 00 00
0034  00 00 00 00
0038  00 00 00 00
003C  00 00 00 00
0040  00 00 00 00
0044  00 00 00 00
0048  00 00 00 00
004C  00 00 00 00
0050  80 00 00 02
0054  05 00 00 00
0058  00 00 00 00
005C  00 00 60 00
0060  00 00 00 00
0064  30 00 00 00
0068  00 00 60 00
006C  00 00 00 00
0070  40 00 00 00
0074  00 00 60 00
0078  00 00 00 00
007C  50 00 00 00
=====================
0400  FF FF FF FF
0404  FF FF FF FF
0408  FF FF FF FF
040C  FF FF FF FF
0410  FF FF FF FF
0414  FF FF FF FF
0418  FF FF FF FF
041C  FF FF FF FF
=====================
0E00  60 04 00 00
0E04  00 00 03 00
0E08  00 00 00 00
0E0C  00 00 00 00
0E10  00 00 00 00
0E14  00 00 00 00
0E18  00 00 00 00
0E1C  00 00 00 00

-----------------------------------------------
After that I prepare the message at RAM Space 0x400.
0400  5A 00 00 40
0404  C0 01 00 00
0408  11 12 13 14
040C  15 16 17 18
0410  FF FF FF FF
-----------------------------------------------

Now I set TXQCON.UINC and TXQCON.TXREQ
the result:
0000  00 00 11 00
0004  1F 1F 7E 00
0008  00 0F 1C 00
000C  00 1F 00 00
0010  00 00 00 00
0014  00 00 00 00
0018  40 00 40 40
001C  08 80 00 00
0020  00 00 00 00
0024  00 00 00 00
0028  00 00 00 00
002C  00 00 00 00
0030  00 00 00 00
0034  00 08 00 00
0038  00 00 00 01
003C  00 00 00 02
0040  00 00 00 00
0044  00 00 00 00
0048  00 00 00 00
004C  00 00 00 00
0050  80 00 00 02
0054  31 00 00 00
0058  10 00 00 00
005C  00 00 60 00
0060  00 00 00 00
0064  30 00 00 00
0068  00 00 60 00
006C  00 00 00 00
0070  40 00 00 00
0074  00 00 60 00
0078  00 00 00 00
007C  50 00 00 00





© 2021 APG vNext Commercial Version 4.5

Use My Existing Forum Account