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 host bus 8 in tm4c129encpdt

Hello Amit,

   I want to use 8 data line and 4 address lines with EPI.

   I want 1 CS ,1 RD , 1 WR line.  ALE not required. No MUX  8 fix data and 4 address

I have enabled EPI as follow ->>>

 SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0); //Enable the peripheral

  GPIOPinConfigure(GPIO_PK0_EPI0S0); // 8 DATA 
  GPIOPinConfigure(GPIO_PK1_EPI0S1);

.                                                                  // 4 ADDRESS

.

.

.

.
  GPIOPinConfigure(GPIO_PB3_EPI0S28); //RDn
  GPIOPinConfigure(GPIO_PP2_EPI0S29); //WRn
  GPIOPinConfigure(GPIO_PP3_EPI0S30); //CSn

 GPIOPinTypeEPI(GPIO_PORTB_BASE, EPI_PORTB_PINS); // SIMILLARY I HAVE CONFIGURED ALL PINS   (8 data line and 4 address  1cs 1rdn 1wrn)

  EPIModeSet(EPI0_BASE, EPI_MODE_HB8);

  EPIDividerSet(EPI0_BASE, 118); // 1MhZ . controller speed 120Mhz

  EPIConfigHB16Set(EPI0_BASE, (EPI_HB8_MODE_ADDEMUX | EPI_HB8_WRWAIT_2 | EPI_HB8_RDWAIT_2 |  EPI_HB8_CSCFG_CS ), 0);  //epio30 as cs

Is there need to configure WRn RDn as differntly. If no need i want to read and write data with generating address. Which function should i use. Please tell me with any example.

Regards,

Sagar

  • after above configuration i used bellow function for write data at address (0x04),
    EPIWorkaroundByteWrite(0x04,0x55);

    But controller gets hang in above line.

    What is wrong in configuration of EPI.?? Please suggest me .

    Regards,

    Sagar

  • Hello Sagar,

    Why is the function EPIConfigHB16Set being used for HB8 Mode? The address may seem identical, but if we break the function in future on a/c of register change then you may end up with a non-working code.

    Secondly, the EPI Enable function has not been called.

    Lastly, what is the question you have, as I am not at all clear on the question being asked (I am not a code provided so examples can't be pasted)

    Regards
    Amit
  • Hello Amit ,

        Yes i have corrected function  EPIConfigHB8Set() from EPIConfigHB16Set .

    Amit Ashara said:
    Secondly, the EPI Enable function has not been called


      I have not found this function EPI enable. From where should i get it.

      In my project i want 8 data line, 4 address line , 1 chip select , 1 read , 1 write line.  I have used MUX ICs for selecting different ICs. with help of 4 address line i will enable particular IC then with help of 8 data lines i will write data on that ICs. This i want in my project.

    Is it compulsory to configure  "EPIAddressMapSet" function in my case?

     

    So suggest me want is wrong in my EPI configuration. How should i write and read data with EPI.?

    Regards,

    Sagar

  • Hello Sagar,

    My bad. The EPI Enable is embedded in the EPIModeSet function.

    Yes it is mandatory to configure the address map. If you look at the EPIADDRMAP register the Address bits are set to 0x0 which is reserved.

    Regards
    Amit
  • Hello Amit,
    I have used HB8 in which i configured following things,
    EPIConfigHB8Set(EPI0_BASE, (EPI_HB8_MODE_ADDEMUX | EPI_HB8_WRWAIT_2 | EPI_HB8_RDWAIT_2 | EPI_HB8_CSCFG_CS ), 0); //epio30 as cs
    EPIAddressMapSet(EPI0_BASE, EPI_ADDR_PER_SIZE_256B| EPI_ADDR_PER_BASE_A);

    Now i am reading and writting data but i found that ,

    The problem is the processor shift left all address pin by one bit, for example, their A1 is actually A0, but TI do not state this clearly in the datasheet.

    i found this post on forum this state that there is problem in this mode (TI employ Stellaris Dexter has mentioned this problem)-> e2e.ti.com/.../64394

    Regards,
    Sagar
  • Hello Sagar,

    What is the device you are connecting to the EPI? I have a SRAM 8-bit which uses HB8 and it has A0 connected to A0 of SRAM and that is what is mentioned in the post as well.

    Regards
    Amit
  • Hello Amit,

    I have connected 74HC138 ic (DEMUX IC) on address line for selecting different devices chip select. From data line of EPI,  i am putting data on that selected ICs.

      what address i am selecting is generating on A1 A2 A3 not on A0. I am writting data in while loop, on A0 i am getting pulse high- low, high- low , this A0 pulse get high  with 1st chip select to next 2nd chip select then again it become low upto 3rd chip select and so on.

    In address mapping i have used 

    addr = (unsigned short * )  0xA0000000;      // static volatile unsigned short addr;

    I want to ask one silly question -> why we are using  static volatile unsigned short and not  static volatile unsigned long 

    while(1) // HB8 no MUX

    {

      addr[6] = 0x30;

       while( HWREG(EPI0_BASE+EPI_O_STAT) & EPI_STAT_WBUSY) {}

    }

    I am getting address from A1 to so on not from A0?

    I tried another trial also i have used HB8 MUX configuration 

    while(1)  // HB 8 MUX

    {

      addr[(6<<8)] = 0x30;

       while( HWREG(EPI0_BASE+EPI_O_STAT) & EPI_STAT_WBUSY) {}

    }

    I am getting data from A1 only  on A0 i am getting 0 always . 

    Regards,

    Sagar

  • Hello Sagar,

    I can check that up. Please attach the current (reproducing the issue) C file. Please attach and don't paste the contents.

    Also instead of using unsigned short can you instead use unsigned char. unsigned short is type defined as uint16_t

    Regards
    Amit
  • Hello Amit,
    Thank you for your quick response " unsigned char" has solved my problem. Now i am getting correct data and address.

    Regards,
    Sagar
  • Hello Sagar,

    That is good. Less work for me on the board today.

    Regards
    Amit
  • Hello Amit,

    Thank you Amit for your help.
    Regards,
    Sagar

  • Hello Sagar,

    I haven't seen an issue like this. Can you confirm that the GPIOPinConfigure is correctly called. And in the failing case check if the Port registers of the corresponding GPIO has been correctly configured.

    Regards
    Amit
  • Hello Amit,
    Sorry it was my mistake After EPI configuration i configured that pin with gpio. So it was my mistake.
    Thank you for your valuable time.
    Regards,
    Sagar