如题,我在AM335x General Purpose EVM HW User Guide 上看到的是CAN0:
The general purpose daughterboard has 1 CAN transceiver and connector for the CAN0 interface.
但是在Starterware上看到的管脚配置中是CAN1:
/* Perform the pinmux for DCAN1 */
DCANPinMuxSetUp(0);
DCANPinMuxSetUp(0);中的代码如下:
HWREG(SOC_CONTROL_REGS + CONTROL_CONF_UART_CTSN(0)) = DCAN_SLEWFAST_RXDISABLED_PULLDWN_PUPDENABLED_MODE2;
HWREG(SOC_CONTROL_REGS + CONTROL_CONF_UART_RTSN(0)) = DCAN_SLEWFAST_RXENABLED_PULLUP_PUPDENABLED_MODE2;
UART_CTSN0和UART_RTSN0在mode 2情况下是CAN1的
而在DCANMsgRAMInit中我又看到配置的是CAN0:
HWREG(SOC_CONTROL_REGS + CONTROL_DCAN_RAMINIT) |= CONTROL_DCAN_RAMINIT_DCAN0_RAMINIT_START;
这到底是什么情况呢?跪求解释下,这样的Starterware能跑通吗?
leo chen:
EVM上的can应该是从CPLD上引出的,从这个链接上的cpld程序上看,应该是CAN1
http://processors.wiki.ti.com/index.php/AM335x_General_Purpose_EVM_CPLD
can0_txd <= '0' when sysreset_n = '0' else am335x_uart0_ctsn when cfg_reg(2 downto 0) = "001" or cfg_reg(2 downto 0) = "010" else '0'; am335x_uart0_rtsn <= 'Z' when sysreset_n = '0' else can0_rxd when cfg_reg(2 downto 0) = "001" or cfg_reg(2 downto 0) = "010" else 'Z';
不要被这个can0迷糊了,我们主要还是要看uart0_rtsn 和 uart0_ctsn对应的是can1.
如果这个地方稍微改一下,使用的是uart0_rxd 和 uart0_txd 那就是can0了