Find Jobs
Hire Freelancers

Arduino Microcontroller TTL C++ Code (Master / Slave Communication)

$30-250 USD

进行中
已发布将近 5 年前

$30-250 USD

货到付款
The purpose of this code is to be able to send a command through Arduino C++ code to a slave device over Serial1 then have the master read back the returned values from the slave whenever it sends out a query (for further processing outside the scope of this project) but it should also optionally be able to display the Tx and Rx commands over Serial so it can be reviewed through the Arduino Serial Monitor. Note that the data is ultimately being sent through a RS485 device but that hardware is responsible for taking the TTL serial output and converting it both ways (so this code does not need to handle that). The Tx and Rx data will always be in the format of a single message is sent (Tx) and a single message is returned back (Rx). To send and receive a command, here is an example of working code. You do not need to use this exact method but it does show the message being sent and has been tested working. byte message [] = {0x01, 0x01, 0x09, 0x02, 0x00, 0x02, 0x02, 0x02, 0x20, 0x0B, 0x20, 0x00, 0x04}; [login to view URL](message, sizeof(message)); Which will send (Tx) the hex digits 01 01 09 02 00 02 02 02 20 0B 20 00 04. Please see the attachment for a visual example of the message format. The first value, 0x01 represents the Start Header. The fourth value, 0x02 represents the Start Data 0. The final value, 0x04 represents the Checksum. Those values and their location will never change in a Tx (or Rx for that matter) message. The second value, 0x01 represents the slave ID that this is being sent to. That will change but if the master is sending a command to 0x01, only 0x01 will respond and that value will always be 0x01 in that case. The 0x02 slave will never respond to a message sent to the 0x01 slave for example. Assuming the 0x01 slave unit is in a good operational state, the slave with an ID of 01 will respond (Rx) to the above message with: 01 01 0C 02 00 00 00 37 28 A2 08 5A 9D 24 00 04 Please see the attached image for a further breakdown of what this Rx message means. #1, 01 represents the Start Header. #2, 01 represents the slave ID. #3, 09 represents the lenght (in hex) so 9 in this case, a total length of 13 because no CRC and the Start Header, the ID, the Length and the End Telegram are not counted here. #4, 02 always indicates that this is Start Data 0. #5, 00 Motion Control Sub ID - This is where the actual message starts and will differ often. This is sub ID (00 in this case) #6, 02 Motion Control Main ID - this represents Write Motion Control Interface but that doesn't matter too much here except to represent the next value, the count, which needs to differ slightly from message to message. #7, 02 this is the count, which needs to change each time a Write Motion Control Tx message is sent (it can go from 01 to 02 and back to 01 or it can go from 01 to 02 and continue to 0F before wrapping back to 01 but when using the Write Motion Control Interface as selected by sending 00 #8, 02 above, the count needs to be different with each Tx that sends a Write Motion Control message. #9, 02 This is the Motion Cmd Intf Header High Byte Master ID =2 and can stay 02. #10, 20 Target position movement lowest byte #11, 0B Target position movement middle low byte #12, 20 Target position movement middle high byte #13, 00 Target position movement highest byte - so this and the prior 3 values (20 0B 20 00) represent this message telling the slave to move to the following location that is mapped to those 4 values. In this case, it maps out to 0x200B20, the desired value. #14, 04 is the End Telegram and will always be the last value of a Tx or Rx message even if a checksum is used. In this case, the purpose of this message is to send a command to the 01 slave to move to the 0x200B20 position. The slave responds and indicates it has received the command, has heard it and reiterates what it is doing (where it is now going to) and what state it is currently in. Please review the complete requirements file (attached).
项目 ID: 19787798

关于此项目

11提案
远程项目
活跃5 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
11威客以平均价$258 USD来参与此工作竞价
用户头像
Dear sir I have more than 10 years experience in embedded systems design, I can do the required Master/Slave protocol, please message me so that we can discuss more details Best regards
$120 USD 在3天之内
4.9 (276条评论)
7.6
7.6
用户头像
Dear Sir, We are experts in the byte stream encoding and decoding skill. Currently we were working on United States Repligen Corporation's systems which does a similar thing. They had provided us a protocol documentation defining TX and RX packet format. And we helped them establish communication between master and slave Because your case is similar you can count upon us Thanks & Regards Anuj Pathak Bhawna InTech
$200 USD 在15天之内
4.9 (15条评论)
6.2
6.2
用户头像
I have long experience with 8-bit , 16-bit and 32-bit micro-controllers. I work with Microchip (PIC) , Atmel (AVR , SAM) , ST (STM) , TI (MSP) , Nordic (nRF52), and NXP (LPC) micro-controllers. I use KEIL IDE , Atmel Studio , Code Composer Studio and MPLABX IDE . I deliver tested , neat and well-commented code that can be reused or modified for future development. You can see samples of my previous work on my portfolio and youtube channel. More to be discussed once you contact me . BR, M.T.
$250 USD 在3天之内
4.8 (43条评论)
6.1
6.1
用户头像
Hello, I have read the details provided and i am positive i can provide quality work,please contact me to discuss more on the project deadline and some other few things
$150 USD 在5天之内
4.0 (18条评论)
5.5
5.5
用户头像
I am specialist in development and interfacing between Android application and arduino board. hardware designing for embedded hardware. software development for embedded hardware. Home automation. Controlling hardware such as relay, dc motor, stepper motor,servo motor. Data monitoring,acquiring and analysis from server. Specialize in handling GSM ,GPRS and GPS Technologies Wireless technologies such as BLE,Bluetooth,zigbee and wifi.
$333 USD 在5天之内
4.7 (22条评论)
4.4
4.4
用户头像
Hello, My name is Andrei, i am a Romanian IOT Developer with a lot of experience in IOT projects and automatics . I see that as a library for Mod bus implementation , i have made slave master communication before , look at my profile . i deliver clean and clear code , tested manually and automatic . I can work with all types of Microcontroles programming in C , C++ , Mikro C , CCS C , Atmel Studio , Arduino , gcc . Creating Schematics and PCB in Kicad , Eagle , EasyEDA and Proteus (+simulation). i have an workshop full of parts and the infrastructure to build PCB and test the solution end to end using special tools (Spectrum analyzers , oscilloscope , logic analyzers ) Derivable on the project : Wiring diagram for prof of concept . MCU code explained every line . As an additional service i can make you a full working prototype and ship to you. Regards, Andrei
$200 USD 在7天之内
3.9 (27条评论)
5.5
5.5
用户头像
I DO NOT OUTSOURCE I have been a freelancer for the past 8 years, I believe that my experience and skill in this background will prove to be of great help to you. Contact me to discuss more on the details
$200 USD 在3天之内
4.0 (13条评论)
4.5
4.5
用户头像
Hello I'm an embedded software engineer and I would like to hear about your project requirements to estimate how much effort is needed to complete the job. so I can adjust my bid to job complexity. Best regards
$250 USD 在10天之内
5.0 (2条评论)
1.0
1.0
用户头像
Hi I'm a Computer Engineer and have studied your document attach to the task I will like to code your project as I have a experience in arduino Coding and implementation of different hardware. I had done task like controlling devices from Mobile Bluetooth and from web page. Your project will use SPI communications I will need at least 10 days to give you the complete code.
$140 USD 在7天之内
0.0 (0条评论)
0.0
0.0
用户头像
I can help you in this project. I have 8 years of C++ coding experience. I have worked many projects based on arduino. I have been working on multiple robotics related projects which include C++ programming
$250 USD 在3天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
Mebane, United States
5.0
27
付款方式已验证
会员自2月 2, 2009起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。