Hi All
I am trying to use EMIF 'J4' on dsk6713. What I understood so far is that EMIF 'J4' on dsk has I/O pins ED0 - ED31. At a moment I am trying to use an external switch to control a LED to understand the basic working principle so that I can proceed with my project.I have attached the code. I am using the memory location 0xA0000000 to output the LED connected to ED0 pin 70 on J4. I have connected the switch to pin 40 ED0 on J4. The switch is connected to be pulled LOW when ON. I am using memory location 0xA1111111 to read the contents.I used two simple routines to read and write to EMIF data bus. My question is do I need to change any other register values in order to switch between read & write the EMIF? and when I use any of the values from 0xA0000000 to 0xA1111111 to read and write separate or same, they are working OK i.e., they all have the same values what ever I write in any one of them?
Any help would be much appreciated.
Many Thanks
#define OUTPUT 0xA0000000
int *output = (int *)OUTPUT;
int *input;
int temp1, temp 2;
int temp3 = 0;
main( )
{
comm_poll( ); // copied from chaissing book
DSK6713_LED_init(); // copied from chaissing book
DSK6713_DIP_init(); // copied from chaissing book
while (1)
{
*output = 0x00000000; // LED connected to ED0 pin 70 on J4 turns OFF
input = (int*)0xA1111111;
temp3 = *input;
if (temp3 == 0)
{
for(temp1 = 0; temp1 <=10000; temp1++) //two for loops for switch debouncing delay
{
for(temp2 = 0; temp2 <=1000; temp2++)
{
}
}
input = (int*)0xA1111111;
temp3 = *input;
if (temp3 == 16777216) // switch connected to ED24 pin 40 on J4 (Pin 24 High & all other Low)
{
*output = 0x00000001; // LED turns ON pin 70 J4 ED0
}
}
for(temp1 = 0; temp1 <=10000; temp1++) //two for loops for delay for LED to stay ON
{
for(temp2 = 0; temp2 <=1000; temp2++)
{
}
}
}
}