Page 1 of 1

CAN internal

Posted: Sun Jan 01, 2023 9:17 pm
by carworker
Hello ! Happy New Year ! And my big disappointment. The teacher lent me a PC with FC 8 and with great hope I assembled a simple block diagram with CAN 1 and hopes collapsed. Just like in FC 5, the internal CAN does not work. Only SPI. Really for so many years the manufacturer could not do it? Only link works Set TX ID - Set Tx Data - Send Buffer. In this case, there is no access to CAN ID Full.I'm not offenced. I'm just asking for help. It is necessary to write down the addresses for example 0x810A000 0xC20A000 0xA18A000.How to apply Full ID to a macro Set TX ID Hi/Low ? Is there a way to make it work CAN 1 in FC8 ? Perhaps there is a way to make it work for receiving transmission RB2 CAN Tx RB3 CAN Rx. There is hope that I will learn to write it myself. Thanks.

Re: CAN internal

Posted: Sun Jan 01, 2023 10:12 pm
by kersing
It helps if you tell what controller you are using. And post the flowchart you are experiencing issues with.

Re: CAN internal

Posted: Mon Jan 02, 2023 6:27 pm
by carworker
Hi ! Thank you for your attention. Chip PIC18F2680 and CAN analyzer Microchip.The Test Can 1 2680 file works in hardware in the same way
as in FC5. File Test CAN 2 2680 ID Ulong in hardware does not work! No transmission ! My task is to pass the ID address for example
0x810A000 I was hoping the "SetTxIdent" macro would help me.Please advise. Thanks.

Re: CAN internal

Posted: Tue Jan 03, 2023 7:57 am
by carworker
I apologize for the wasted time. I was deeply mistaken. Corrected my mistakes and got the desired result. Everything worked!Matrix Respect ! There is one moment left.How, in the depths of the "SetTxIdent" macro, the decimal number is converted into the one necessary for transmission hex ? Thanks.

Re: CAN internal

Posted: Wed Jan 04, 2023 5:59 pm
by QMESAR
carworker wrote:
Tue Jan 03, 2023 7:57 am
There is one moment left.How, in the depths of the "SetTxIdent" macro, the decimal number is converted into the one necessary for transmission hex ?
I am not quite sure if I understand your question/problem corrcetly however
if you have ID in Decimal for example 541 then the compiler automatically converts it to the correct hex value which is 0x21D, you can write the decimal or the hex value in the ID properties of the "SetTxIdent" macro it makes no difference to the compiler. I hope I got your problem correctly :D

Re: CAN internal

Posted: Wed Jan 04, 2023 9:33 pm
by carworker
Hi ! I proceed from the fact that FC 8 CAN1 offers two macros "SetTxID" & "SetTxIdent". The "SetTxID" macro is standard for numbers 0-2047 and requires the number to be converted to high and low bits. There are formulas in the help file. The macro "SetTxIdent" standard and extended works with ULONG numbers, which allows you to write the standard ID and the extended ID as a decimal number.However, the decimal number Ulong cannot be written to the register.The TXBnEIDH and TXBnEIDL extended mode registers also require high and low bits. What formulas to use for the conversion, I have not yet understood. Everything I do in FC8 is trying to learn "C" and "ASM". Thanks.