[西门子] 从Beckhoff ET1100转向Microchip LAN9252

[复制链接]
查看59354 | 回复0 | 2024-1-12 22:52:06 | 显示全部楼层 |阅读模式
从Beckhoff ET1100转向Microchip LAN9252,按照下述步骤进行软件移植工作。

配置头文件(ecat_def.h)

邮箱和PDRAM读/写大小必须根据LAN9252规范进行更改

/**
MAX_PD_WRITE_ADDRESS: Maximum address for the process output data (Sync Manager 2)<br>
inside the application memory of the EtherCAT Slave Controller which could be set by the master. The setting have to be within the ranges of the user memory of the ESC (this is not checked by the tool). */
#ifndef MAX_PD_WRITE_ADDRESS
#define MAX_PD_WRITE_ADDRESS 0x1FFF
#endif/**
MAX_PD_READ_ADDRESS: Maximum address for the process input data (Sync Manager 3)<br>
inside the application memory of the EtherCAT Slave Controller which could be set by the master. The setting have to be within the ranges of the user memory of the ESC (this is not checked by the tool). */
#ifndef MAX_PD_READ_ADDRESS
#define MAX_PD_READ_ADDRESS 0x1FFF
#endif/**
MAX_MBX_WRITE_ADDRESS: Maximum address for the write (receive) mailbox (Sync Manager 0). The setting have to be within the ranges of the user memory of the ESC (this is not checked by the tool). */
#ifndef MAX_MBX_WRITE_ADDRESS
#define MAX_MBX_WRITE_ADDRESS 0x1FFF
#endif/**
MAX_MBX_READ_ADDRESS: Maximum address for the read (send) mailbox (Sync Manager 1). */
#ifndef MAX_MBX_READ_ADDRESS
#define MAX_MBX_READ_ADDRESS 0x1FFF
#endif禁止LAN9252的ESC EEPROM仿真

/**
ESC_EEPROM_EMULATION: If this switch is set EEPROM emulation is supported. Not all ESC types support EEPROM emulation. See ESC datasheet for more information. */
#ifndef ESC_EEPROM_EMULATION
#define ESC_EEPROM_EMULATION 0 // This define was already evaluated by ET9300 Project Handler(V. 1.3.3.0)!
#endif
中断配置

如果AL_EVENT_ENABLED或DC_SUPPORTED在现有的ET1100固件中定义为1,必须按以下步骤操作:
为LAN9252和MCU设置相同的中断极性。


例如,如果MCUESC中断线配置为下降沿,则LAN9252 IRQ线应 配置为低电平有效。在HW_Init()API中
// IRQ enable,IRQ polarity, IRQ buffer type in Interrupt Configuration register.
// Wrte 0x54 - 0x00000101
    data = 0x00000101;
    PMPWriteDWord(0x54, data);修改EEPROM的ConfigData

其他


    • ecatslv.c
void DC_CheckWatchdog(void)

        if ((Sync0WdValue > 0) && (Sync0WdCounter >= Sync0WdValue + 2))
        {
            /*Sync0 watchdog expired*/
            bDcRunning = FALSE;
        }

    • el9800.h
#define ECAT_TIMER_INC_P_MS 2000
您需要登录后才可以回帖 登录 | 注册哦

本版积分规则