Sweet Sixteen Offer - 16% discount on everything in the shop - lasts until December 13, 12:00 CET
It is currently 12 Dec 2017 14:04

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: CAN SPI baudrate
PostPosted: 02 Dec 2015 08:48 
Offline

Joined: 06 May 2015 15:07
Posts: 40
Hello everyone. Last time I found some things which are working on the CANBUS with baudrate 83.3 kBaud. Is it possible to program this baudrate by mikoe CAN SPI or CAN SPI click? I've tried to calculate nessesay quartz, but I did not found the best one. All calculation with possible error (minimal 0.04 %). Or maybe this baudrate needs something special?


Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 02 Dec 2015 15:36 
Offline
mikroElektronika team
User avatar

Joined: 11 Mar 2015 12:48
Posts: 1697
Hi,

Did you try to use our application for calculation of CAN, CANclulator:
http://www.libstock.com/projects/view/360/canculator

For setting baud rate with CAN SPI I suggest you to take a look at the CANSPI Library Help file.

Best regards,
Aleksandar


Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 03 Dec 2015 06:37 
Offline

Joined: 06 May 2015 15:07
Posts: 40
Of cource I tried to use calculator. But as you can see on the picture there is no calculated data. It means that this baudrate impossible to CANSPI module? Or what can I do to set this baudrate without errors? I just want to connect CAN SPI to exist CAN BUS with baudrate 83.3 kBaud


Attachments:
2015-12-03 07_54_40-MikroElektronika - CANculator.png
2015-12-03 07_54_40-MikroElektronika - CANculator.png [ 62.53 KiB | Viewed 1544 times ]
Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 03 Dec 2015 15:41 
Offline
mikroElektronika team
User avatar

Joined: 11 Mar 2015 12:48
Posts: 1697
Hi,

I mange to reproduce the same behavior.
The problem is in CANculator, for some reason he can not calculate correct settings for the PIC MCU.

For AVR, ARM and other is working.

This is forwarded to our developers.

You should set your CAN SPI manually.

Best regards,
Aleksandar


Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 03 Dec 2015 21:06 
Offline

Joined: 06 May 2015 15:07
Posts: 40
I'm using PIC because as I remember there is a problem with AVR calculation. Can you help me to calculate this manually?


Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 08 Dec 2015 17:03 
Offline
mikroElektronika team
User avatar

Joined: 11 Mar 2015 12:48
Posts: 1697
Hi,

I suggest you to refer to the manual of the module which you are using.

Which module are you using?

Best regards,
Aleksandar


Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 09 Dec 2015 05:49 
Offline

Joined: 06 May 2015 15:07
Posts: 40
1) EasyAVR v7 (Atmega32) -> CAN SPI click 5V (nessesary CAN BUS baudrate is 83.333 kBaud)
2) And one more question. How to make chip selection for two CAN SPI click 5v ?
For one module is:
// CANSPI module connections
sbit CanSpi_CS  at  PORTB0_bit;
sbit CanSpi_CS_Direction  at  DDB0_bit;

How can I do this for two modules?
Is it good frequency of 8 Mhz to read and write both two can spi modules?


Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 09 Dec 2015 15:35 
Offline
mikroElektronika team
User avatar

Joined: 11 Mar 2015 12:48
Posts: 1697
Dear Nikitos,

Nikitos wrote:
I'm using PIC because as I remember there is a problem with AVR calculation.

- To be honest I'm not sure that I understand with which microcontroller are you working now.

I manage to calculate the CAN settings for AVR in CANculator software (please take a look at the picture).

Therefore I suggest you to use that settings for CAN and test your hardware.

Best regards,
Aleksandar


Attachments:
AVR_CANSPI.JPG
AVR_CANSPI.JPG [ 115.91 KiB | Viewed 1458 times ]
Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 10 Dec 2015 06:16 
Offline

Joined: 06 May 2015 15:07
Posts: 40
Sorry. I explaned not completly. I used PIC only in calculation software because this post:

viewtopic.php?f=206&t=49119&start=15#p217179

and answer to the post

janko.kaljevic wrote:
Hello,

Yes this is an error when CANSPI and AVR controllers are selected.
In this case it generates double baud, as you noted.

Thanks for reporting this. It will be fixed for the next version of Canculator.

In meantime you can select other architecture (like PIC) and you will get correct calculation and generated code will compile.

Best regards.


Thanks for help!


Top
 Profile  
 
 Post subject: Re: CAN SPI baudrate
PostPosted: 10 Dec 2015 11:13 
Offline
mikroElektronika team
User avatar

Joined: 11 Mar 2015 12:48
Posts: 1697
Hi Nikitos,

This was long time reported and fixed.

Now we have a different problem. :)

I hope that this will work for you.

Regards,
Aleksandar


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: