I wonder if someone can help me. This may be trivial, or not... I am happy to make a donation to someone
I have a 32F417 driving a L9616 interface chip, whose C_H and C_L pins come out on a terminal block.
This is purely a future option in the board I am working on, and no "driver" is being done unless somebody needs CAN, but I would like to detect whether that option (the L9616 chip) has been fitted, and check that the CPU-L9616 connection works.
What is the absolute minimum amount of code which will do this?
I think the L9616 is like a 2-wire RS485 transceiver, in which case it will loop everything back to itself, but if it disables RX during TX then nothing will come back and it can't be detected. The block diagram suggests that everything on the pins is always received
but there is some gating of the transmitter from the RX data. The ASC pin on driven from a GPIO, PC13.
TXI and RXO are driven from PD1 and PD0 pins which are the default ones for the 32F4 CAN bus controller. Currently these are inputs, but it may be that once one selects the CAN controller, these pins get automatically initialised as required by that. Some 32F4 pins work that way; some don't and need to be set up.
It may not be possible to tell if the chip is an L9616 or some other RS485 chip... Not much can be done about that!
It may also be possible to test for this chip without using the CAN controller at all, just by bit-banging the two GPIO pins PD1,PD0. Not ideal, perhaps.
I am using Cube IDE.
Many thanks in advance