I trying to slave fifo in fx2lp 56pin.
And i now see the following example about slave fifo.
But i don't know what whether IOC used to output or input.
Could you please let me now about the direction of "IOC" ?
Also, what is different between "IOC & 0x02" and "IOC|=0x01"? i don't know what they have meaning.
void TD_Poll( void )
if(!(IOC & 0x02))
done_frm_fpga = 1;
if ((done_frm_fpga) && (IOC & 0x02))
IFCONFIG = 0x03;
IOC|=0x01; //output 1 on PC.0...SYNC signal is HIGH
done_frm_fpga = 0;
In fw.c you can see that PC.0 is configured as an Output pin and PC.1 as input as below:
OEC|=0x01; //PC.0 as output (SYNC signal)
OEC&=0xFD; //PC.1 as input (Clock changing signal)
It is the OEC register that determines which pin of port C acts as input, and which as output.