This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358: Can I send Data to Output to a Running Server from ADC to UART on this Chipset?

Part Number: AM3358


Tool/software:

Hello,

I have been reading and it seems there is a way to send ADC data to a UART for transmission (reading/writing) but it has to do with No RTOS and/or the MSP line.

I am dealing with the am3358 and I wanted to know if it was possible to send ADC values to a running server via UART. I found some other data with a small subscript of info which can be found here: https://www.ti.com/lit/sd/slaaeb1/slaaeb1.pdf .

That may be well intended but it is not exactly what may work for a more complicated chipset like the am3358. 

Seth

P.S. So, I read ADC data via IIO SS, write it to UART via Serial SS and then serve the data online locally for use cases. For now, I am using real hardware to handle such a task. I am using Sonar and/or LiDAR for quickly accessing data that can promote or disguise a bots movements. For instance, the sensors tell my am3358 supported BeagleBone Black whether to stop, retract, and/or maneuver in another way. 

  • Hi Seth,

    I am supporting UART in Linux but not ADC. I am not sure what exactly the timing requirement in your ADC application, but you can transmit data through UART in Linux.

  • I have been reading the way Linux handles IIO and it seems this 12-bit ADC needs to set up the 16-bits in one exchange and then the UART handles it byte by byte. So, high 8-bit and the low 8-bit.

    Do you know of any examples in Linux or the SDK that handles the ADC to UART on am3358?

  • Linux kernel driver exposes UART ports under /dev/ directory, you can have a program open the UART device node, then configure and transmit/receive data through the UART. Please use the following program as an example.

    https://github.com/nsekhar/serialcheck/blob/master/serialcheck.c

  • Okay...thank you. I will look it over and see if I can adapt it to my use case. 

    Right now, the only thing that is supposed to happen is a stop made from UART because of a read of the ADC on the am3358.

    So for instance, the ADC device records a voltage in the IIO SS and then the UART acts on it which in my case just creates the UART to understand it needs to not allow for communication to go literally forward like with hardware.

    so, the wheel turns because of UART but the ADC voltages dictate if the wheel from the UART has exceeded it boundaries. Simple bot stuff..."simple."

    Seth

    P.S. Anyway, off to review that enormous block of source you showed. I will read into it and try to grasp it.

  • So for instance, the ADC device records a voltage in the IIO SS and then the UART acts on it which in my case just creates the UART to understand it needs to not allow for communication to go literally forward like with hardware.

    so, the wheel turns because of UART but the ADC voltages dictate if the wheel from the UART has exceeded it boundaries. Simple bot stuff..."simple."

    Sorry I am not sure I understand all the messages. I would assume the ADC records the wheel information, but I am not sure how the UART has any direct relation with the wheel. UART just transmits the bytes sent over by a program. Anyway, please let me know if you have any specific questions related to UART usage in Linux on AM335x.

  • Okay and no issue whatsoever. I will let you know if I am getting more serious about UART and Linux. 

  • Hello Bin,

    Seth here again. So, I will try better now to make myself clear. The ADC controls the sonar and then the UART is controlling the serial execution to make the motors move via a small program I found for a motor driver, i.e. the Dimension Engineering Sabertooth 2 x 12. It is a "heavy duty" motor driver for controlling single phase, DC motors. 

    Mostly for playing around so far... 

    So, although this is more general to ask, what method would I use for sending the correct type of bytes from the am335x UART peripheral to a specific motor driver like the Sabertooth 2 x 12? 

    For instance, using some language like C/C++ or python would entail what type of instance for just TX from the UART to the driver? I have reviewed the source you listed and I am slowly starting to understand that making the TX of the UART peripheral is not so straight forward. Does TI have some documentation on sending Bytes to a known driver from the am335x UART peripheral?

    And if so, if TI personnel, has this type of documentation, I was thinking of using the doc. to further provide relief to me and others looking to learn more. 

    Do I send bytes of some location with a type of offset that is listed in the TRM via some language? 

    I am being nosy sort of now and I understand that it is a bit misleading on my part. I am trying to understand more about the UART and how to decipher when and how to transmit bytes and how to gather these specific bytes. 

    Seth

    P.S. Although this is not complicated to you, I am having quite the time trying to understand it all. I know this is not your job just to supply me help here. Any ideas or suggestions are very welcomed.  

  • Hi Seth,

    Thanks for providing the details. You are correct that this would be beyond our support scope, but here are my comments.

    I see you have two big gaps, one is in high level, the other is in low level.

    The high level gap is to select the right OS for your project. You would have to understand the realtime (RT) requirement of your motor drive use case, then decide to use RTOS or Linux (or RT Linux).

    The low level gap is in programing for data communication. In communication, it is all about protocols. In this UART communicating to the DC motor, you first need to understand the UART based protocol which the DC motor controller requires, this would determine how to form the data for the AM335x UART.

    I only support Linux but don't know other OS. When sending data through UART in Linux, you don't need to know much about the UART hardware and its registers, it is already handled in kernel UART drivers. Your code just need to configure the UART baud rate and use write() function to send the data buffer to UART. The serialcheck.c file I provided above can be used as an example.