cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

Hi everyone!

I got some problem about DAC(8 bit)

I got 32 bit ADC input and I'm trying to configurate this input with DAC 8 bit output  I made something but i have some problem looks like

while I changing my input my DAC output changing too but not stable I change my input such as 36725 to 36027 my DAC output is

255 to 0 it is ok but if I change my input to down such as from 36027 to 35822  my output turning back to 255 and  in continues time to 0

but  I want  my input was 2^32 output should be 255 my input was 0 output should be 0

How can I do it?

I attached my file

0 Likes
Reply
1 Solution
JoMe_264151
Expert II

The DMA is configured to transfer 1 byte only from the ADC to the VDAC, not a 32 bit value.

Using both DMA and Getresult() API at the same time will not work at all.

You need to call IsEndConversion() API to wait until a conversion is complete.

The expression

A_OUTPUT = ((ADC_DelSig_1_GetResult32() - 1000) * 0.0015625);

will deliver negative values for counts < 1000.

Getting all together:

When the output frequency is low (kHz) you have time enough not to use DMA at all and do a conversion to optimize the output to the VDAC

There are examples for DELSIG that are not using DMA, try one of those

Bob

View solution in original post

0 Likes
Reply
15 Replies
Anonymous
Not applicable

I attached Now.

0 Likes
Reply
JoMe_264151
Expert II

The DMA is configured to transfer 1 byte only from the ADC to the VDAC, not a 32 bit value.

Using both DMA and Getresult() API at the same time will not work at all.

You need to call IsEndConversion() API to wait until a conversion is complete.

The expression

A_OUTPUT = ((ADC_DelSig_1_GetResult32() - 1000) * 0.0015625);

will deliver negative values for counts < 1000.

Getting all together:

When the output frequency is low (kHz) you have time enough not to use DMA at all and do a conversion to optimize the output to the VDAC

There are examples for DELSIG that are not using DMA, try one of those

Bob

View solution in original post

0 Likes
Reply
Anonymous
Not applicable

Hello Again ,

I start this program a few days ago So I'm not sure for this

Is this attached example good enough for me?

0 Likes
Reply
JoMe_264151
Expert II

That will be ok. Needs some minor modifications as

Changing LCD with UART to print on PC screen

I miss a single StartConvert() call for the ADC , see datasheet.

Bob

0 Likes
Reply
Anonymous
Not applicable

Thank you for all!

I know that code Name_StartConvert(); convert code is this but

I opened new project configured with my CY8CKIT 059LP chip So in PSOC programer I cannot find my ARM_GCC_541 -> NAME.hex

there is a  DP 8051_Keil_951 name.hex file btw I select it and program it and programming is failed So how can I fix it?

0 Likes
Reply
JoMe_264151
Expert II

The project you use is for a PSoC3. You need to change the device and re-compile to use it with a PSoC5

Try programming from Creator using the -059 project. DP 8051 is for a PSoC3 and cannot work.

Bob

0 Likes
Reply
Anonymous
Not applicable

Okay thank you I opened a new project and syncronized with my device so it is working now but now i cannot priting on LCD

DAC output

0 Likes
Reply
JoMe_264151
Expert II

The file you supplied is for a PSoC3, so it is not your actual project.

Bob

0 Likes
Reply
Anonymous
Not applicable

Hello againg

I'm searching  file for PSOC 5LP but i couldn't find can you some help me to find a example ?

and 1 more thing I'm using PSOC creator 4.2 and PSOC programmer 3.27.3 are these will be problem for me?

Oh ! before i forget I found that project from examples for PSOC 5LP

0 Likes
Reply
JoMe_264151
Expert II

Creator and programmer versions are ok. Try updating your components (Creator->Project -> update components) to get actual versions.

Bob

0 Likes
Reply
Anonymous
Not applicable

I'm using all companents lastest version now.  I guess.

is it ok now?

0 Likes
Reply
JoMe_264151
Expert II

Looks good!

Bob

0 Likes
Reply
Anonymous
Not applicable

3ebe3e98-1892-4c04-923b-cac02df93f5b.jpg

Hi again its surely working but I just taking 1 value not changing.

And I'm using 10 bit ADC and 10 bit DVDAC So when I print on LCD their MAX values are DVDAC : 1020

ADC : 1134 So what is the problem should be?  oh! one more thing I taking ~= 0.5 V output

0 Likes
Reply
JoMe_264151
Expert II

What do you mean with "I just taking 1 value not changing."? Does the program hang? In which line?

Bob

0 Likes
Reply
Anonymous
Not applicable

I opened new project witch same example but this time its work (without configurate)Thanks for everthing

But with 1 problem and it is showing 1.8V but multimeter reading ~=0.5 V  I think I can fix ithis

0 Likes
Reply