Protocols&Interfaces
Electronics is about voltage and stuffs but as humans we use it for connect devices and devices connected need ways to communicate.
PWM
The acronym means Pulse Width Modulation and it's the simplest way to digitally encode a signal using a single wire; it's defined by the duty cycle, i.e. the percentage of the cycle that the signal is on (0% is always off, 100% is always on) and its switching frequency, that identify how many seconds each raising edge appears.
Its fourier transformed form is given by this coefficients ( is the duty cycle )
UART and Serial
The simplest of protocols without needing a clock line, usually it's exposed as a 4 pins header but it's also possible to be exposed via already used IO port (like headphone socket or USB port via USB port multimedia switch).
- http://wiki.openwrt.org/doc/hardware/port.serial
- http://www.devttys0.com/2012/11/reverse-engineering-serial-ports/
- Chapter about design of a USART interface
I2C
It uses only two wires, and allows to connect up to 1008 slave devices.
SPI
It's a protocol with a clock line and a differentiation between devices that can be master (that provides clock) or slave. Although may there be only one master there is a signal (SS) that indicates which one of the (possible) multiple slaves must respond.
It has the disadvantage that the communication must be well defined in advance since the master must know how many clock cycle need to listen from the slaves.
SD Card
For example an SD Card use this protocol (see a link in the Bus Pirate page) how you can read here and here.
The pin CD
stand for card detection: when is low the card is inserted into its socket.
Links
- https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi
- Reference for SD card protocol
- SD Card Protocol
- Interfacing Microcontrollers with SD Card
- Interfacing Micro SD Card Module with Arduino
- SPI and SD cards
PS/2
JTAG
It's a protocol used to debug hardware and uses the following pins that constitute the TAP, the Test Access Port:
- TMS: Test Mode Select. This pin is used to cycle through the TAP-state machine.
- TCK: Test Clock.
- TDI: Test Data In. Serial input data to be shifted in to the Instruction Register or Data Register.
- TDO: Test Data Out. Serial output data from Instruction Register or Data Register.
There are also some optional pins:
TRST
:TAP
reset, optional because is always possible to out the state machine to a start stateSRST
: system reset, allows to reset the system
Usually on reference is indicated also the VTRef pin that indicates what is the voltage reference for the signals.
- JTAG explained
- How JTAG works
- Debugging with JTAG
- https://hackingbtbusinesshub.wordpress.com/2012/01/26/discovering-jtag-pinouts/
- http://sun.hasenbraten.de/~frank/docs/mpc824x_JTAG.html
- Header per SOC da farnell
- Slide of a talk about finding JTAG's pinout
- JTAGEnum Given an Arduino compatible microcontroller JTAGenum scans pins for basic JTAG functionality.
- http://www.sodnpoo.com/posts.xml/pace4000_jtag.xml
- https://www.youtube.com/watch?v=TlWlLeC5BUs
- http://electronics.stackexchange.com/questions/53311/why-jtag-connectors-are-available-in-10pins-14pins-20pins-when-jtag-is-of-5pins
- https://github.com/syncsrc/jtagsploitation
- Video Blackbox JTAG Reverse Engineering [26C3]
- Preparing Raspberry PI for JTAG Debugging
- Black Magic Probe V2 is a JTAG and SWD Adapter used for programming and debugging ARM Cortex MCUs.
- Using a JTAG in Linux Driver Debugging
- Can I use JTAG to debug my program on top of embedded Linux?
- The JTAG Interface: AN ATTACKER’S PERSPECTIVE
- Re-enabling JTAG and Debugging the WRT120N
- Locating JTAG pins automatically
- The jrev tool tries to automate the process of reverse-engineering the board connectivity. It probes all pairs of JTAG-scannable pins on the board.
- Practical JTAG: From 0 to 1
- SWD – ARM’S ALTERNATIVE TO JTAG
OpenOCD
- OpenOCD Configuration for Ethernut 5
- Seagate Dockstar JTAG Interface example of Bus Pirate + OpenOCD configuration and use
USB
This is a well known protocol, used everywhere in electronics devices, the acronym means Universal Serial Bus.
This protocol can work at three defined speeds
Name | Speed |
---|---|
Low | 1.5Mbit/s |
Full | 12Mbit/s |
High | 480Mbit/s |
The architecture of this protocol is tiered star topology, there can be no communication directly between USB devices.
- USB Central
- http://www.usbmadesimple.co.uk/ums_2.htm
- USB cables: shielding matters as well...
- High-Speed Interface Layout Guidelines
- TS3USB211 datasheet
VGA
- VGA On The Arduino With No External Parts Or CPU!
- VGA (Video Graphics Array) Interface and video signal documents
- VGA Controller (VHDL)
- CS/EE 3710 - Computer Design Lab - Lab 3 – VGA
- VGA Text-mode
- Hardware Level VGA and SVGA Video Programming Information Page
GPS
Dialup
Below the image of the handshake, for more explanation, refer to this post
Eink display
Floppy driver
- Floppy Disk Notes
- Preserving a floppy disk with a logic analyzer and a serial cable
- Recovering "lost" treasure-filled floppy discs with an oscilloscope
- keirf/Greaseweazle: Tools and USB interface for accessing a floppy drive at the raw flux level