PSoC 4 - Can I make a programmable Voltage and other queries

A catchall for PSoC Mixed-Signal Array (microcontroller) discussions not captured by the other forums.

Moderator: ericb

PSoC 4 - Can I make a programmable Voltage and other queries

Postby dynamag » Sun Apr 20, 2014 2:54 am

Hi
I am just getting into the PSoC 4 and trying out my first steps on a CY8C4245AXI-483. I see it is good. But....
1. I am trying to implement a variable (programmable) reference voltage for a comparator, since I see that VDACs are not available in this family. Not seeing any other way than pushing out a waveform DAC (file)voltage out a pin and into another pin to send that signal as reference to the comparator. Is this the only way?
2. I cant seem to be able to route the same input pin to two places, like to the ADC as well as a comparator. What am I missing? do I need to use an op-amp component also? Even using an op-amp gave a yellow wire when I tried, though it did not mention any error or notice(warning?)
3. What are those notices that say "The following x pins will be assigned a location by the fitter". I have this with x=5, and the notice is followed by a list of five pins that I thought I had assigned, four analog inputs to the ADC (via Port 2) and one the bypass port (P1.7) that I have assigned to keep my ADC sample rate high. I need to sample at 50KHz, so. I have assigned three more P2.x ports that don't show in this notice.

All your thoughts most welcome.
Regards :)
Shiv
dynamag
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 24
Joined: Thu Mar 31, 2011 11:30 am

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby bobmarlowe » Sun Apr 20, 2014 4:09 am

To help you as much as we can, it is always advisable to upload the complete project, so we all can have a look at the settings of the components you use.
To do so, use the "Create Workspace Bundle"function of Creator.

You can use a Current DAC, connect its output to a pin and an external resistor to GND, so you control the voltage. Tte same pin you connect (internally) to your comparator, so this solution requires only 1 pin.


Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby dynamag » Sun Apr 20, 2014 8:23 pm

Hi Bob
Thank you. I have uploaded the bundle now.
Attachments
PD_HP_21_04_14_Start-000.cywrk.Archive01.zip
(1.65 MiB) Downloaded 211 times
Regards :)
Shiv
dynamag
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 24
Joined: Thu Mar 31, 2011 11:30 am

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby bobmarlowe » Mon Apr 21, 2014 1:52 am

In the PSoC4 world some of the routing flexibilities (compared to PSoC5) are reduced, so there might be routing restrictions. Some ports are mainly used for analog, some are restricted to the communication blocks and others to the TCPWM modules. The UDB-based components are freely routable.

What are those notices that say "The following x pins will be assigned a location by the fitter".

You have to lock the pins, or the fitter is assigning them a calculated output.

I cant seem to be able to route the same input pin to two places, like to the ADC as well as a comparator

The input pins connected to the ADC are time-multiplexed, so a connection to a comparator would not reveal your expected behaviour, so connecting a pin to both of them is not allowed.

I think you know that your project will not run yet, you have to start() all your components first and I suggest to enable global interrupts.


Bob

Project with locked pins attached
Attachments
PD_HP_21_04_14_Start-000.cywrk.Archive01.zip
(27.49 KiB) Downloaded 200 times
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby danadak » Mon Apr 21, 2014 3:41 am

1) Keep in mind the IDAC output is not buffered, and needs a R termination
to convert to V. Also V range is limited by IDAC compliance value, does not
seem to be speced in datasheet. You might have to file a CASE to get that.

To create a technical case at Cypress -

http://www.cypress.com
“Support”
“Technical Support”
“Create a Case”

You have to be registered on Cypress web site first.

2) Attached chart of dedicated pins.

PSOC 4 Dedicated Pins.jpg
PSOC 4 Dedicated Pins.jpg (102.63 KiB) Viewed 10022 times


3) If your schematic becomes too cluttered, right click page tab at bottom of window and add a new page.

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby dynamag » Mon Apr 21, 2014 5:14 am

Thank you Bob and Dana
Please help me out here. I need to see if all this is possible on a single 4245 PSoC4 chip
1. Measure the voltage across an Rshunt to ground, feed the V across the Rshunt to an analog mux- (through an opamp? what about gain control through firmware then?), and simultaneously feed it to a comparator to check whether it is within limits. The ADC is also connected to other signals that it will scan through. The ADC o/ps will be read by CPU as and when required, while the comparator o/ps are to the kill i/p of a tcpwm block that
2. runs with a dead time mode that has two o/ps that go to pins outside, as well as to another two PWM units that start along with the first PWM, but with different pulse widths that will be loaded via firmware.
3. I also need to send some data via a firmware loaded shift register to a pin with a clock which is also inverted and sent to another pin.

Please pardon my unwholesome spaghetti of thoughts above. I have tried to draw all of the above in a KiCAD schematic. Hope it make things clearer.
Image
Regards :)
Shiv
dynamag
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 24
Joined: Thu Mar 31, 2011 11:30 am

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby bobmarlowe » Mon Apr 21, 2014 6:55 am

With the use of some external pins this should fit. You scetched fewer ADC-pins than in the schematic, which one is correct?

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby danadak » Mon Apr 21, 2014 7:43 am

You should be able to route Vshunt to both A/D and Comparator w/o any intermediate
OpAmp use.

As long as you meet the CM range of both connected modules.

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby dynamag » Mon Apr 21, 2014 10:08 am

Thanks again, Bob and Dana

Yes, Bob, the inputs to the ADC are 8 in number as in the schematic, not the 5 that I drew.

One detail that I missed out in my last post.
The Vshunt may need to be amplified (by less or more than 1) depending on its value before going to the comparator, like in one system it may require gain of more than one, and in one it may need gain of less than one. So if I move the op-amp to only the comparators signal path, will that be okay?

I see the ADC has gain in it, but that is the same for all channels,whereas I need gain only on one channel...... and all gains are >=1

Is there any PGA equivalent in PSoC4 or any way to get these CT opamps to function in the way of a PGA?
or any way to make a programmable opamp with gain that could be manipulated in firmware? with some pins and another PSoC4 component from library?
without external components? Am I being greedy? :mrgreen:

Your patience with my unending seies of questions is most appreciated.
Regards :)
Shiv
dynamag
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 24
Joined: Thu Mar 31, 2011 11:30 am

Re: PSoC 4 - Can I make a programmable Voltage and other que

Postby danadak » Mon Apr 21, 2014 11:14 am

The A/D shows a buffer G, but if you try to use it you will get error. Its not
implemented in PSOC 4.


There is no PGA in PSOC 4. You would have to do it with OpAmp, mux and external G setting
R's.

You could use a JFET, PWM to develop DC control V, like these first 2 images to create a
VGA -

https://www.google.com/search?q=variable+gain+amplifier+jfet&tbm=isch&tbo=u&source=univ&sa=X&ei=XW5VU87wJLHlsATOv4HwBQ&ved=0CDsQsAQ&biw=2144&bih=1026

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire


Return to “%s” PSoC1 General

Who is online

Users browsing this forum: No registered users and 1 guest

cron