How to set interrupt on Rabbit extended IO? I followed the example in the document and it is not working for me. Here is the codes. Question: The P0CR is Pin 0 Control Register but what Block does this P0CR applied?
/*
we are trying to setup the read mapping sensor vs interrupt
MR 0x0E Use master prescaler, count from beginning
condition to end condition
MPR 0x13 Divide 20 MHz clock by 20 to get period of 1 ìs.
ICR 0x0C Begin on rising edge of Pin 0.
DCR 0x14 End on falling edge of Pin 0.
P0CR 0x00 Make Pin 0 an input.
*/
WrPortE(MR_REG,NULL,0x0E);
WrPortE(MPR_REG,NULL,ONE_MICRO_SECOND);
WrPortE(IRC_REG,NULL,RISING_EDGE_DETECT);
WrPortE(DCR_REG,NULL,ENDS_FALLING_EDGE);
WrPortE(P3CR,NULL,1);
WrPortE(IER_REG,NULL,0xf0);
WrPortE(MCR_REG,NULL,0x01);
Which product are you using the RIO chip with? Is this something that ships with the RIO, or did you add it into your own design?
Are you already making use of RIO_SBC.LIB from Dynamic C 10?
Are you trying to measure a pulse time on pin 0? Your sample code refers to pin 0 but your code is writing to P3CR instead of P0CR.
WOOPs it is a type, I did have P3CR as an input