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.

EK-TM4C123GXL: How to send data out through the 'Device' USB?

Part Number: EK-TM4C123GXL

Hi,

I have a sensor connected to the board and was reading data through the debug usb port using UART0. This was only to verify that the data from the sensor was accurate.

My projects current requirement needs me to send that data out the USB on the side of the board as the JTAG section of the board will not be present. How can I do this? Any example code would help!

Thank you

  • Hello Ibrahim,

    There are USB device examples in TivaWare which use the other USB port to send data. You probably would be best of trying the example usb_dev_serial which uses the USB Device CDC interface to connect to a serial terminal on the PC to stream data between UART0 and the USB peripheral. You should be able use that sort of interface to send data to your sensor as well.

    Best Regards,

    Ralph Jacobi

  • Hi Ralph,

    Thank you for your response. My sensor is connected to pin PB4 and I was only using UART0 to ensure my sensor was working correctly.
    Looking through the code in usb_dev_serial, I can see that it takes an input from UART0 and sends it out the USB on the side. How do I modify this so that it takes analog input from pin PB4 and then sends it out the USB? I tried printing the analog values to UART0 but that did not seem to work.

  • Hello Ibrahim,

    The ReadUARTData function is what is used to send data over USB so you'd basically be looking to re-fashion that one.

    In the example, a UART interrupt is used to call it but you'd need to determine what your trigger would be for your sensor application.

    Best Regards,

    Ralph Jacobi