Hi,Dear
If I don't mount CAN ransceiver A82C251 in my circuit board,my CAN initlization code will stop at
while(!(CAN0CTL0_SYNCH)); // Wait for CAN synchronization.
How to detect whether my circuit board has CAN ransceiver A82C251?
Whether I must detect it,and then call CAN init function?
And how to detect it?
Thanks.
Try pulling RXCAN pin high. Internal pull up should suffice. Also you may detect presence of transceiver pulling RXCAN high and low and checking if pin follows pullup direction. But don't get fooled with activity on CAN bus. You should sample RXCAN many times in both pull up states before deciding it is really not driven by transceiver.
It is not a good idea to wait forewer for SYNCH. What will happen if CAN bus is shorted and forewer dominant?