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:

• Introduction the Serial Communications • Huang Sections 9.2, 10.2 • SCI Block User Guide • SPI Block User Guide Parallel 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) to PORTA 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”:Need 9 wires to transmit 8 bits of dataHow can receiver tell when it should read the data?Port APort A 0x68 0x65 0x6c 0x6f h e l oPARALLEL COMMUNICATIONSParallel 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:Need 10 wires to transmit 8 bits of data– How can the sending computer know that the receiving computer has received the data?– Can use a method called handshaking.* The sending computer uses a Data Valid line to tell the receiving computer that the data on the data lines is valid.* The receiving computer uses a Data Received line to tell the sending computer that it has read the current data byte.Port A clkPort Aclk 0x68 0x65 0x6c 0x6f h e l oPARALLEL COMMUNICATIONSUse two lines −− Handshake −− sender knows when receiveris ready for new data.Need 11 wires to transmit 8 bits of data– In the above figure, the sending computer puts the data on the data lines and brings DV low to indicate new data is available.– When the receiving computer sees the new data is available it reads the data on the 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. Port A DVPort ADR New DataPARALLEL COMMUNICATIONSDVDRAn example of parallel data transferSerial Data Transfer• Using parallel data transfer you can use 10 wires to transfer one byte at a time from one 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 fewer I/O pins.• Serial data transfer sends one bit at a time between two computers:’h’ = 0x68 = %01101000Can’t tell how many ones or zeros there areSynchronous Serial Data Transfer• To use serial data transfer, you need to have a way for the receiving computer to know when the data bit is valid.• There are two ways to do this:– Synchronous Serial Data Transfers (Serial Peripheral Interface (SPI) on the HCS12)– Asynchronous Serial Data Transfers (Serial Communication Interface (SCI) on the HCS12)• Synchronous Serial Data Transfer uses a clock line between the two computers for the sending computer to tell the receiving computer when each data bit is valid: Serial Out Serial in 0 1 1 1(?) 0 1 0 SERIAL COMMUNICATIONS’h’ = 0x68 = B"01101000"Need 3 wires to transmit 1 bit at a timeSynchronous Serial Data Transfer• In synchronous serial data transfer, the sending computer puts the data byte it wants to send into an internal shift register.• The sending computer uses a clock to shift the 8 data bits out of the shift register onto an external data pin.• The receiving computer puts the data from the sending computer on the input of an internal shift register.• The receiving computer uses the clock from the sending computer to shift the data into its shift register.• After 8 clock ticks, the data has been transferred from the sending computer to the receiving computer. Serial Outclk Serial inclk 0 1 1 0 1 0 0 0_|_____|________|_______|_____|_____|______|_____|_____| SYNCHRONOUS SERIAL COMMUNICATIONS4-bit parallel-access shift register.Q3Q2Q1Q0ClockParallel inputParallel outputShift/LoadSerialinputDQQDQQDQQDQQ clk 0 1 1 0 1 0 0 0SYNCHRONOUS SERIAL COMMUNICATIONSShift Reg.Shift Reg.clk’h’ = 0x68 = B"01101000"Need 3 wires to transmit 1 bit at a timeThe 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 operating in Master Mode.• If an HCS12 uses and external clock used for the synchronous data transfer it is operating in Slave Mode.• If two HCS12’s talk to each other using their SPI’s one must be set up as the Master and the other as the Slave.• The output of the Master SPI shift register is connected to the input of the Slave SPI shift 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 SPI shift register over the Master In Slave Out (MISO) line.• After 8 clock ticks, the data originally in the Master shift register has been transferred to the slave, and the data in the Slave shift register has been transferred to the Master.Use 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 is talking with.• There can only be one master HCS12, because the master HCS12 is the device which generates the serial clock signal.• Need to have: Slave select (SS), Serial clock (SCK), Master out/slave in (MOSI), Master in/slave out (MISO).With select lines, one master can communicate with more than one slave__SS SYNCHRONOUS SERIAL


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?