- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Presently i am designing a band-pass filter on Psoc using only its op-amps, resistors and capacitors i am using from outside circuitary of my own.
I also have to produce a voltage reference source (of voltage approx 1.7-1.8 v) for which i am using a voltage source given (.256v) and amplifying it with a non-inverting amplifier with gain of 7.
I am trying this for past a month but unable to do so.
please help.
Thank you
PS: i am attaching the first file as the snapshot of what i did on psoc
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Chetan,
What is the exact issue you are facing while implementing this project?
Is the 1.8V from the Inverting PGA used as reference "Vmid" at the non-inverting input of Opamp A1?
Using PGA will result in offset error. Another option will be to use a VDAC component and buffering it through a Voltage Follower Opamp.
- 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
Hi Chetan,
What is the exact issue you are facing while implementing this project?
Is the 1.8V from the Inverting PGA used as reference "Vmid" at the non-inverting input of Opamp A1?
Using PGA will result in offset error. Another option will be to use a VDAC component and buffering it through a Voltage Follower Opamp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, that 1.8V is the Vmid.
First of all i am unable to find the output of PGA (at pin5) no output is showing at all, so i tried to construct a voltage follower first and that too not working.
I am attaching the snapshot of the follower
pin1 which is the output of the opamp is==p0(1)
pin2 is p0(3)
pin3 is p1(6)
At pin2 and pin3 the output is coming as expected and can be seen on oscilloscope only the output of the voltage follower is not coming properly.
This is the source code which is also been used
#include <device.h>
void main()
{
void PGA_Inv_1_Start();
/* CYGlobalIntEnable; */ /* Uncomment this line to enable global interrupts. */
for(;;)
{
/* Place your application code here. */
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From the snapshot, what I see is that
Pin_1 = P1[2]
Pin_2 = P0[1]
Pin_3 = P1[6]
You need to write the API Opamp_1_Start( ); in the main.c
You need to start other Opamp components also in similar way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks what is was doing is was initializng with this api
void opamp_1_start();
so i guess void cannot be used here.
thanks will let you know if the band pass will work or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
also one more thing i am using cy8c3866axa-40 so how many op-amps are there naked as well as comparator.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Chetan,
That's right. There is no need of using "void" while calling the Start API.
In cy8c3866axa-40, there are 4 naked opamps and 4 comparators.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you have a project built, there is a .RPT (report) - file. It shows what resources in your chip are availlable and used up. So you can get a feeling what more hardware (analog and digital) you can put into your design.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In a zero cross detector one of the input is grounded and another input pin is p0(3) .i am giving input through a signal generator with frequency 3khz
so to see the input output waveforms i am taking a wire out from p0(3) and attaching it with both DSO as well as signal generator to provide the signal as well as to see it on dso
but it is somehow clipped from bottom a bit.
when i remove the wire just signal generator and dso (oscilloscope) is connected the waveform is coming correctly
Although the output of the waveform is coming correctly \m/
Why the input is being clipped?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Chetan,
What kind of waveform are you using from the signal generator? Is it sinusoidal or square?
What is the swing of the waveform? I mean the max and min voltages.
The min voltage given should not be negative, that is, the PSOC ground (Vss) should be the lowest voltage in the entire system.
If you are intending to use negative voltage with PSoC, then you'll have to introduce an offset at the input using analog ground. The comparator's inverting input can be connected to this analog ground.
Care must be taken to ensure that the voltage swing at the input is within the supply voltage of PSoC, that is, within Vdda and Vss. If you exceed this, the waveform will get clipped or worse, the device will get damaged (if the Absolute Maximum Ratings is violated).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yeah i am using sinosuidal wave with maximum and minimum swing of +2.3v to -2.3v
and how can i introduce offset using analog ground?
thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Chetan,
If you want to use a sinusoidal waveform varying from -2.3V to +2.3V then you'll have to do the following:
- The supply voltage of PSoC should be greater than the peak to peak input voltage. Hence, you need to operate PSoC at greater than 4.6V, say 5V.
- Now, you need to bring out analog ground from PSoC. You can use voltage slightly greater than 2.3V as analog ground. This can be obtained by using a VDAC followed by a buffer. This voltage corresponds to the 0V of your signal input. Now, the signal which varies from -2.3V to +2.3V with respect to the signal generator's ground will vary from 0V to 4.6V with respect to PSoC's ground. Hence, you'll operate in the safe limits of the PSoC device.
- In the zero-crossing detector, the input terminal which was initially connected to ground should now be connected to the analog ground (2.3V). The ground of the signal generator should also be connected to this terminal. The other terminal (P0[3]) should now be connected to the signal generator's output.
If you follow this configuration, then the clipping of the signal will be avoided.
Let us know if this works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok i am checking by this method..
one more problem the PGA's +ve terminal is connected to .256v and -ve terminal to vssa(GND) and the inverting gain is set to 7 according to which the output should be around 2 V but it is coming out to be 2.5 V approx
Even when the gain is changed to 3 the same output 2.5V is showing
Is this because of offset problem or something else... i have initialized it in main.c also
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Chetan,
Are you using inverting PGA or non-inverting one?
If you are using an inverting one, then the output voltage equation is given by Vout = Vref + (Vin - Vref) x Gain, where the gain is negative.
If you connect the 0.256V reference to positive terminal and ground the negative terminal, you'll end up getting a negative voltage. Since, you cannot get negative voltage from PSoC, you should observe that the output will be close to ground.
It is always better to use an opamp to buffer the internal reference voltages.
Another option is to use VDAC and buffer it out to a pin, if accuracy is not of great importance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for VDAC it is working accuratly !
However for inverting PGA the result is shocking.
My configuration is PGA inverting
gain=3,7,15
inverting input (which is also the vin)= vssa(GND).
non-inverting input(which is also the vref)= 0.256V.
PGA is in low power mode(medium power mode is also used)
For all these cases the output is constant and that is 5V at pin P0(1)
according to the equation Vout = Vref + (Vin - Vref) x Gain, where the gain is negative,
Vref=0.256v, Vin=0V, gain= -3, -7, -15
so for a specific case lets suppose for -3 gain the Vout will be
Vout= 0.256V+(0-0.256)x(-3) which is approximately +1V.
i have initialized it as PGA_Inv_1_Start(); in main.c also.
Not being able to find the mistake i am doing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
About the analog ground problem, the psoc was set to 5 V initially.
The Vdac was used to give output of 2.356 V and then an op-amp was used to buffer it.
Output of op-amp(which is acting as buffer) is taken at P0(2) now the signal generator is set to 1Khz, 2V(peak to peak).
The ground pin of signal generator is attached to the P0(2) pin that is the output of the op-amp(buffer).
and the positive pin is attached to the oscilloscope.
The ground of oscilloscope is given digital ground of psoc(available in abundance on development kit).
The output was 2.3 V above the ground but high distortions were observed, when the oscilloscope ground is attached to the P0(2) pin (keeping all ground as the output of buffer) the oscilloscope shows the sinusoidal waveform with vmax as +1V and Vmin as -1V.
After sometime when compiled again it show error "Warning: dbg.M0039: There was an error running port acquire. There may be no devices attached, or a device may be in use by another application" and the psoc wasnt working when i touched the device it was extremly hot (maybe because it is damaged)
Quickly i powered it off and miniprog was removed and whenevr i tried to switch it on after a short duration of time(let say 2 sec) it started heating up and doesnt work either
When i switched it to 3.3V power supply it is not heating and LCD is showing the default signature
but still the error "Warning: dbg.M0039: There was an error running port acquire. There may be no devices attached, or a device may be in use by another application" is showing
Where is the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Chetan,
I tested at my end by creating a project having an Inverting PGA. A 0.256V reference is connected to Vref terminal and Vssa (Gnd) to Vin.
When the PGA gain was set to -3, the output voltage obtained was close to 1V (as expected). When gain was set to -1V, the output was close to 0.5V (as expected). When the gain was -7, the output voltage was approx 2V (as expected).
Did you start the PGA component in the main code?
Was the voltage reference components used correctly?
- 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
Regarding your second observation, when you connected the signal generator's ground to analog ground (which in this case is 2.356V from P0([2]), and observe the waveform on oscilloscope (with oscilloscope's ground connected to PSoC's ground Vssd), ideally you're supposed to see that the signal generator's sinusoidal output is 2.356V +/ 1V , that is, varying from 3.356V(max) to 1.356V(min).
From your statement "when the oscilloscope ground is attached to the P0(2) pin (keeping all ground as the output of buffer) the oscilloscope shows the sinusoidal waveform with vmax as +1V and Vmin as -1V.", it is expected that when you connect oscilloscope's ground to Vssa (P0[2]), the waveform is varying between +1V(max) and -1V(min). The observation is right.
But what is meant by "keeping all ground as the output of buffer"? Does it mean that even Vssd was shorted with P0[2]? If so, then there would be a short, and the chip would have been damaged.
Are you able to program the device now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
somewhat same problem i am facing, i tried High Pass Filter Circuit using psoc's onchip opamp with dedicated pins. but no output comes, let me know whether opamp power selection in void main() code is required? or any other issue...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you open the OpAmp configurator and set the power, that will prevail
until you call an API at a later time and modify the power setting.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Chetan, to handle negative signals referenced to Vssa the following are some
methods, one as simple as 2 R's -
https://www.dropbox.com/s/k1yn4m7heaixvmg/ADinput%20negative%20inputs.zip?dl=0
Regards, Dana.
- 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
According to me when you have a project built, there is a .RPT file.
It shows what resources in your chip are available and used up. So you can get a feeling what more hardware (analog and digital) you can put into your design.
Regards,
Cortenis