AT90CAN128 Problem With CAN initialization

General discussion on mikroC PRO for AVR.
Post Reply
Author
Message
engr.talha72
Posts: 15
Joined: 05 Sep 2018 08:48

AT90CAN128 Problem With CAN initialization

#1 Post by engr.talha72 » 02 Nov 2021 05:02

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.

engr.talha72
Posts: 15
Joined: 05 Sep 2018 08:48

Re: AT90CAN128 Problem With CAN initialization

#2 Post by engr.talha72 » 03 Nov 2021 09:33

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.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: AT90CAN128 Problem With CAN initialization

#3 Post by filip » 03 Nov 2021 15:12

Hi,

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

Regards,
Filip.

engr.talha72
Posts: 15
Joined: 05 Sep 2018 08:48

Re: AT90CAN128 Problem With CAN initialization

#4 Post by engr.talha72 » 04 Nov 2021 06:57

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.

engr.talha72
Posts: 15
Joined: 05 Sep 2018 08:48

Re: AT90CAN128 Problem With CAN initialization

#5 Post by engr.talha72 » 04 Nov 2021 07:07

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.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: AT90CAN128 Problem With CAN initialization

#6 Post by filip » 05 Nov 2021 09:46

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.

Post Reply

Return to “mikroC PRO for AVR General”