This preview shows page 1-2-16-17-18-33-34 out of 34 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 34 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Parallel IOSerial IOParallel vs. Serial IOsimplex vs half-duplex vs full-duplexWires: Simplex, Half-duplexWires: Full DuplexSynchronous Serial IOAsynchronous Serial IOA Three-Wire Async Serial InterfaceAsynchronous Serial Data FormatsParityExampleReceiver SamplingBaud Rate vs Bits Per SecondCommon Baud RatesSoftware-driven Serial I/OPIC18Fxx2 USARTUSART RegistersRCIF, TXIF BitsTransmit HardwareReceive Hardwaregetch()/putch() (USART)Baud Rate ControlBaud Rate ExamplesEnabling Async Serial IOExample C code to Enable Serial I/OReceive Error ConditionsPIC18Fxx2 to PC Serial IO ConnectionWhat is EIA-RS232?MAXIM 202 RS232 driver/receiverHyperTerminalecho.c – Testing the serial portWhat do you have to know?V 0.6 1Parallel IOParallel IO – data sent over a group of parallel wires. Typically, a clock is used for synchronization.CPU #1D[15:0]clkCPU #2A 16-bit data channel is shown above. If data is transferred each rising clock edge, and clock rate is 300 MHz, then the data transfer rate (bandwidth) in bytes/sec is:2 Bytes/clock period = 2 /(1/300e06)s = 2 * 300e06/s = 600e06/s = 600 MB/s (MB = MBytes)V 0.6 2Serial IOSerial IO – data sent one bit at a time, over a single wire. A clock may or may not be used for synchronizationCPU #1DCPU #2clkQuestion: Assuming one bit is sent each rising clock edge, how fast does the clock have to be achieve 600 MB/s? 600 MByte/s = 600 MBytes/s * 8 bits/1Byte = 4800Mb/sClock period = 1/4800e06Clock Frequence = 1/clock period = 4800e06 = 4.8e09 = 4.8GHzV 0.6 3Parallel vs. Serial IOSerial IO Pros/ConsParallel IO Pros/ConsPros: Speed, can increase bandwidth by either making data channel wider or increasing clock frequencyCons: Expensive (wires cost money!). Short distance only – long parallel wire causes crosstalk, data corruption.Pros: Cheap, very few wires needed. Good for long distance interconnect.Cons: Speed; the fastest serial link will typically have lower bandwidth than the fastest parallel link. However, for long distances (meters), new fast serial IO standards (USB2, Firewire) have replaced older parallel IO standards.V 0.6 4simplex vs half-duplex vs full-duplexFor communication channelsCPU #2CPU #1simplex: communication in one direction onlyCPU #1CPU #2orHalf-duplex: communication in either direction, but only one way at a timeCPU #1CPU #2Full-duplex: communication in both directions at same time.V 0.6 5Wires: Simplex, Half-duplexFor wires:simplex wire: communication occurs only in one direction.uni-directionalTxRxhalf-duplex wire: communication can occur in either direction, but with voltage signaling only one direction at a time.OeRxbi-directionalTxTxRxOeV 0.6 6Wires: Full DuplexCurrent mode signaling allows full duplex communication over a single wire. Used for communication in some advanced chipsets.ia + ibRx = ib-+ia + ibiaTxTx+-ibia + ibibiaCurrents add, voltages do not!Rx = iaV 0.6 7Synchronous Serial IO Synchronous Serial IO ChannelCPU #1CPU #2Internal clock frequencies match to within a tolerance value. Can be out of phaseSynchronous serial IO either (a) sends the clock as a separate wire OR(b) receiver (CPU #2) extracts clock from data stream or uses a Phase-Locked-Loop (PLL) and changes in the data stream to synchronize internal clock (phase alignment) to data stream. For PLL synchronization, the data line must be guaranteed to have a minimum number of state changes (0 → 1 or 1 →0) within a particular time interval (transition density). Synchronous serial IO can achieve high speeds; all new high speed serial standards are synchronous.V 0.6 8Asynchronous Serial IOAsynchronous Serial IO ChannelCPU #1CPU #2Internal clock frequencies match to within a tolerance value. Can be out of phaseAsynchronous Serial I/O does not transmit the clock on a separate wire nor does it guarantee a particular transition density (ie., the data line could remain in the same state, either ‘1’ or ‘0’ for the duration of the transmission after the initial state change indicating start of transmission).Asynchronous Serial I/O is used in older standards, is easy to implement, but is slower than synchronous serial standards.V 0.6 9A Three-Wire Async Serial Interface We will use a three-wire asynchronous serial interface to connect the PIC to an external PC. This interface standard is known as RS-232 (there are more wires defined in the standard, we will only use 3 wires)CPU #1CPU #2Tx RxRx Txgnd gndEach wire is simplex, but communication channel is full duplexTx:transmit, Rx:ReceiveV 0.6 10Asynchronous Serial Data FormatsData sent LSb to MSb.On the PIC, will use 8 data bits.V 0.6 11Parity•A parity bit is an extra bit added to a data frame to detect a single bit error– A single bit error is when one bit of the frame was received incorrectly (read as ‘0’ when should have been ‘1’, or vice-versa). – Not guaranteed to detect multi-bit errors• Odd parity – parity bit value makes the total number of ‘1’ bits in the frame odd– For 7-bit data value 0x56 (1010110), odd parity bit = ‘1’• Even parity – parity bit value makes the total number of ‘1’ bits in the frame even– For 7-bit data value 0x56 (1010110), even parity bit = ‘0’V 0.6 12ExampleV 0.6 13Receiver Samplingone bit timenext bit0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1 2 3 4sample hereReceiver clock; period usually either 64x or 16x bit time (above is 16x).At start bit, internal 4-bit counter set to 0. Sample at mid-point of bit time (counter value 7 or 8, some receivers sample at 7,8 and 9 and only accept bit if all values are the same – do this for glitch rejection). Receiver/Transmitter clocks not perfectly matched. Our tolerance is ½ bit time (50%) spread over entire frame. Assuming a 10 bit frame, maximum mismatch between Rx/Tx clocks is 50%/10 = 5%,V 0.6 14Baud Rate vs Bits Per Second• Baud rate is the rate at which signaling events are sent• Bits per second (bps) is the number of bits transferred per second (any type of bits, data or overhead bits)• If only a ‘1’ or ‘0’ is sent for each signaling event, then baud rate = bps• However, could use a signaling protocol that transfers multiple bits per signaling event– i.e., use 4 different voltage levels, send two bits of data per signaling event (00 = -15v, 01= -5v, 10=+5v, 11 = 5v).– In this case, bit rate will be double the baud rate • The effective data rate is the rate at which data is transferred, minus the overhead bits (ie. start and stop bits).V


View Full Document

MSU ECE 3724 - Parallel IO

Documents in this Course
Timers

Timers

38 pages

TEST 4

TEST 4

9 pages

Flags

Flags

6 pages

Timers

Timers

6 pages

Timers

Timers

54 pages

TEST2

TEST2

8 pages

Load more
Download Parallel IO
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Parallel IO and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Parallel IO 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?