Difference between revisions of "Microcontroller Serial Communications Articles"

From OpenCircuits
Jump to navigation Jump to search
(link to related articles, etc.)
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:
  
 
* Microcontroller Serial Communications Articles this article, the a root for the articles on the site.
 
* Microcontroller Serial Communications Articles this article, the a root for the articles on the site.
 +
 +
* Often it's useful (at least for initial debugging, and later to unambiguously check what version of the code the Arduino is *actually* running) to have a simple text-based protocol to send commands to an Arduino and receive status from the Arduino:
 +
** [[Smarter Arduino Programming - Tips and Tricks]] which discusses the Arduino side of the starting point of a simple protocol: BlinkInstruct https://github.com/russ-hensel/BlinkInstruct
 +
** the Serial Monitor in the Arduino IDE (running on a laptop or a Raspberry Pi) is sufficient to do some debugging with a text-based protocol
 +
** [[Python Smart Terminal]] (running on a laptop or a Raspberry Pi) is discussed in many articles here ([[:Category:SmartTerminal]]) can be used instead of the Arduino Serial Monitor; and makes a good starting point for more sophisticated programs (running on a Raspberry Pi or other dedicated server) that need to interact with an Arduino.
  
 
* [[BitWacker PIC and Other Microcontroller to Java Communications]] an oveview of the applications for Microcontroller Serial Communications.
 
* [[BitWacker PIC and Other Microcontroller to Java Communications]] an oveview of the applications for Microcontroller Serial Communications.
Line 26: Line 31:
 
* [[SPI]] is a popular protocol for many small peripheral chips
 
* [[SPI]] is a popular protocol for many small peripheral chips
  
 +
* [[I2C]] is another popular protocol for many small peripheral chips
 +
 +
* [[CAN bus]] is designed to allow low-cost devices to communicate with each other within a vehicle without a host computer.
 +
 +
* Local Interconnect Network (LIN) is designed to be even lower-cost than CAN bus. Some large systems use many simple sensors in low-cost LIN sub-networks, then connect the single master of each LIN sub-network with CAN or some other backbone network.
 +
 +
* The [[1-wire]] network is designed to be an even lower-cost network for small peripheral chips
 +
 +
* The [[Servo control]] system for remote-control vehicles
 +
 +
* [[JTAG]] is often used for programming and debugging.
 +
 +
Often a serial protocol is the interface between 2 programs in 2 completely different [[Programming Languages]].
 +
It makes debugging much easier if the communications protocol is human-readable and human-writable.
 +
 +
Some microcontrollers have enough resources that
 +
the "application-level" data interface, the debugging interface ("debug port"), and the programming interface
 +
can each use completely separate, dedicated pins.
 +
Sometimes the same serial interface
 +
can be used for both "application-level" data (sensor data, motor torque / speed, PID settings, etc.) as well as debugging information.
 +
Once a microcontroller has been programmed with a bootloader,
 +
sometimes the same serial interface can also be used to send new software to the microcontroller.
 +
(Preferably the application protocol, the debug protocol, and the bootloader protocol
 +
can be easily distinguished so that a little debug information can squeeze in between bursts of application data,
 +
and neither one accidentally triggers the bootloader.
 +
).
  
 
== Microcontroller Projects that Use Serial Communications ==
 
== Microcontroller Projects that Use Serial Communications ==
  
*[[PIC Stepper Motor Tester]]
+
*[[Stepper Motor Demonstration and Tester]] a project for both PIC's and Arduinos.
 
 
*[[Stepper Motor Tester for the Arduino]]
 
  
 
*[[Arduino Command Interpreter]]
 
*[[Arduino Command Interpreter]]
Line 45: Line 74:
 
== Other Readings ==
 
== Other Readings ==
  
*[http://en.wikibooks.org/wiki/Serial_Programming Serial Programming -- From Wikibooks, the open-content textbooks collection]
+
* [[Projects#Audio as sensor data format]]: sending data as audio has many similarities (and some key differences) from sending data as binary Hi and Lo pulses.
 +
* [[Radio communication]] has many similarities (and some key differences) from sending data as binary Hi and Lo pulses.
 +
* Many [[Modules]] use serial communication
 +
* [[PC-Microcontroller Communications]] often use serial communication
 +
* [[Expansion bus]] discusses parallel communication, which was once far more common.
 +
 
 +
*[http://en.wikibooks.org/wiki/Serial_Programming Serial Programming -- From Wikibooks, the open-content textbooks collection]; which mentions some unavoidable tradeoffs in [https://en.wikibooks.org/wiki/Serial_Programming/Forming_Data_Packets | Serial Programming/Forming Data Packets]]
 
*[http://www.pharmalabauto.com/Electronics/pdfs/RS232.pdf Application Note 83 Fundamentals of RS–232 Serial Communications] a pdf, good
 
*[http://www.pharmalabauto.com/Electronics/pdfs/RS232.pdf Application Note 83 Fundamentals of RS–232 Serial Communications] a pdf, good
 +
*[http://www.myplogger.com/circuit/admin/aa13af474cb1e3a0b1f51b6fa84e88c5.pdf {Serial Communications Protocol}] a pdf, not just for the PIC18
 +
 +
* [[Expansion bus]] is a more general article that covers various ways (including, but not limited to, serial interfaces) that processors (including, but not limited to, a microcontrollers) can communicate with other devices .
  
 
[[category:Serial Communications]][[category:Microcontroller]][[category:Techniques]][[category:BoostC]][[category:Arduino]]
 
[[category:Serial Communications]][[category:Microcontroller]][[category:Techniques]][[category:BoostC]][[category:Arduino]]

Latest revision as of 16:11, 12 November 2025

We have several related articles about Microcontroller Serial Communications on this site. These articles themselves have many links off site.

  • Microcontroller Serial Communications Articles this article, the a root for the articles on the site.
  • Often it's useful (at least for initial debugging, and later to unambiguously check what version of the code the Arduino is *actually* running) to have a simple text-based protocol to send commands to an Arduino and receive status from the Arduino:
    • RS232/USB Probe an application with much of the functionality of a terminal emulator but with specialized extensions for for MicroController command response control. The basis for a series of more specialized applications. See it for information on installation of all the applications and for access to the bug and enhancement list.
    • USB Bit Whacker Brief discussion of this interesting development board with built in USB communications.


  • RS232 a discussion of some of the theory behind Microcontroller Serial Communications. The PC side of this is implemented by RS232/USB Probe and its related applications.
  • PC-Microcontroller Communications an article on some of the technology of microcontroller communications and lots of external links. List of terminal emulators and alternatives to Hyper Terminal.
  • SPI is a popular protocol for many small peripheral chips
  • I2C is another popular protocol for many small peripheral chips
  • CAN bus is designed to allow low-cost devices to communicate with each other within a vehicle without a host computer.
  • Local Interconnect Network (LIN) is designed to be even lower-cost than CAN bus. Some large systems use many simple sensors in low-cost LIN sub-networks, then connect the single master of each LIN sub-network with CAN or some other backbone network.
  • The 1-wire network is designed to be an even lower-cost network for small peripheral chips
  • JTAG is often used for programming and debugging.

Often a serial protocol is the interface between 2 programs in 2 completely different Programming Languages. It makes debugging much easier if the communications protocol is human-readable and human-writable.

Some microcontrollers have enough resources that the "application-level" data interface, the debugging interface ("debug port"), and the programming interface can each use completely separate, dedicated pins. Sometimes the same serial interface can be used for both "application-level" data (sensor data, motor torque / speed, PID settings, etc.) as well as debugging information. Once a microcontroller has been programmed with a bootloader, sometimes the same serial interface can also be used to send new software to the microcontroller. (Preferably the application protocol, the debug protocol, and the bootloader protocol can be easily distinguished so that a little debug information can squeeze in between bursts of application data, and neither one accidentally triggers the bootloader. ).

Microcontroller Projects that Use Serial Communications

Other Readings

  • Expansion bus is a more general article that covers various ways (including, but not limited to, serial interfaces) that processors (including, but not limited to, a microcontrollers) can communicate with other devices .