12 years, 2 months ago.

ISR

Hi All,

I am developing code to simply read ADC data and pass it to serial port. p9 is my interrup pin. and I have written the following funciton to read data from A2D chip. The question is what is the correct way of calling the interrupt function?

thanks, Hamid

void DRDYhandler67(void) { disable_irq(); disable all other interrupts spi.write(0x51); write to MUX register spi.write(0x00); number of register to be written -1 spi.write(0x67); +Ch6, -Ch7 wait(4*tosc); readData(); enable_irq(); enable all other interrupts }

2 Answers

12 years, 2 months ago.

If you have an interrupt pin you want to use InterruptIn: http://mbed.org/handbook/InterruptIn

12 years, 2 months ago.

The example is very helpful. Thank you for your response Erik!