2024-12-26 03:53 AM
So, I have designed a simple simulator tool for CAN protocol application. So, in that simulator I will be loading the csv file containing some data. This data I have to transmit to CAN bus. I have written a code for CAN transmission, but I am not able to write the UART code to receive the data through the simulator. I am using a FTDI for this so data will be sent through simulator to the controller (STM32F1) and simultaneously the data has to be sent to the CAN so data reception from UART and transmission to CAN should be simultaneous that is in run time
2024-12-26 03:57 AM
Hello @Hardware_Enthusiast and welcome to the community.
Your request is not clear. May be better to draw a sketch on what you want to do..
2024-12-26 04:12 AM
So, I have written a code for simulator whose basic task is load a CSV file which contains some data. Now I have a STM32F1 series controller with me. So now basic approach to send the data to the CAN bus using a controller will be to declare the complete data in a form of array right. But instead of that what I want to do is the simulator that I have developed using python, in that I will load my CSV file. After loading the csv file the data present in the csv file will be sent to the controller using UART communication. So like instead of declaring the data in the form of array in the controller code, I will receive the data from simulator using UART. Now after receiving this data from the UART simultaneously I will send the data towards the CAN bus.
2024-12-26 04:52 AM
Still not clear.
Does FTDI has CAN bus interface? Need to provide more information about that FTDI.
As far as I know FTDI is a bridge/converter between USB and UART not UART to CAN.
And also the question is not clear: "but I am not able to write the UART code to receive the data through the simulator"
And what is the relation of that issue with CAN communication. Please be more concise.
2024-12-26 11:23 AM
UART data via FTDI USB-to-Serial forwards to CAN on same F1 device.
Not clear how the data is packetized, but I'd imagine a reception/completion in the UART IRQ Handler one could enqueue packets to the CAN output process.
2024-12-29 09:39 PM - edited 2024-12-29 09:41 PM
Sorry for the confusion, you are right FTDI is not related to the CAN protocol. See, just to be simple, forget about the CAN protocol, is it possible to send a data serially using a FTDI from a software (specifically a GUI coded using python) to a controller (STM32F1) and if it is so how can we do that?
2024-12-29 10:29 PM
Open COM or /dev/tty and write to it?