2023-08-30 12:16 PM
Hello
I'm working with SPC560P40 and I tried to send CAN data but with any condition which I tried out, it has just some regular pulses that has no meaning. I saw all examples in SPC5Studio but I got same pulses. would you please help me out with this problem.
Thanks for your attention
Solved! Go to Solution.
2023-08-31 01:49 AM
Hi,
1-> Set with Pin Map Editor: Digital Output CANTXD0 pin and Digital Input CAN0RXD pin
2->In Low Level Drivers Component RLA:
2A->Enable Drivers: Flag CAN
2B->In FlexCan Settings Enable CAN0, set filter and timing
2C: Clik on Generate SPC5 Application
3->In main.c add #include "can_lld_cfg.h"
componentsInit();
irqIsrEnable();
can_lld_start(&CAND1, &can_config_name_of_your_config);
and in while loop to send somethings:
while(true){
txmsg1.data8[0]=21;
txmsg1.LENGTH = 1;
2023-08-31 01:49 AM
Hi,
1-> Set with Pin Map Editor: Digital Output CANTXD0 pin and Digital Input CAN0RXD pin
2->In Low Level Drivers Component RLA:
2A->Enable Drivers: Flag CAN
2B->In FlexCan Settings Enable CAN0, set filter and timing
2C: Clik on Generate SPC5 Application
3->In main.c add #include "can_lld_cfg.h"
componentsInit();
irqIsrEnable();
can_lld_start(&CAND1, &can_config_name_of_your_config);
and in while loop to send somethings:
while(true){
txmsg1.data8[0]=21;
txmsg1.LENGTH = 1;
2023-09-03 08:46 PM
Hello
Thanks for your quick response, I tried out these codes and configures but the issues is still remaining. About the timing, based on formula for Bit Rate in this section, I tried to set the Bit Rate to 500kbs as the SYS_CLK is 64 MHz and XOSC_CLK is 16 MHz, how should I set PROPSEG, PSEG1, PSEG2 AND PRESDIV?
Thank you
2023-09-06 10:09 AM
Hi,
set
-PROSEG=4
-PSEG2=1
-PSEG1=7
then try two value of PRESDIV: 3 or 7
2023-09-07 05:15 AM
Hello
Actually I tried them but it still has meaning less signals. Then I checked out board initialization component parts and pin identifier, I saw it has warning and says pin name must be unique! So would you please help me out with this.
Thanks again
2023-09-08 01:44 AM
Hello,
post the pin map pic.
Chek pin name, i seams two pins have same name.
Bus sorry now i go to vacations, so i can't answer for two weeks.
2023-09-08 06:41 AM
Thanks ck182 and have a good time.