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.

Writing program for 8051 in C & assembly for communication protocol

Status
Not open for further replies.

Khan740

Junior Member level 2
Joined
Jan 17, 2011
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,401
Hi,

I want to know how to write a program in assembly and C (for 8051 microcontroller) for the communication protocol, As shown below:


SOC Ack LOD Ack DATA Ack EOC

where;
SOC: Start of communication
Ack: Acknowledgment to remote station
LOD: Length of data
EOC: End of Conversion
 

Attachments

  • Program in assembly and in C is required for the following communication protocol.doc
    26.5 KB · Views: 72

you will need a compiler for the microcontroller

I suggest keil mvision, https://www.keil.com/demo/eval/c51.htm

also an easier one is MikroC which has a lot of manuals, mikroC PRO for 8051 2009 - C compiler for 8051 microcontroller - mikroElektronika

using the serial port is some what easy

you need a master and a slave microcontroller

the master will have two predefined bytes (SOC ,EOD) and (ACK) to compare the received ACK with it
the data will be taken from any source and you can get its length from STRLEN function or a for loop in C , or an incremet command in assembly.

on the contrary, as for the slave it will have one (ACK) to be sent and two (SOC, EOC) to compare the received ones with
it will store the data using a for loop that loops LOD number of times.
 

Please send me a sample of code, if you can.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top