CAN internal

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
carworker
Posts: 4
Joined: Sat Dec 31, 2022 11:04 am
Contact:

CAN internal

Post 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.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: CAN internal

Post by kersing »

It helps if you tell what controller you are using. And post the flowchart you are experiencing issues with.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

carworker
Posts: 4
Joined: Sat Dec 31, 2022 11:04 am
Contact:

Re: CAN internal

Post 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.
Attachments
Test CAN 2 2680 ID Ulong.rar
(98.93 KiB) Downloaded 100 times
Test CAN 1 2680.rar
(107.74 KiB) Downloaded 93 times

carworker
Posts: 4
Joined: Sat Dec 31, 2022 11:04 am
Contact:

Re: CAN internal

Post 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.
Attachments
Test CAN 2 2680 ID Ulong.rar
(194.84 KiB) Downloaded 108 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: CAN internal

Post 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

carworker
Posts: 4
Joined: Sat Dec 31, 2022 11:04 am
Contact:

Re: CAN internal

Post 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.

Post Reply