SPRAD62 February 2023 F29H850TU , F29H859TU-Q1 , TMS320F280023C , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280037C , TMS320F280037C-Q1 , TMS320F280038C-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
Status/flag bits allow the CPU to poll the state of the CLB logic. For example, after a CLB interrupt, the CPU can poll a flag bit to determine if the interrupt was due a data receive interrupt or a receive error interrupt.
These status/flag bits can be implemented using the HLC registers. However, one HLC register has to be used per flag since there is no bitwise AND or OR instruction supported by the HLC. For example, a non-zero value in HLC R0 register could be used to indicate a receive interrupt, while a non-zero value in R1 could be used to indicate a receive error.
The CLB logic status can also be determined by directly reading the status of the different CLB logic blocks. For example, if an FSM is configured to define multiple states, e.g. IDLE and ACTIVE, the CPU can read the status of S0 and S1 to determine the CLB logic state.
The CPU can use the CLB memory-mapped debug registers CLB_DBG_Rn, CLB_DBG_Cn, and CLB_DBG_OUT to determine the status of different blocks within the CLB. An example of using HLC registers as status bits is shown in the following code block. The code block uses C2000ware driverlib functions.
uint32_t chkIntFlag = CLB_getRegister(CCSI2_RX_TILE_BASE, CLB_REG_HLC_R1);
uint32_t rcvIntFlag = CLB_getRegister(CCSI2_RX_TILE_BASE, CLB_REG_HLC_R2);
uint32_t endIntFlag = CLB_getRegister(CCSI2_RX_TILE_BASE, CLB_REG_HLC_R3);
...
// Receive interrupt
if (rcvIntFlag & 0x1)
{
...
// Clear the receive interrupt flag register
CLB_writeInterface(CCSI2_RX_TILE_BASE, CLB_ADDR_HLC_R2, 0x0);
}
// End interrupt
if (endIntFlag & 0x1)
{
...
// Clear the end interrupt flag register
CLB_writeInterface(CCSI2_RX_TILE_BASE, CLB_ADDR_HLC_R3, 0x0);
}
// Check error interrupt
if (chkIntFlag & 0x1)
{
...
// Clear the check error interrupt flag register
CLB_writeInterface(CCSI2_RX_TILE_BASE, CLB_ADDR_HLC_R1, 0x0);
}