Datasheet

48.6.4.1 Channel Initialization
The software flow required to initialize a channel must be performed in order to ensure proper operation.
For clarity
, the software flow is grouped as follows:
Configure the Hardware
Program the Routing Fabric Block
Program the AHB Block DMAs
Synchronize and Unmute Synchronous Channel
Configure the Hardware
The MLB_MLBC0, HMCR0, HMCR1 and MLB_HCTL registers are accessible directly via APB reads and writes.
1. Initialize CTR and registers
1.1. Clear CAT, CDT, and ADT bits in CTR
1.2. Clear all bits of all registers
2. Configure the MediaLB interface
2.1. Select MediaLB clock speed via MLB_MLBC0.MLBCLK
2.2. Set MediaLB enable via MLB_MLBC0.MLBEN
3. Configure the HBI interface
3.1. Set HMCR0 and HMCR1 = FFFFFFFFh to activate all channels
3.2. Set the HBI enable bit: MLB_HCTL.EN = 1
Program the Routing Fabric Block
The CAT and CDT reside in the external CTR and are programmed indirectly via APB or I/O reads and writes to the
MIF block.
1. Clear all bits of the CAT
2. Select a logical channel: N = 0–63
3. Program the CDT for channel N
3.1. Set the 14-bit base address (BA)
3.2. Set the 12-bit or 13-bit buffer depth (BD): BD = buffer depth in bytes - 1
3.2.1. For synchronous channels: (BD + 1) = 4 x frames per sub-buffer (m) x bytes- per-frame
(bpf)
3.2.2. For isochronous channels: (BD + 1) mod (BS + 1) = 0
3.2.3. For asynchronous channels: (BD + 1) ≥ max packet length (1024 for a MOST Data
Packet (MDP); 1536 for a MOST Ethernet Packet (MEP))
3.2.4. For control channels: (BD + 1) ≥ max packet length (64)
3.3. For isochronous channels, set the block size (BS): BS = block size in bytes - 1
3.4. Clear all other bits of the CDT
4. Program the CAT for the inbound DMA
4.1. For Tx channels (to MediaLB) HBI is the inbound DMA
4.2. For Rx channels (from MediaLB) MediaLB is the inbound DMA
4.3. Set the channel direction: RNW = 0
4.4. Set the channel type:
CT[2:0] = 010 (asynchronous), 001 (control), 011 (isochronous), or 000 (synchronous)
4.5. Set the connection label: CL[5:0] = N
4.6. If CT[2:0] = 000 (synchronous), set the mute bit (MT = 1)
4.7. Set the channel enable: CE = 1
4.8. Set all other bits of the CAT to ‘0’
5. Program the CAT for the outbound DMA
5.1. For Tx channels (to MediaLB) MediaLB is the outbound DMA
5.2. For Rx channels (from MediaLB) HBI is the outbound DMA
5.3. Set the channel direction: RNW = 1
SAM E70/S70/V70/V71 Family
Media Local Bus (MLB)
© 2019 Microchip T
echnology Inc.
Datasheet
DS60001527D-page 1366