Find Jobs
Hire Freelancers

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

$30-250 USD

Në vazhdim
Postuar almost 5 years ago

$30-250 USD

Paguhet në dorëzim
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 e Projektit: 19787798

Rreth projektit

11 propozime
Projekt në distancë
Aktive 5 yrs ago

Po kërkoni të fitoni para?

Përfitimet e ofertës për Freelancer

Vendosni buxhetin dhe afatin tuaj
Paguhuni për punën tuaj
Përshkruani propozimin tuaj
Është falas të regjistrohesh dhe të bësh oferta për punë
11 freelancers are bidding on average $258 USD for this job
Avatari i Përdoruesit
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 në 3 ditë
4,9 (276 përshtypje)
7,6
7,6
Avatari i Përdoruesit
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 në 15 ditë
4,9 (15 përshtypje)
6,2
6,2
Avatari i Përdoruesit
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 në 3 ditë
4,8 (43 përshtypje)
6,1
6,1
Avatari i Përdoruesit
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 në 5 ditë
4,0 (18 përshtypje)
5,5
5,5
Avatari i Përdoruesit
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 në 5 ditë
4,7 (22 përshtypje)
4,4
4,4
Avatari i Përdoruesit
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 në 7 ditë
3,9 (27 përshtypje)
5,5
5,5
Avatari i Përdoruesit
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 në 3 ditë
4,0 (13 përshtypje)
4,5
4,5
Avatari i Përdoruesit
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 në 10 ditë
5,0 (2 përshtypje)
1,0
1,0
Avatari i Përdoruesit
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 në 7 ditë
0,0 (0 përshtypje)
0,0
0,0
Avatari i Përdoruesit
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 në 3 ditë
0,0 (0 përshtypje)
0,0
0,0

Rreth klientit

Flamuri i UNITED STATES
Mebane, United States
5,0
27
Mënyra e pagesës u verifikua
Anëtar që nga shk 2, 2009

Verifikimi i klientit

Faleminderit! Ne ju kemi dërguar me email një lidhje për të kërkuar kredinë tuaj falas.
Ndodhi një gabim gjatë dërgimit të email-it tuaj. Ju lutemi provoni përsëri.
Përdorues të regjistruar Punë të postuara
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Po ngarkohet shikimi paraprak
Leja u dha për Geolocation.
Seanca e hyrjes ka skaduar dhe ke dalë. Hyr sërish.