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.

Protocol for interfacing with a microcontroller

Status
Not open for further replies.

ElectroxX

Newbie level 6
Joined
Dec 21, 2011
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,421
Hello,

I want to transfer data to and from a microcontroller over UART. Now I have a homemade protocol sending numerical information in ASCII format. It's working, but I would rather work with some suitable standard protocol if there is some out there?
 

The layer 2 UART protocol of start/data/parity/stop bits is well defined, but beyond that 7 or 8-bit transfer there isn't any kind of layer 3 protocol that I've ever seen or heard of, e.g. some higher level packet based structure. Everyone seems to just send bytes and decide what those bytes mean on a case by case bases.
 

UART with standard start stop protocol is about the only recognised standard.
Its very well supported with hardware, and its pretty ideal for ASCII format.
Baud rates have climbed over time, but its a very old and very reliable system.
 

I mean ASCII is rather decent for sending small stubs of information, like lighting up a single led or something. But when wanting to send a lof of commands and information it feels a bit unecessary to do all this from scratch using byte-by-byte ASCII. In my particular case I want to interface with a robot, sending both commands and receving information. Sure, I've gotten it to work but I think it was a bit of a hassle. It would be weird if somebody else hadn't implemented some nice generalised structure for this already that could be reused.
 

It would be weird if somebody else hadn't implemented some nice generalised structure for this already that could be reused.
I fear that you are perhaps misunderstanding the term protocol with framing format, neither if it is really required to implement a highest layer of communication protocol too much elaborated within a microcontroller's level, but at least in the past, the HDLC it was a standard pattern in term of negotiating data packs. Myself, I have made a system that used a simplified version of this model.
 

But when wanting to send a lof of commands and information it feels a bit unecessary to do all this from scratch using byte-by-byte ASCII.
You can use a standard UART with start stop protocol to send eight bits.
Many microcontrollers already have that hardware inside anyway.
Those eight bits do not have to be ASCII characters, it could be hex or eight individual bits of random data.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top