You are here

Help with UART data transmission | Cypress Semiconductor

Help with UART data transmission

Summary: 8 Replies, Latest post by dhans on 08 Nov 2016 05:55 AM PST
Verified Answers: 2
Last post
Log in to post new comments.
dhans's picture
User
33 posts

Hello,

I have modified old project with 16 bit delta sigma ADC, Filter and UART. I am trying to send 16 bit ADC output to filter and further to UART. Somehow unable to get the output. Any suggestions?? 

user_1377889's picture
User
9583 posts

You collect data with a frequency of nore than 1ksps (1000 samples per second. Your UART is not able to handle that. When transferring binary data (which is not so safe using UART) you can send with your configuration 400 sps. So you need to increase the baud rate.

The data you send is not readable, it must be converted to ASCII. What do you want to do with the data on the other side of the UART?

A simple solution for you is to poll the filter fro channel A data ready and then transfer the result (Converted using sprintf) to UART which has to run at 115200bd (estimated)

 

Bob

dhans's picture
User
33 posts

Thanks Bob for the reply!

I would want to send this data over wireless link such as Bluetooth and plot the collected data for monitoring. This is a prototype which I am testing. So converting in ASCII wont be required.

user_1377889's picture
User
9583 posts

PSoC4 BLE do not have DMA afaik. So better concentrate on polling methods or interrupt driven solutions.

 

Bob

dhans's picture
User
33 posts

I am having PSOC 5 LP board. Interfacing external Bluetooth module. 

dhans's picture
User
33 posts

It works well with 8 bit ADC. When i modified it for 16 bit ADC, its not working. Either 16 bit DMA transfer or UART data transmission is not working. Don't understand where the problem is..

user_1377889's picture
User
9583 posts

            while (Filter_1_IsInterruptChannelA() == 1) Wait();                    // is this really correct???
      // while (!Filter_1_IsInterruptChannelA() ) Wait();                             // That looks better

            myint16 = (Filter_1_Read16(Filter_1_CHANNEL_A) + 128u);

This is the conversion of an int8 to uint8, you must change that for int16 to uint16

UART_1: Remove the interrupt, set baud rate to 115200 and tx buffer size to 200. Keep in mind that the UART transmits a byte-stream and because every code from 0x00 to 0xff is valid, you will at the receiver side not be able to distinguish where a value ends and where a new value begins.

 

Bob

 

dhans's picture
User
33 posts

It is working with following changes!! Thanks a lot !!

------------

while (Filter_1_IsInterruptChannelA() == 1) Wait();                    // is this really correct???
      // while (!Filter_1_IsInterruptChannelA() ) Wait();                             // That looks better

            myint16 = (Filter_1_Read16(Filter_1_CHANNEL_A) + 128u);

This is the conversion of an int8 to uint8, you must change that for int16 to uint16

dhans's picture
User
33 posts

For UART, I changed, buffer size = 16 and oversampling rate = 16x

Log in to post new comments.