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.
- 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
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:
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)
after a half minute, the register 0x00 toggles shortly to 0x00101000 and back to 0x00101800