User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 576
UG585 (v1.11) September 27, 2016
Chapter 18: CAN Controller
18.3.3 Start-up Controller
The controller can operate in Normal, Sleep, Snoop and Loop Back modes. Refer to Figure 18-3 for
supported transitions. On start-up the controller clocks and configuration bits are programmed.
Then the operating mode is selected and enabled.
Example: Start-up Sequence
1. Configure clocks. Refer to section 18.4.1 Clocks.
2. Configure Tx/Rx signals. Refer to section 18.5.1 MIO Programming.
3. Wait for configuration mode. Read can.SR[CONFIG] until it equals 1.
4. Reset the controller. The controller comes up in Configuration mode. Refer to section
18.4.2 Resets.
5. Program the bit sampling clock. Refer to section Rx/Tx Bit Timing Logic.
6. Program the interrupts, as needed. Refer to section 18.2.4 Interrupts.
7. Program the acceptance filters. Refer to section 18.2.5 Rx Message Filtering.
8. Select operating mode. Normal, Sleep, Snoop or LoopBack. Refer to section 18.3.4 Change
Operating Mode.
9. Enable the controller. Write a 1 to can.SRR[CEN].
18.3.4 Change Operating Mode
Example: Normal to Sleep Mode
Sleep mode is entered from Normal Mode when the following conditions are met:
1. Select Sleep Mode. Write 1 to can.MSR[SLEEP].
2. Wait for CAN bus to go idle.
3. Wait for all TxFIFO and TxHPB messages to be transmitted.
Note: In normal mode, can.MSR[LBACK] = 0 and can.SSR[CEN] = 1. Also, can.MSR[SNOOP] = don't
care.
Example: Configuration to Sleep Mode
Sleep mode is entered from Configuration Mode when the following conditions are met:
1. Select Sleep Mode. Write 1 to can.MSR[SLEEP] and write 0 to can.MSR[LBACK].
2. Enable the controller. Write 1 to can.SSR[CEN].
3. Wait for TxFIFO or TxHPB to empty.
Note: In configuration mode, can.MSR[SNOOP] = don't care.
Sleep mode is exited when I/O bus activity is detected or when software writes a message to either
the TxFIFO or the TxHPB. When the controller exits sleep mode, can.MSR[SLEEP] is set to 0 by the
hardware and an interrupt can be generated.