Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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?
 

ads-ee

Super Moderator
Staff member
Joined
Sep 10, 2013
Messages
7,625
Helped
1,771
Reputation
3,548
Reaction score
1,714
Trophy points
1,393
Location
USA
Activity points
57,602
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.
 

Warpspeed

Advanced Member level 5
Joined
May 23, 2015
Messages
2,213
Helped
753
Reputation
1,508
Reaction score
731
Trophy points
113
Location
Melbourne, Australia
Activity points
17,766
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.
 

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
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.
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,174
Helped
1,140
Reputation
2,299
Reaction score
1,114
Trophy points
1,403
Location
Brazil
Activity points
53,279
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.
 

Warpspeed

Advanced Member level 5
Joined
May 23, 2015
Messages
2,213
Helped
753
Reputation
1,508
Reaction score
731
Trophy points
113
Location
Melbourne, Australia
Activity points
17,766
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top