Skip to content

kaushikbalasundar/rpi3_loopback_serial

 
 

Repository files navigation

Compilation

gcc -o uart_rpi3_loopback uart_rpi3_loopback.c -lwiringPi

Blocking

  1. stack
  2. blog
  3. a

Question?

  1. Why the fuck its not working with two while loop
  2. How to get rid of garbage value?

Make sure UART is configured in RPI3, use this as reference.

Reference

Packages to be installed:

  1. 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

Compiling and running

Compile: gcc -o test test.c -lwiringPi Run: ./test

8/02/2019 Progress

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.

=======

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 91.8%
  • Python 8.2%