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.
Thanks!
-
/dev/ttyACM0 is not the name of the device connected to the UART. It sounds like you are using a USB dongle connected to something like an Arduino. You need to explain your set-up.joan– joan2016年08月01日 15:37:28 +00:00Commented Aug 1, 2016 at 15:37
-
You are right. I'm using usb right now because I'm working on a development board with USB. When I connect it to my board I use sudo cat < /dev/ttyAMA0. Actually it works that way on both methods. First when it is configured via USB and second when it is configured to use RX TX PinsAngel– Angel2016年08月01日 15:40:23 +00:00Commented Aug 1, 2016 at 15:40
1 Answer 1
The Raspbian OS has echo by default.
When type: sudo stty -F /dev/ttyAMA0 -echo -onlcr
The echo on the UART pins is disabled.