DOC PREVIEW
NMT EE 308 - Parallel Data Transfer

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 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 13 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 13 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 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

EE 308 Spring 2009Parallel Data Transfer• Suppose you need to transfer data from one HCS12 to another. How can you do this?• You could connect PORTA of the sending computer (set up as an output port) toPORTA of the receiving computer (set up as an input port).• The sending computer puts the data on its PORTA, one byte at a time.• The receiving computer reads the data on its PORTA.• For example, want to sent the five bytes corresponding to the five characters ”hello”:Port A0x68 0x65 0x6c 0x6fh e oPort APARALLEL COMMUNICATIONSlNeed 9 wires to transmit 8 bits of dataHow can receiver tell when it should read the data?Port A1EE 308 Spring 2009Parallel Data Transfer• The sending computer needs to tell the receiving computer when to read the data.• It can do this with another line used as a clock line.• On the rising edge of the clock line, the receiving computer should read the data:Port A0x68 0x65 0x6c 0x6fh e ll oPort AclkclkclkPARALLEL COMMUNICATIONSNeed 10 wires to transmit 8 bits of dataPort A2EE 308 Spring 2009Parallel Data Transfer– How can the sending computer know that the receiving computer has received thedata?– Can use a method called handshaking.∗ The sending computer uses a Data Valid line to tell the receiving computerthat the data on the data lines is valid.∗ The receiving computer uses a Data Received line to tell the sending computerthat it has read the current data byte.Port APort APARALLEL COMMUNICATIONSUse two lines −− Handshake −− sender knows when receiveris ready for new data.NEW DATANeed 11 wires to transmit 8 bits of dataDVDRDVDRPort A– In the above figure, the sending computer puts the data on the data lines andbrings DV low to indicate new data is available.– When the receiving computer sees the new data is available it reads the data onthe data lines, then brings DR low to say that it has read the data.– When the sending computer sees DR go low, it brings DV high.– When the receiving computer sees DV go high, it brings DR high.– Both computers are now ready for the next data transfer.3EE 308 Spring 2009Serial Data Transfer• Using parallel data transfer you can use 10 wires to transfer one byte at a time fromone computer to another.• Using 18 wires, you can transfer two bytes (16 bits) at a time.• Parallel data transfer is a very fast way to transfer data between two computers.• There are two problems with parallel data transfer:– It takes a lot of wires between the computers.– It uses lots of I/O pins on the computers.• Serial data transfer is a slower transfer mechanism, but it uses fewer wires and fewerI/O pins.• Serial data transfer sends one bit at a time between two computers:SERIAL COMMUNICATIONSserial out serial in0 1 0 1 0’h’ = 0x68 = B"01101000"Can’t tell how many ones or zeros there are4EE 308 Spring 2009Types of Serial Data Transfer• Asynchronous serial– RS-232, RS-485• Synchronous serial– SPI (Synchronous Peripheral Interface)– IIC or I2C (Inter-Integrated Circuit)• Differential Serial (Typically ±3 V, clock and signal intermixed on same wires)– CAN (Controller Area Network)– Ethernet– USB (Universial Serial Bus• LVDS (Low Voltage Differential Signaling) (±350 mV) LVDS is much faster than othermethods, and uses much less power, bec ause voltage swing is much smaller.– Firewire– Serial ATA– PCI Express– Many others – wave of the future5EE 308 Spring 2009Synchronous Serial Data Transfer• To use serial data transfer, you need to have a way for the receiving c omputer to knowwhen the data bit is valid.• There are two ways to do this:– Asynchronous Serial Data Transfers (SCI on the HCS12)– Synchronous Serial Data Transfers (SPI on the HCS12)• For Asyncynchronous Serial Data Transfer, both sides use a common clock frequency,and a protocol to allow internal synchronization of the data (to be discussed later).• Synchronous Serial Data Transfer uses a clock line between the two computers for thesending computer to tell the receiving computer when each data bit is valid:clkclkclk clkserial out serial in0 1 1 0 1 0 00Need 3 wires to transmit 1 bit at a time’h’ = 0x68 = B"01101000"SYNCHRONOUS SERIAL COMMUNICATIONS6EE 308 Spring 2009Synchronous Serial Data Transfer• In synchronous serial data transfer, the sending computer puts the data byte it wantsto send into an internal shift register.• The sending computer uses a clock to shift the 8 data bits out of the shift register ontoan external data pin.• The rec eiving computer puts the data from the sending computer on the input of aninternal shift register.• The receiving computer uses the clock from the sending computer to shift the data intoits shift register.• After 8 clock ticks, the data has been transfered from the sending computer to therecieving computer.0 1 1 0 1 0 00Need 3 wires to transmit 1 bit at a time’h’ = 0x68 = B"01101000"SYNCHRONOUS SERIAL COMMUNICATIONSclkclkclkclkshift register shift register7EE 308 Spring 2009The HCS12 Serial Peripheral Interface (SPI)• The HCS12 has a Synchronous Serial Interface• On the HCS12 it is called the Serial Peripheral Interface (SPI)• If an HCS12 generates the clock used for the synchronous data transfer it is op eratingin Master Mode.• If an HCS12 uses and external clockused for the synchronous data transfer it is operatingin Slave Mode.• If two HCS12’s talk to each other using their SPI’s one must be set up as the Masterand the other as the Slave.• The output of the Master SPI shift register is connected to the input of the Slave SPIshift register over the Master Out Slave In (MOSI) line.• The input of the Master SPI shift register is connected to the output of the Slave SPIshift register over the Master In Slave Out (MISO) line.• After 8 clock ticks, the data originally in the Master shift register has been transferedto the s lave, and the data in the Slave shift register has been transfered to the Master.8EE 308 Spring 2009ClockMOSIMISOMasterSlaveClkSSMOSITV11010110TVClockTVMISO10100101SP0DRSP0DRSynchronous Serial Communications9EE 308 Spring 2009Use of Slave Select with the HCS12 SPI• A master HCS12 can talk with more than one slave HCS12’s• A slave HCS12 uses its Slave Select (SS) line to determine if it is the one the master istalking with• There can only be one master HC S12, bec ause the master HCS12 is the device whichgenerates the serial clock signal.MasterSS SSMOSIMISOClockSlave 1 Slave


View Full Document

NMT EE 308 - Parallel Data Transfer

Documents in this Course
Load more
Download Parallel Data Transfer
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 Data Transfer 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 Data Transfer 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?