I would like to use the D0-D11 pins of my USB sliceKIT as general I/Os, but I didn't succeed, and I can't find any informations on that.
I can't use the module_slicekit_support as it does not support the U16 slice kit (U16 slicekit use X0D14 & 15 and not X0D42 & 43 as other slicekits).
I tried something very simple (naive?) like:
Code: Select all
#define FLASH_PERIOD 20000000
out port led = XS1_PORT_1C; // X0D10
out port led2 = XS1_PORT_1G; // X0D22
out port x0d = XS1_PORT_4C;
int main(void)
{
// Switch off SPI ? (not working)
x0d <: 0x1; // X0D14 high (disable SPI)
x0d <: 0x3; // X0D15 high (latch)
timer tmr;
int t;
tmr :> t;
while (1) {
led <: 0x1;
led2 <: 0x1;
t += FLASH_PERIOD;
tmr when timerafter(t) :> void;
led <: 0x0;
led2 <: 0x0;
t += FLASH_PERIOD;
tmr when timerafter(t) :> void;
}
return 0;
}
I also tried to modify the asm code from the slicekit support module but it does not work either.
Am I missing something? If someone has some working code, it would help :-)
Thanks,
Best,
Benj