gcc -o uart_rpi3_loopback uart_rpi3_loopback.c -lwiringPi
- Why the fuck its not working with two while loop
- How to get rid of garbage value?
Make sure UART is configured in RPI3, use this as reference.
- PiPinOut
- wiringPi_Pinout
- WiringPi
- Electronics_wing
- Odroid
- SerialTest
- Minicom
- [GitHub Discussion] (ARMmbed/mbed-os#1849, ARMmbed/mbed-os#1801)
- [open function] (http://pubs.opengroup.org/onlinepubs/7908799/xsh/open.html)
- Control modes in UART used in WiringPi library
- Reference for setting input & output baud rate
- Blocking POSIX (tcdrain)
- posix serial
- Use minicom to test if Tx --> Rx communication is established or not.
Install minicom: sudo apt-get install minicom
If java packages are missing when installing minicom, install them using the following commands:
sudo apt-get purge openjdk-8-jre-headless
sudo apt-get install openjdk-8-jre-headless
sudo apt-get install openjdk-8-jre
Test if a communication line is working by using:
sudo minicom -D /dev/ttySo
ls -l /dev | grep
Compile: gcc -o test test.c -lwiringPi Run: ./test
On running ics.c, the enable pin is high briefly but turns low immediately, not waiting for the data transmission to complete. Need to clear the non blocking io flag.
Created two new files ics_new.c and stoch_kondo.c. stoch_kondo.c is the final library that aims to replace wiringPi completely. I am replacing all the functions in ics_new.c for the ease of testing. Once verified to work properly, the functions are placed in stoch_kondo.c
Tried replacing the wiringPi library in the ics.c with all posix commands. Too many errors to handle when using this approach. In the end only the open and write functions were incorporated in ics.c
Increasing the delay in the code to match enable signal with tx line worked. However, it is not dynamic to adapt to transfer any number of bits Since the number of bits transmitted in all commands (setPos,getPos,set Curlim etc.), this approach is assumed to work for our purpose The delay time to be used in the code is measured by plotting the channels from an Arduino whose code is perfect and has no errors.
=======