Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to send 24 bit data using UART in PIC18F4520

Status
Not open for further replies.

Harshil3

Newbie level 4
Newbie level 4
Joined
Apr 28, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,318
Sir i want to send 24 bit data using USART in PIC18F4520.. i m using hi-tech c compliler and Mplab. please sir suggest me how to send data and please give some code for it. i m attaching one file which contains data that i have to send.. please some one help me out...
 
Last edited:

actually the excel sheet provided is the frame format of different commands. How can I create this frames and save in the controller so that whenever a request is made the corresponding frame can reply
 

Sir i want to send 24 bit data using USART in PIC18F4520.. i m using hi-tech c compliler and Mplab. please sir suggest me how to send data and please give some code for it. i m attaching one file which contains data that i have to send.. please some one help me out...

As ligo says.

Divide your data in 3 parts then use the USART todo send 8 bit packets(data low, mid and high).

That`s the best way or you could use software USART and send the complete 24bit data at once.
 

New Picture1.jpg
this is the screenshot of one of the frame .....like this frame there many other frames .....so do i need to format this frame in a structure ?
 

Post an example of the your different kind of frame. You need to send data 1 byte at a time. If you post an example of a complete frame then I will write a piece of code to send that frame. On the receiving side you have to collect and store the entire frame in a sting variable and check if data is valid. If data is valid then you can do further actions.
 

AA0105006655
here in this example
AA is the start byte
01 is the slave address
05 is the function code
00 is the data
66 is the crc &
55 is the stop byte
in response to this frame the data part will be filled with some data nd will responsed back
 
Last edited:

each of 8-bits and yes data can be 99 it may vary from 0-255 i.e in hex it will be 00-FF
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top