- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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??
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PSoC4 BLE do not have DMA afaik. So better concentrate on polling methods or interrupt driven solutions.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having PSOC 5 LP board. Interfacing external Bluetooth module.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For UART, I changed, buffer size = 16 and oversampling rate = 16x
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Starting with the ADC (which is set for 4 configurations from which you only need one):
- Mode is set to continuous, that does not match with the soc by the PWM.
- Buffer gain is set to 4 which will conflict with the 1V output of the WaveDACs and the 1.20V reference.
- With 16bit resolution you should transmit a 32bit item with DMA, not only a 16bit item.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your time!!
>> Mode is set to continuous, that does not match with the soc by the PWM.
>> With 16bit resolution you should transmit a 32bit item with DMA, not only a 16bit item.
With the same mode and 16 bit resolution with 2 byte DMA data transfer is working fine with single ended input. I verified the signal frequency and amplitude both. But same is not working with differential input.
>> Buffer gain is set to 4 which will conflict with the 1V output of the WaveDACs and the 1.20V reference.
Differential voltage would be low hence I had set the gain to 4. Also as per your suggestion have tried for less gain as well. However no change was found. Unable to still crack the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With the same mode and 16 bit resolution with 2 byte DMA data transfer is working fine with single ended input.
But with differential you are expecting negative values,
Tell more exactly what you get and what you expect.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes. You have a point. I need to transfer 32 bit with 16 bit resolution.
Now I am getting some data, though its not correct. It is at least giving some response.
I think the byte sequence is not proper, that might be the reason, I have just modifies the number of bytes to be transferred over DMA. Are there any more settings with respect to alignments for 32 bit transfer or it will remain same as that of 16 bit transfer? as I could not find much in datasheet.