Not applicable
Aug 07, 2013
01:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 07, 2013
01:04 AM
Why do we need to handle or control the End of Frame (EOF)?
This is because the slave select or chip select (CS) line is activated when the data is transmitting and will only deactivated when the EOF condition is reached.
There are two ways to control the EOF, by hardware control and software control.
1) Hardware Control
If the size/length of the data to transmit is known and is not more than 64 bit, we can set the frame length in register SCTRFLE
When the transmitted data reached the size indicated in SCTRFLE, the EOF condition is reached and the CS line will automatically deactivated.
2) Software Control
If the size of the data to transmit is unknown or more than 64 bit, then we set the frame length to maximum (SCTRFLE = 63).
This means the frame length is set to infinity/unlimited and the software have to handles the indication of EOF condition.
There are 2 ways the software can indicated the EOF condition, by enable EOF bit (TCSR.EOF) or by Transmit Control Information (TCI) control.
i) For enable EOF bit, the EOF bit has to be set before writing data to TBUF.
Once the EOF bit is set, the next data transfer into TBUF will be consider as last word of the frame.
Hence, once the data is finished transmitted, the CS line will be deactivated.
This method is not valid for data FIFO, to handle EOF in data FIFO, we have to use TCI control method.
ii) For TCI control, we need to set the bit TCSR.WLEMD = 1.
Then the address of the written TBUF[31:0] is used as transmit control information TCI[4:0].
TCI[3:0] will be updated as the word length (SCTR.WLE) and TCI[4] will be the EOF status.
For example: TBUF[17] is equal to..
Therefore, the data written into TBUF[31:0] with TCI[4] = 1 will set the EOF bit and that data will be the last word of the frame.
For data FIFO, instead of written the data into TBUF[31:0], it should be written into FIFO input IN[31:0].
This is because the slave select or chip select (CS) line is activated when the data is transmitting and will only deactivated when the EOF condition is reached.
There are two ways to control the EOF, by hardware control and software control.
1) Hardware Control
If the size/length of the data to transmit is known and is not more than 64 bit, we can set the frame length in register SCTRFLE
When the transmitted data reached the size indicated in SCTRFLE, the EOF condition is reached and the CS line will automatically deactivated.
2) Software Control
If the size of the data to transmit is unknown or more than 64 bit, then we set the frame length to maximum (SCTRFLE = 63).
This means the frame length is set to infinity/unlimited and the software have to handles the indication of EOF condition.
There are 2 ways the software can indicated the EOF condition, by enable EOF bit (TCSR.EOF) or by Transmit Control Information (TCI) control.
i) For enable EOF bit, the EOF bit has to be set before writing data to TBUF.
Once the EOF bit is set, the next data transfer into TBUF will be consider as last word of the frame.
Hence, once the data is finished transmitted, the CS line will be deactivated.
This method is not valid for data FIFO, to handle EOF in data FIFO, we have to use TCI control method.
ii) For TCI control, we need to set the bit TCSR.WLEMD = 1.
Then the address of the written TBUF[31:0] is used as transmit control information TCI[4:0].
TCI[3:0] will be updated as the word length (SCTR.WLE) and TCI[4] will be the EOF status.
For example: TBUF[17] is equal to..
TCI[3:0] = 7 // Word length : 8 bit
TCI[4] = 1 // EOF set
TCI[4] = 1 // EOF set
Therefore, the data written into TBUF[31:0] with TCI[4] = 1 will set the EOF bit and that data will be the last word of the frame.
For data FIFO, instead of written the data into TBUF[31:0], it should be written into FIFO input IN[31:0].
0 Replies