CAN SPI baudrate
CAN SPI baudrate
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?
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: CAN SPI baudrate
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
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
Re: CAN SPI baudrate
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 (62.53 KiB) Viewed 5327 times
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: CAN SPI baudrate
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
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
Re: CAN SPI baudrate
I'm using PIC because as I remember there is a problem with AVR calculation. Can you help me to calculate this manually?
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: CAN SPI baudrate
Hi,
I suggest you to refer to the manual of the module which you are using.
Which module are you using?
Best regards,
Aleksandar
I suggest you to refer to the manual of the module which you are using.
Which module are you using?
Best regards,
Aleksandar
Re: CAN SPI baudrate
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:
How can I do this for two modules?
Is it good frequency of 8 Mhz to read and write both two can spi modules?
2) And one more question. How to make chip selection for two CAN SPI click 5v ?
For one module is:
Code: Select all
// CANSPI module connections
sbit CanSpi_CS at PORTB0_bit;
sbit CanSpi_CS_Direction at DDB0_bit;
Is it good frequency of 8 Mhz to read and write both two can spi modules?
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: CAN SPI baudrate
Dear Nikitos,
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
- To be honest I'm not sure that I understand with which microcontroller are you working now.Nikitos wrote:I'm using PIC because as I remember there is a problem with AVR calculation.
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 (115.91 KiB) Viewed 5241 times
Re: CAN SPI baudrate
Sorry. I explaned not completly. I used PIC only in calculation software because this post:
http://www.mikroe.com/forum/viewtopic.p ... 15#p217179
and answer to the post
http://www.mikroe.com/forum/viewtopic.p ... 15#p217179
and answer to the post
Thanks for help!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.
- Aleksandar.Mitrovic
- mikroElektronika team
- Posts: 1697
- Joined: 11 Mar 2015 12:48
Re: CAN SPI baudrate
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
This was long time reported and fixed.
Now we have a different problem.
I hope that this will work for you.
Regards,
Aleksandar