Page 1 of 1

AT90CAN128 Problem With CAN initialization

Posted: 02 Nov 2021 05:02
by engr.talha72
Hi,

I started using mikroc Pro for AVR this week and I am trying to test CAN communication between two AT90CAN128 boards. I am not new to CAN protocol, previously is was using Mikroc for ARM and CANbus had no issues with STM32F407 MCU. However, I had to shift to AVR due to the global chip shortage issue. First, I had faced issues with the initialization of UART with Mikroc for AVR libraries. UART was unable to send data and I had to use register addressing to make my own functions to get UART working. and Now when I started using CAN libraries, similar issue is happening. CANtx is not sending anything, I have checked with oscilloscope and it shows no data. For reference, I am using sample codes given for BIGAVR6. the only thing I changed is that I am using 16Mhz Crystal OSC instead of 8MHz clock.
Fuse bits are as follows.
LOW = 0xFF = 1111 1111
HIGH = 0xD9 = 1101 1001
EXTENDED = 0xFF = 1111 1111

Circuit has not problem since the same circuit for STM32 with Mikroc for ARM was working perfectly fine. It seems like AT90CAN128 is not initializing CAN and UART with giving libraries. Kindly help.

Re: AT90CAN128 Problem With CAN initialization

Posted: 03 Nov 2021 09:33
by engr.talha72
i figured out that none of the given libraries work for AT90CAN128 including Timer, UART and CAN. please help. I am stuck and I need to get it working asap. Thanks a lot.

Re: AT90CAN128 Problem With CAN initialization

Posted: 03 Nov 2021 15:12
by filip
Hi,

Have you tried CAN example that we have in our compiler ?
\Examples\Development systems\BIGAVR6\CAN\

Regards,
Filip.

Re: AT90CAN128 Problem With CAN initialization

Posted: 04 Nov 2021 06:57
by engr.talha72
yes, I tried it. In fact, I started testing CAN using the BIGAVR6 example codes for CAN 1st and CAN 2nd. I only changed fuse bits to match my 16MHz crystal setting. However, I could not get any signal on CANTx when checked with oscilloscope, it stays at always HIGH state. I am using the latest version of AVR compiler.

Re: AT90CAN128 Problem With CAN initialization

Posted: 04 Nov 2021 07:07
by engr.talha72
Actually, this was already mentioned in my question. kindly let me know any possible issues. since UART and TIMER libraries also not working, I suppose it is a compiler setting issue. Maybe it is unable to choose the correct libraries for the selected MCU.

Re: AT90CAN128 Problem With CAN initialization

Posted: 05 Nov 2021 09:46
by filip
Hi,

We had no issues with this MCU when we released the compiler.

Are you sure you have set the fuse bits correctly ?

Regards,
Filip.