Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Does anybody have any idea whey when I added the "SPI spi(p5, p6, p7);" the interrupt will no longer work? Could anybody tell me what went wrong and how to get around this? Please help.
#include "mbed.h" InterruptIn dataReady(p30); SPI spi(p5,p6,p7); // mosi, miso, sclk <-- The moment when this is added the interrupt routing will not be called? Why? //DigitalOut cs_n(p8); Serial pc(USBTX, USBRX); void displayData() { pc.printf (" Interrupt occurred\n\r"); } int main() { // pc.printf ("Chip Select is High for 10us\n\r"); // cs_n = 1; // wait_us(10); // spi.format(16,3); // spi.frequency(2000000); pc.printf ("Interrupt Test Begin \n\r"); dataReady.rise(&displayData); // attach the address of the flip function to the rising edge }