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
Solved! Go to Solution.
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
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
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
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?
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
The file you supplied is for a PSoC3, so it is not your actual project.
Bob
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
Creator and programmer versions are ok. Try updating your components (Creator->Project -> update components) to get actual versions.
Bob
Looks good!
Bob
What do you mean with "I just taking 1 value not changing."? Does the program hang? In which line?
Bob