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 2010Parallel 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 2010Parallel 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 2010Parallel 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.I’ve read the dataNew data availablePort APort APort APARALLEL COMMUNICATIONSis ready for new data.NEW DATANeed 11 wires to transmit 8 bits of dataDVDRDVDRUse two lines −− Handshake −− sender knows when receiver– 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 (DV goes low) it readsthe data on the data lines, then brings DR low to say that it has read the data.– When the sending computer sees the recieving computer has read the data (DRgoes 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 2010Serial 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 2010Types of Serial Data Transfer• Asynchronous serial (no clock between devices; uses internal clocks to synchronize datatransfer)– RS-232 (typically ± 12V), RS-485 (± 6V)• Synchronous serial (clock line between devices to synchronize data transfer)– 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 (Universal 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 2010Synchronous 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 Asynchronous Serial Data Transfer, both sides use an internal clo ck with approxi-mately the same 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 devices for thesending device to tell the receiving device 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 2010Synchronous Serial Data Transfer• In synchronous serial data transfer, the sending device puts the data byte it wants tosend into an internal shift register.• The sending device uses a clock to shift the 8 data bits out of the shift register onto anexternal data pin.• The receiving device puts the data from the sending device on the input of an internalshift register.• The receiving device uses the clock from the sending device to shift the data into itsshift register.• After 8 clock ticks, the data has been transfered from the sending device to the receivingdevice.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 2010The 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 e xternal clock 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 2010ClockMOSIMISOMasterSlaveClkSSMOSITV11010110TVClockTVMISO10100101SP0DRSP0DRSynchronous Serial Communications9EE 308 Spring 2010Use of Slave Select with the HCS12 SPI• A master HCS12 can talk with more than one slave HCS12’s• A


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?