38.3.4.5 Calculation of Required Message Memory

The size of required RAM depends on the configuration of each FIFO. Equation 38-17 through Equation 38-19 specify the sizes of the TEF, TXQ and the FIFOs in bytes. The TEF or TXQ is not used if their size is zero.

Since the size of the integrated RAM is limited, the user must check that the memory configuration fits into RAM. Equation 38-20 can be used to calculate the total RAM usage in bytes.

The size of the TEF objects depends on the enabling of timestamping. If TEFTSEN is set, then tefts = 4, else tefts = 0.

The PayLoad(i) is defined in data bytes.

The size of a message object of an RX FIFO varies dependent on the enabling of timestamping. If RXTSEN = 1 and TXEN = 0 for FIFO(i), then rxts(i) = 4, else rxts(i) = 0.

N is defined as the number of FIFOs used in addition to the TEF and the TXQ.

Equation 38-17. Size of TEF
S T E F = N E L E M E N T S ( T E F ) × ( t e f t s + 8 )
Equation 38-18. Size of TXQ
S T X Q = N E L E M E N T S ( T X Q ) × ( 8 + P a y L o a d ( T X Q ) )
Equation 38-19. Size of FIFOs
S F I F O ( i ) = N E L E M E N T S ( i ) × ( r x t s ( i ) + 8 + P a y L o a d ( i ) )
Equation 38-20. Total RAM Usage
S R A M = ( S T E F + S T X Q + i = 1 N S F I F O ( i ) )
For example:
  • If TEF is 4 messages deep (NElements (TEF) = 4) and TEFTSEN is clear, then the size of TEF = STEF = 4 x (0 + 8) = 32 bytes
  • If NElements (TXQ) = 1, PayLoad (TXQ) = 12, then the size of TXQ = STXQ = 1 x (8 + 12) = 20 bytes
  • If NElements (FIFO) = 3, PayLoad (FIFO) = 8, then the size of FIFO = SFIFO = 3 x (8 + 8) = 48 bytes

Therefore, SRAM = STEF + STXQ + SFIFO = 32 + 20 + 48 = 100 bytes.