What is a good way to implement a programmed (firmware modulated) current source (<50 mA) using PSoC 5 with no or minimum external parts?
There is an IDAC component which is a Digital-toAnalog-Converter delivering a programmed current (not a voltage). Have a look at the IDAC datasheet to see, if it suits your needs.
According to the CY8C55 Family Data Sheet the built-in IDAC has a widest range of 0-2.04mA. So, the question remains.
It is possible to use 4 available current sources in parallel to obtain higher current (4 times 2.04mA). However, this will still not meet your requirement of 50mA.
Is there any specific application which requires a current source of range close to 50mA?
You can build a current source using internal components available in PSOC along with external (active / passive) components. The sourcing and sinking ability of the PSoC GPIOs are 4mA and 8mA respectively. And that of SIOs are 4mA and 25mA respectively. Care should be taken that these max ratings is not exceeded.
...and I am still convinced that 2mA < 50mA. (broad smile)
You will have to use external components as FETs to accomplish your needs.
Thank you all,
Seems that the best idea is to add an external voltage-controlled current source.
You might want to look at Dave Jones' µSupply video series (http://www.eevblog.com/projects/usupply/ ) where he talks about the design of a digitally programmable PSU using the LT3080. It might be a little bit of overkill (the LT3080 can deliver up to 1 amp), but might still be helpful to see how to design a current source.