I am using the LM3S9D92 eval kit with CCS5. I am trying to use the EPIO on the controller, however I see no activity on the ALE (EPIOS30, PJ6), the WE (EPIOS29, PJ5), or the A1 (EPIOS1, PH2) lines.
The set-up code is
#define EPI_PORTC_PINS (GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7)
#define EPI_PORTE_PINS (GPIO_PIN_0 | GPIO_PIN_1)
#define EPI_PORTF_PINS (GPIO_PIN_4 | GPIO_PIN_5)
#define EPI_PORTG_PINS (GPIO_PIN_0 | GPIO_PIN_1)
#define EPI_PORTH_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \
GPIO_PIN_4 | GPIO_PIN_5)
#define EPI_PORTJ_PINS (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | \
GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6)
#define MEM_START_ADDRESS 0X000000
SysCtlPeripheralEnable(SYSCTL_PERIPH_EPI0);
GPIOPinConfigure(GPIO_PH3_EPI0S0);
GPIOPinConfigure(GPIO_PH2_EPI0S1);
GPIOPinConfigure(GPIO_PC4_EPI0S2);
GPIOPinConfigure(GPIO_PC5_EPI0S3);
GPIOPinConfigure(GPIO_PC6_EPI0S4);
GPIOPinConfigure(GPIO_PC7_EPI0S5);
GPIOPinConfigure(GPIO_PH0_EPI0S6);
GPIOPinConfigure(GPIO_PH1_EPI0S7);
GPIOPinConfigure(GPIO_PE0_EPI0S8);
GPIOPinConfigure(GPIO_PE1_EPI0S9);
GPIOPinConfigure(GPIO_PH4_EPI0S10);
GPIOPinConfigure(GPIO_PH5_EPI0S11);
GPIOPinConfigure(GPIO_PF4_EPI0S12);
GPIOPinConfigure(GPIO_PG0_EPI0S13);
GPIOPinConfigure(GPIO_PG1_EPI0S14);
GPIOPinConfigure(GPIO_PF5_EPI0S15);
GPIOPinConfigure(GPIO_PJ0_EPI0S16);
GPIOPinConfigure(GPIO_PJ1_EPI0S17);
GPIOPinConfigure(GPIO_PJ2_EPI0S18);
GPIOPinConfigure(GPIO_PJ3_EPI0S19);
GPIOPinConfigure(GPIO_PH6_EPI0S26);
GPIOPinConfigure(GPIO_PH7_EPI0S27);
GPIOPinConfigure(GPIO_PJ4_EPI0S28);
GPIOPinConfigure(GPIO_PJ5_EPI0S29);
GPIOPinConfigure(GPIO_PJ6_EPI0S30);
GPIOPinTypeEPI(GPIO_PORTC_BASE, EPI_PORTC_PINS);
GPIOPinTypeEPI(GPIO_PORTE_BASE, EPI_PORTE_PINS);
GPIOPinTypeEPI(GPIO_PORTF_BASE, EPI_PORTF_PINS);
GPIOPinTypeEPI(GPIO_PORTG_BASE, EPI_PORTG_PINS);
GPIOPinTypeEPI(GPIO_PORTH_BASE, EPI_PORTH_PINS);
GPIOPinTypeEPI(GPIO_PORTJ_BASE, EPI_PORTJ_PINS);
EPIDividerSet(EPI0_BASE, 0);
EPIModeSet(EPI0_BASE, EPI_MODE_HB16);
EPIConfigHB16Set(EPI0_BASE, EPI_HB16_MODE_ADMUX | EPI_HB16_WRWAIT_0 | \
EPI_HB16_RDWAIT_0 | \
EPI_HB16_CSCFG_ALE, 0x01);
EPIAddressMapSet(EPI0_BASE, EPI_ADDR_RAM_SIZE_16MB |EPI_ADDR_RAM_BASE_6);
MEM_ADDR_PTR = (unsigned long *)0x60000000;
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
The code to do the operation is
void Timer0BIntHandler(void)
{
unsigned long z[1];
ADCProcessorTrigger(ADC0_BASE, 3);
TimerIntDisable(TIMER0_BASE, TIMER_TIMB_TIMEOUT);
TimerIntClear(TIMER0_BASE, TIMER_TIMB_TIMEOUT);
GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_4, 0x10);
if (count < Samp)
while (!ADCIntStatus(ADC0_BASE,3,false))
}
ADCSequenceDataGet(ADC0_BASE, 3, z);
ADCIntClear(ADC0_BASE, 3);
MEM_ADDR_PTR[MEM_START_ADDRESS + count] = z[0];
count++;
TimerIntEnable(TIMER0_BASE, TIMER_TIMB_TIMEOUT);
GPIOPinWrite(GPIO_PORTE_BASE, DSP_SENSOR_PINS, 0x00);
else
TimerDisable(TIMER0_BASE, TIMER_B);
GPIOPinWrite(GPIO_PORTE_BASE, GPIO_PIN_4, 0x00);
Analyze();
Everything seems to work except the EPIO.
Any suggestions/help?
Mitch,
Thre must be something in the project configuration, or something I'm not enabling, or something I'm not setting. I download you *.bin using LMFlashProgrammer, all the lines toggle. Your image works. Also, I tried a version with a SDRAM EPIO configuration, and the refresh writes are there, but nothing else; no address lines, etc. So, there must be something in my configuration or initialization files.
Maurice
Can you send me a copy of the c-code you used for the EPIO test? Maybe there is something you are automatically adding (since it must obviously be there), that I don't have included, or don't know to add. What ever you did works.
Hi Maurice,
I put the source file in the ZIP linked to this post.
2313.epi_hb16_2_c.zip
I compiled your code, and it works. I get the signals. I checked my code against yours, line-by-line, word-by-word, and mine didn't work. The only difference I could see was that you had all your code in one file. I split the initializations and header file into separate files.
I generated a new project with my code, but this time put everything in one file, and it works.
Is it possible that the preprossor, compiler, or linker (or all 3) are trying to optimise something and messing it up? Is there a way to set the configuration properties to test this? I would hate to be required to put everything in one large file.
Can you put the init_CLK, init_GPIO, etc in separate files, and put the defines, and prototypes in a header file, and then compile to see if you get the same problem?
Maurice GivensIs it possible that the preprossor, compiler, or linker (or all 3) are trying to optimise something and messing it up? Is there a way to set the configuration properties to test this? I would hate to be required to put everything in one large file.
Turn off optimizations and rebuild. Common problem here is to make sure that any variable used in main line and an interrupt is declared volatile.
However, it is more likely that you have something misconfigured in your CCS project file.
Maurice GivensCan you put the init_CLK, init_GPIO, etc in separate files, and put the defines, and prototypes in a header file, and then compile to see if you get the same problem?
Doesn't matter if you have 1 file or 1000, as long as the compiler knows how to put them together. I do not use CCS so I can't speak specifics of that tool chain, but GCC tool chain includes tools like readelf, objdump, nm that are very useful for stuff like this. Joe can probably tell you what the analog is for CCS. If you build your "non working" project and Joe's "working" project, you can then use these tools to look at the resulting images to see what is missing in the non working version. With that info you can go back to your project file and have a pretty good idea where to look.
Also the linker should output a map file that will tell you how the image is put together. Compare the two, find the differences.
Good luck
>>Turn off optimizations and rebuild. Common problem here is to make sure that any variable used in main line and an interrupt is declared volatile.
That was already done.
>>Doesn't matter if you have 1 file or 1000
Obviously it does!
>>it is more likely that you have something misconfigured in your CCS project file.
This was my original question after I was able to get things to work by putting everything in 1 file. The question is what in the configuration file needs to be set/changed/unset/modified to cure this problem. If the files are separated and compiled, is the problem repeatd at TI? For now, the only work-around I have is putting everything in 1 file.
Maurice GivensThat was already done.
Then why ask the question if the first place?
Maurice Givens If the files are separated and compiled, is the problem repeatd at TI? For now, the only work-around I have is putting everything in 1 file.
It would be nice if TI had the resources to test everyone's project who is having problems, but that is quite an onus on them, yes? My only point being that there are things you could be doing to figure this out on your own. Putting everything in one file is a work around, but you do have the option to dig into the working and non-working images, finding out whats wrong, and fixing the problem in lieu of a applying band aid. A lot more work? sure - the first time, but you'll certainly understand how your code goes together much better:)