This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EPI General purpose



Hello,


we are using the F28M35H52C1 and want to work with the EPI peripheral and need your help.

Situation in short: 16 data bits, no addressing, no output only input, no need for a synchronize

At the moment we don't get any result from EPI. Using the 16 EPI Pins (EPI0 ... EPI15) as simple input via GPIO, we could read the data.

Actual configuration:

	SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0);

	GPIOPinConfigure(GPIO_PCTL_PH3_EPI0S0);
	GPIODirModeSet(GPIO_PORTH_BASE, GPIO_PIN_3, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTH_BASE, GPIO_PIN_3, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PH2_EPI0S1);
	GPIODirModeSet(GPIO_PORTH_BASE, GPIO_PIN_2, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTH_BASE, GPIO_PIN_2, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PC4_EPI0S2);
	GPIODirModeSet(GPIO_PORTC_BASE, GPIO_PIN_4, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTC_BASE, GPIO_PIN_4, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PC5_EPI0S3);
	GPIODirModeSet(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTC_BASE, GPIO_PIN_5, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PC6_EPI0S4);
	GPIODirModeSet(GPIO_PORTC_BASE, GPIO_PIN_6, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTC_BASE, GPIO_PIN_6, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PC7_EPI0S5);
	GPIODirModeSet(GPIO_PORTC_BASE, GPIO_PIN_7, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTC_BASE, GPIO_PIN_7, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PH0_EPI0S6);
	GPIODirModeSet(GPIO_PORTH_BASE, GPIO_PIN_0, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTH_BASE, GPIO_PIN_0, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PH1_EPI0S7);
	GPIODirModeSet(GPIO_PORTH_BASE, GPIO_PIN_1, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTH_BASE, GPIO_PIN_1, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PE0_EPI0S8);
	GPIODirModeSet(GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_0, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PE1_EPI0S9);
	GPIODirModeSet(GPIO_PORTE_BASE, GPIO_PIN_1, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_1, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PH4_EPI0S10);
	GPIODirModeSet(GPIO_PORTH_BASE, GPIO_PIN_4, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTH_BASE, GPIO_PIN_4, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PH5_EPI0S11);
	GPIODirModeSet(GPIO_PORTH_BASE, GPIO_PIN_5, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTH_BASE, GPIO_PIN_5, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PF4_EPI0S12);
	GPIODirModeSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PG0_EPI0S13);
	GPIODirModeSet(GPIO_PORTG_BASE, GPIO_PIN_0, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTG_BASE, GPIO_PIN_0, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PG1_EPI0S14);
	GPIODirModeSet(GPIO_PORTG_BASE, GPIO_PIN_1, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTG_BASE, GPIO_PIN_1, GPIO_PIN_TYPE_OD_WPU);

	GPIOPinConfigure(GPIO_PCTL_PF5_EPI0S15);
	GPIODirModeSet(GPIO_PORTF_BASE, GPIO_PIN_5, GPIO_DIR_MODE_IN);
	GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_5, GPIO_PIN_TYPE_OD_WPU);

	EPIDividerSet(EPI0_BASE, 1);
	EPIModeSet(EPI0_BASE, EPI_MODE_GENERAL);
EPIAddressMapSet(EPI0_BASE, EPI_ADDR_PER_BASE_A | EPI_ADDR_PER_SIZE_256B); EPIConfigGPModeSet(EPI0_BASE, EPI_GPMODE_READ2CYCLE | EPI_GPMODE_ASIZE_NONE | EPI_GPMODE_DSIZE_16, 0, 0); while(HWREG(EPI0_BASE + EPI_O_STAT) & EPI_STAT_INITSEQ) { }

At first we used GPIO_DIR_MODE_HW and GPIO_PIN_TYPE_STD_WPU instead GPIO_DIR_MODE_IN and GPIO_PIN_TYPE_OD_WPU but that lead us to a high current consumption as soon as our external device set some pins. As we only need input and never write something to the connected  device, we set config as input. With this configuration we have no current problem. Would this work or have we set GPIO_DIR_MODE_HW and GPIO_PIN_TYPE_STD_WPU for EPI to work?

Our test function for reading the EPI data looks like this:

void EPI_readtest() {

	unsigned long address;
	unsigned short *XMEM_ps;
	unsigned short result;

	address = 0xA0000000;
	XMEM_ps = (unsigned short *)address;
	result= *XMEM_ps;
}

At the moment the result is always 0 and never the expected value.

Can you please help us to find our error?


Best regards

Mathias

  • Hi Mathias,

    You need to use "GPIO_DIR_MODE_HW" to select the GPIO pins for EPI function else it'll not work. Input/output in that case is controlled by EPI itself. Also you should be driving the INPUT pins based on the RD signal from EPI to avoid any contention which could cause high current.

    Regards,

    Vivek Singh

  • Dear Vivek,

    thank you for your answer.

    In the mean time we found in several forum threads information about "GPIO_DIR_MODE_HW". It didn't work to get any value. Then we added EPI_GPMODE_CLKPIN and reading data worked (why it is not clear for us, there was only one hint about this, but this was also for other CPUs with EPI. We also don't need the clock signal and use the pin for this for other things, so it is also not configured for EPI), but the current problem remains.

    Please note that it is unclear to us, why the pins are not in tristate from CPU side, when EPI reading or writing is not used. We found not very much information about this (TRM and forum), but one thread ( e2e.ti.com/.../163487  ) state it clearly for us, that it should be tristate. In other words, the RD signal should not be needed as long we only read from the external device.

    We have an other question regarding EPI Modes: We want use the General Purpose mode to read the data. In the end we need the data at C28 CPU so we want use C28 with it's DMA directly. We found in forums that only HB 8 / 16 can be used with C28. Is this correct? No way to use the General Purpose Mode with C28? We didn't find any information in TRM about this.
    When General Purpose Mode work with C28 what would be the correct address in C28 for 0xA0000000?
    We tried HB 16 in FIFO Mode, what work as expected. The current problem remains still.

    Best regards

    Mathias

  • Dear Vivek,

    we have tried now with the RD strobe in HB16 XFIFO and get the following:
    Current problem seems to be solved, but when we have now the time to look closer at the data from the pins, we see only 5 (Bit 15, 14 11, 9, an 5) from 16 Bit working. The rest is always 0. The other 5 match what they should be.
    We tried much with longer wait states, slower EPI, configuration about word length but nothing changed the result.
    Using the EPI data pins as simply GPIO pins the input from every pin is read correctly.

    Have you any hint for us?
    Could it be that some of the EPI pins are damaged because of the high current in the first tries but as GPIO they could work?

    Best regards

    Mathias


  • Hi Mathias,

    I would not suspect about pin being damage yet because in that case even in GPIO mode pins should not work.

    I would suggest to look at the pinmux setting for those pins again. After the EPI configuration done, please check the pinmux configuration register values in CCS Memory Watch window or register view to make sure they all have correct value.

    Regards,

    Vivek Singh

  • Hi Vivek,


    thank you for your hints. As we tried so many configurations, we build in an error while setting the GPIO_O_PCTL value for each pin. As we set it for every pin seperatly, we lost the or operator while testing different configurations. So some of the pins were not configured as they should. After correcting this everything runs fine.

    It is not 100 % clear why we can't use the general porpuse mode with C28, but as everything runs in HB16 as we planed that is okay for us.

    Once again: Thank you for your help.

    Regards

    Mathias