0

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!

asked Aug 1, 2016 at 15:16
2
  • /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. Commented 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 Pins Commented Aug 1, 2016 at 15:40

1 Answer 1

0

The Raspbian OS has echo by default.

When type: sudo stty -F /dev/ttyAMA0 -echo -onlcr

The echo on the UART pins is disabled.

answered Aug 11, 2016 at 8:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.