I'm currently using raspberry pi and a microcontroller. I'm able to send a command via serial port to a microcontroller, but when I try to receive a data from it, a problem occurs. I have set up a timer counter on the microcontroller and when it hits the ISR it sends a data from ADC converter. That data then should be received on raspberry pi. But when I receive that data it also sends the data back (echoing the data). So when I try to read from serial it sends what it has been received. I use the cat command sudo cat < /dev/ttyACM0 to read the data. I need to fix that because I have instruction set the to microcontroller. So when I receive data and when I echo that data it says "Incorrect Instruction" and this becomes a infinite loop of echoing the data.
Would be nice if I get some help.