Hi,
I am relatively new to mbed .I am interfacing mbed and a transmitter(ADF7023) using SPI and 1 interrupt pin(PTA13). The ADF7023 gives interrupt every time its buffer is full/Half full. And mbed should detect the interrupt and do some function.
If the mbed misses even one single interrupt generated by RF Transmitter. The whole mechanism used in transmission will be corrupted and transmitter transmits repeatedly transmits some junk data.
The problem is the same. mbed misses few interrupts and later the whole data is junk.
Any help regarding this issue will be duely appreciated
Quote:
The following code using interrupt works initially .later it misses an interrupt and all junk data is transmitted
mbed interfacing with RF Transmitter(adf). IRQ.rise not always detected
#include "mbed.h"
#include <iostream>
SPI adf(PTA16, PTA17, PTA15);//MOSI, MISO, CLOCK
DigitalOut CS(PTD4);
InterruptIn IRQ(PTA13); //Interrupt pin which I am facing problem
int main()
{
IRQ.enable_irq();
IRQ.rise(&write_data);
}
write_data(){
// some function that clears interrupt .which **DOES NOT** contain any malloc,Printf,or any delaying function
}
Quote:
But when tried to poll the IRQ pin in infinite while loop.Everything works fine. with zero error.
mbed code using infinite while loop. Run by polling IRQ pin
#include "mbed.h"
#include <iostream>
SPI adf(PTA16, PTA17, PTA15);//MOSI, MISO, CLOCK
DigitalOut CS(PTD4);
InterruptIn IRQ(PTA13); //Interrupt pin which I am facing problem
int main()
{
int x = IRQ
while(1){
x=IRQ;
if(x)
write_data();
}
}
write_data(){
// some function that clears interrupt .which **DOES NOT** contain any malloc,Printf,or any delaying function
}
Can anyone suggest me what is the error in the former code while the latter one with same logic is working fine.
Any alternative suggestion to achieve the same goal will also be highly appreciated..
Thanking you,
Dheeraj M Pai
dheerajmpai23@gmail.com
Hi,
I am relatively new to mbed .I am interfacing mbed and a transmitter(ADF7023) using SPI and 1 interrupt pin(PTA13). The ADF7023 gives interrupt every time its buffer is full/Half full. And mbed should detect the interrupt and do some function.
If the mbed misses even one single interrupt generated by RF Transmitter. The whole mechanism used in transmission will be corrupted and transmitter transmits repeatedly transmits some junk data.
The problem is the same. mbed misses few interrupts and later the whole data is junk.
Any help regarding this issue will be duely appreciated
Quote:
The following code using interrupt works initially .later it misses an interrupt and all junk data is transmitted
mbed interfacing with RF Transmitter(adf). IRQ.rise not always detected
Quote:
But when tried to poll the IRQ pin in infinite while loop.Everything works fine. with zero error.
mbed code using infinite while loop. Run by polling IRQ pin
Can anyone suggest me what is the error in the former code while the latter one with same logic is working fine.
Any alternative suggestion to achieve the same goal will also be highly appreciated.. Thanking you,
Dheeraj M Pai dheerajmpai23@gmail.com