Follow these steps to configure the Peripheral I/F channel(s) for a single shot transmission:
- (Optional) Configure TX FIFO for MSB (default) or LSB:
- ICSSG_PRU0_ED_CHm_CFG0_REG[31] PRU0_ED_TX_FIFO_SWAP_BITSm (where n = 0 or 1 and m = 0 to 2)
- Pre-load TX FIFO:
- Select TX channel by writing the desired channel number to R30[17-16] (tx_ch_sel)
- Write 1-4 bytes of data to r30[7-0] (tx_data). At each r30[7-0] write, data will be pushed into the FIFO.
- Repeat Steps 2a and 2b for all desired channels.
- Configure TX frame size if less than 4 full bytes loaded into FIFO:
- ICSSG_PRU0_ED_CHm_CFG0_REG[15-11] PRU0_ED_TX_FRAME_SIZEm (where n = 0 or 1 and m = 0 to 2)
- Push TX FIFO data to PERIF<m>_OUT (see Section 4.5.2.2.3.6.3.2 for the PERIF<m>_CLK and PERIF<m>_OUT start time relationship);
- To start TX on all channels, set r31[20] = 1 (tx_global_go).
- To start TX on individual channel:
- Select TX channel by writing the desired channel number to R30[17-16] (tx_ch_sel)
- Set R31[18] = 1 (tx_channel_go)
- If ICSSG_PRU0_ED_CHm_CFG1_REG[31-16] PRU0_ED_RX_EN_COUNTERm > 0 (where n = 0 or 1 and m = 0 to 2), then the channel will automatically switch into RX mode. See Section 4.5.2.2.3.6.4.4 for an example of how to program and configure RX content.
- If ICSSG_PRU0_ED_CHm_CFG1_REG[31-16] PRU0_ED_RX_EN_COUNTERm = 0, poll either r31[21, 13, or 5] (tx_global_reinit_active/busy[2,1,0]) or ICSSG_PRU0_ED_TX_CFG_REG[7, 6, or 5] PRU0_ED_BUSY_m (where m = 0 to 2, indicates channel number) for when TX is complete
Note: The PERIF<m>_CLK Peripheral I/F requires that PERIF<m>_CLK be in a high state at the beginning of a new transaction. If the clock ended the single shot transmission in low state, then the clock needs to be reset before sending more data. The steps to reset PERIF<m>_CLK are:
- Set R31[19] = 1 (tx_global_reinit) to reset clock high
- Wait until PRU0_ED_BUSY_m bit is cleared
- Re-configure R30[20-19] (clk_mode), since reinit will reset the clk_mode to "Free-running/stop-high" mode