PSoC examples - Page 1
Forum section: electronics / general

author: Harvs
author_rank: Super Contributor
timestamp: May 10, 2013, 10:44:45 am
content: Every now and again someone pipes in with the suggestion that PSoC would be the answer to a problem, and recently jmole has a thread over here about his/her kickstarter project.https://www.eevblog.com/forum/crowd-funded-projects/thinking-of-starting-your-own-crowdfunded-project-ask-me-anything!/Rather than hijack that thread completely with PSoC discussions, I thought it would be wise to start one over here.I've done some basic research on these in the past, and the inclusion of the cortex Mx into there range certainly pricks a lot of interest. But I honestly still don't understand where they fit into the picture.If anyone has come across some examples (or has some), of where using a PSoC is "better" (e.g. lower cost or could actually get the job done), than with the more regular parts I'd love to read it.Seriously I'm not having a go, I just genuinely haven't seen a real world example where using a PSoC made for a better design, and their marketing videos are just crap. I keep reading examples of where PSoC are better than arduino, but come on...For example could a PSoC do the iPod nano display drive in hardware that Mike recently did with the small FPGA?

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: May 10, 2013, 12:05:18 pm
content: Quote from: Harvs on May 10, 2013, 10:44:45 amThat's something I will be looking into. Enough logic to generate the DDR and LLVDS voltage levels and have a fast interface to the host could be useful - I'd rather use an MCU than an FPGA for this project (now looking at a couple of thousand screens BTW) as we're looking at doing fonts & overlays over the image dataLast time I looked at Psoc a few years ago, ( the earlier ones), they were expensive unless you could make good use of the analogue stuff to save cost on external hardware

author: jmole
author_rank: Regular Contributor
timestamp: May 10, 2013, 04:39:13 pm
content: I worked on a project a while ago that measured conductance betweenelectrodes placed on a waterfall to make musicbased on how much water was flowing between various segments.Probably 10-12 electrodes if I remember correctly. I wanted to measure conductance between each pair, so something like 100 or 144 readings (yes, some are redundant), where each reading consisted of setting both electrodes to 0, setting the measured electrode to high-Z, setting the drive electrode to 1, then taking an ADC reading shortly thereafter. Essentially it was like an integrator, using the R of the water and the C of the input pin on the PSoC. The input pins were buffered with one of the internal op amps, so there was little charge leakage or current demand on the pins, and it worked pretty well.Anyway, I don't have the project at hand, so I don't remember if that's exactly how I did it (might have used a current DAC, rather than the integrator I described), but being able to switch between analog/digital operation on those pins was pretty useful, as was being able to buffer/multiplex them internally to a SAR ADC.Another example, with no analog at all, is the work I've done onZeroTouch. If you take a look at theCHI 2012 paper, you can see the system architecture on page 4 of the PDF. Using the verilog capabilities in PSoC, I created some glue logic that lets us quickly collect data from the sensor and pump it to the EZUSB FX2 chip. So rather than wasting MCU cycles on data transfer, we can flip a pin and let the digital logic do the work automatically.

author: amspire
author_rank: Super Contributor
timestamp: May 10, 2013, 04:46:19 pm
content: I went to the Cypress Website to get Creator and their download page died when I was trying to get Creator. I imagine they will fix this pretty quickly. It might actually be working as data sheets also went down and you can get them again.Anyway, after a lot of digging, I worked out some direct download links for anyone who just wants to get Creator directly:The PSoC Creator 2.2 Sp1 install (alternative locations)http://dlm.cypress.com.edgesuite.net/akdlm/downloadmanager/software/PSoCCreatorSetup_2.2_sp1.exe(614MBytes)http://dlm.cypress.com.edgesuite.net/akdlm/downloadmanager/software/creator/PSoCCreatorSetup_2.2_sp1.exe(614MBytes)PSoC Creator 2.2 ISO of install disk. Sp1 and Sp1 release candidate 11http://dlm.cypress.com.edgesuite.net/akdlm/downloadmanager/software/creator/psoc_creator_2.2_sp1.iso(1136 MBytes)http://dlm.cypress.com.edgesuite.net/akdlm/downloadmanager/software/creator/psoc_creator_2.2_sp1_rc11_b572.zip(1222MBytes) (Seems to be the latest, but I went with SP1)The ISO to make an install DVD is probably not needed. I think it just has a lot of prerequisites like Microsoft NET packages.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: May 10, 2013, 08:29:54 pm
content: I had a quick look at the Cypress website, and they are not doing themselves many favours in publicising the family - several broken links, and despite looking at the product page and watching a video I couldn't tell if their IDE actually included a C compiler, or you had to use it with Keil.....Pricing on the M3 parts is pretty high - significantly more than a CM3 MCU+CPLD, but the M0 parts look good, when they become available.

author: andyturk
author_rank: Frequent Contributor
timestamp: May 10, 2013, 08:47:44 pm
content: Quote from: mikeselectricstuff on May 10, 2013, 08:29:54 pmIt gets slightly more reasonable if you can use some of the other stuff to replace external components. I just ordered a board (a shield for jmole'sfreeSoC) that uses the internal op amps instead of outboard components. The "special" I/O pins also mean I don't have to mess with level translators. The chip even has an on-board SMPS controller (not sure if I'll use that).

author: tinhead
author_rank: Super Contributor
timestamp: May 10, 2013, 08:53:07 pm
content: Quote from: mikeselectricstuff on May 10, 2013, 08:29:54 pmCypress IDE installation always contains C compiler, PSoC Creator 2.0 is using Keil and/or Gcc (for ARM and 8051).So all you need is to run installer, with Cypress products it is the best to leave paths to what the installationis proposing (not sure if that fixed today, but in the past it was always a small fight to get things running whenpath was customized).PSoC Designer 5.x is using Hitech C compiler, it is as well included in the installer.It make sense to not touch nor play with the inluded gcc/hitech/keil, they works even if you have tons of othercompilers on your PC.

author: jmole
author_rank: Regular Contributor
timestamp: May 10, 2013, 09:08:30 pm
content: Quote from: mikeselectricstuff on May 10, 2013, 08:29:54 pmDefinitely comes with a free compiler, GCC. Works very well for me.Quote from: mikeselectricstuff on May 10, 2013, 08:29:54 pmThe upshot is, you can do verilog development without another IDE. And it's trivial to integrate with the MCU, since you can reconfigure it in software. If you've got two chips, like an NXP M3 and a Lattice CPLD, changing the interface between the two could be frustrating at the design/proto stage, and impossible in the field.Plus, have you ever used an FPGA/CPLD tool that you've liked? That was easy to use out of the box? That you could easily version control with your other bits of firmware? Probably not. Not in my experience anyway.

author: blewisjr
author_rank: Frequent Contributor
timestamp: May 11, 2013, 01:44:28 am
content: Ok so I hear and read all these benefits about these PSoC chips. From jmole's freeSoc site even the cypress site. But what real advantage do these things give to the hobbyist / beginner. For instance right now I spend a lot of my time with 8 bit avr's. I have been thinking about getting involved in some arm development as well. Besides speed and elimination of some discreet components what do these things give me that and AVR or ARM chip can't from a hobbyist bang / buck perspective? As far as I can tell it is really not saving any money except from a time perspective.

author: jmole
author_rank: Regular Contributor
timestamp: May 11, 2013, 02:06:58 am
content: Quote from: blewisjr on May 11, 2013, 01:44:28 amIt all depends on the application in question. If you have a need for analog hardware and it's not too exotic, odds are you can do an implementation with just a PSoC. Ditto if you need some basic high-speed glue logic.If you're just doing SPI, I2C, and some general processing, an ARM will serve you just as well as an Ardunio.

author: amspire
author_rank: Super Contributor
timestamp: May 11, 2013, 02:14:13 am
content: Quote from: blewisjr on May 11, 2013, 01:44:28 amIn the case I was looking at, I was considering using 3 Atmega chips and an extra FPGA as well. The reason I had to look at using 3 micro's is that two of them wire running a fast timer loop with regular timer interrupts and they didn't have the capacity of doing any other tasks without the risk of missing a timer interrupt. I was basically running the two Atmega's at full speed doing one task, so they could not do anything else.I am hoping that by going to the Cypress chip, I can offload the time-critical tasks to hardware logic, and also add the logic from my external FPGA as well. If it works, I can replace the 3 Atmega's and one FPGA with one Cypress chip. That would be fantastic. Just one device to program and a big simplification of the circuit.Plus I can make the circuits behave exactly as I want. I need to have some 8 bit PWM's but I need them to behave properly when set to 0 (a constant 0V out from the PWM) and when set to 255 (a constant 1 out from the PWM). Many micro PWM's do not behave correctly at one or both of these limits. With the Cypress chip, I can force it to work exactly the way I want, even if it means adding extra logic after the PWM to force the output to 0 or 1 in the specific case the PWM is set to 0 or 255.With other micros, you have to live with the way the designers decided the internal features should work. With the Cypress, you can overwrite the way these embedded features work by adding extra logic.

author: amspire
author_rank: Super Contributor
timestamp: May 11, 2013, 02:25:57 am
content: Also, the feature set of these Cypress chips is just incredible. It is easy to get a micro that include LCD drivers, Capacitive touch sensors inputs, comparators, opamps, 0.1% voltage references, 20 bit delta sigma A/D's, D/As and lots more. You can chose what output goes to what pin, so board layout can become very, very easy.

author: BravoV
author_rank: Super Contributor
timestamp: May 11, 2013, 02:42:43 am
content: Quote from: amspire on May 11, 2013, 02:25:57 amWait till you played with the on fly dynamic "re-assignment" at those highly re-configurable analog/digital blocks, it feels like having a mutant mcu that can morph into other beast, a dynamically change configurations repeatedly while the device is running.

author: blewisjr
author_rank: Frequent Contributor
timestamp: May 11, 2013, 03:06:48 am
content: Ok I see now. They are a great choice for very complex applications as they can simplify much of it. This is probably something I would not need for quite some time but could be very fun to play around with at some point.

author: Harvs
author_rank: Super Contributor
timestamp: May 11, 2013, 03:07:32 am
content: Quote from: amspire on May 11, 2013, 02:25:57 amAnd there's my problem with understanding where these devices fit into the grand scheme of things.The only feature you've mentioned there that a current model ARM chip wont have is opamps, and the 20bit ADC, DAC you'd need to get one that specifically has those in it (which there are a number of parts that do.) From the spec sheet the op-amps are only fairly basic garden variety with 2-3mV input offset (PSoC5), and an unspecified input bias current (though I'm assuming they're a FET input.)You also mentioned in the previous post that you replaced 3 ATmega's. It is not my intention to pass any judgement at you're design, but I can't help but wonder what the result would have been with a Cortex M3 or even M4 thrown at it?I guess it comes down to the configurability, and building you're own components. Which is where I wonder about how much fabric they have compared to say a medium sized CPLD. It's a shame there's no VHDL support, but I guess it wont take much to pick up Verilog knowing VHDL. I'll just have to buy a dev board and try out some things.

author: amspire
author_rank: Super Contributor
timestamp: May 11, 2013, 03:24:25 am
content: Quote from: Harvs on May 11, 2013, 03:07:32 amGiven the same clock speed, probably worse. An 8 bit micro can often change a pin in one clock cycle. ARM processors usually have pipelining so it will probably take several clock cycles.If you are talking about replacing a 20MHz 8 bit Atmega with a 400MHz ARM, then yes - it will be much faster. Not as fast as a logic circuit though. If you are going to choose a M3 ARM core, why not choose the Cypress PSoC Cortex M3 Arm chip and get the extra features of the Cypress ICs thrown in?

author: Harvs
author_rank: Super Contributor
timestamp: May 11, 2013, 04:30:59 am
content: Quote from: amspire on May 11, 2013, 03:24:25 amBut they're not the same clock speed, STMF0 -> 48Mhz, F3 -> 72Mhz, F4->168Mhz.From what I've seen, cost. An STM32F3 is in the 5-10$ range. An F4 ranges between $11-20. A PSoC F3 @ 67MHz, is in the $14-30.But as Mike said earlier in the thread, the M0's look a lot more promising. With chips in the $3-4 range, which is similar to the STM32F0, except with half the RAM and Flash, so I guess they've traded memory for their configuration on the silicon. However, you can't buy them yet...

author: amspire
author_rank: Super Contributor
timestamp: May 11, 2013, 04:55:43 am
content: If you do not need any of the Cypress PSoC special features, you can get a cheaper processor from other suppliers. If I can use a $1 micro, I am not going to use a $14 Cypress M3 PSocC instead. In my case with the 3 Atmegas, I could probably make the two dedicated ones ATTiny processors instead at about $1 each - or something else.If you need some of the extra features, then even at $20, it may be a costs saving. How much does it cost when you have an non-Cypress ARM chip + an ASIC chip to attempt to partially get the same capability? How much time are you going to waste trying to get the two different ICs to work together? How much time will it take to learn two different development environments?It is all about choosing the best device for the job. In some cases, nothing else will come close to a Cypress PSoC.I haven't used a Cypress micro myself, but it really does look a huge time saver. I could end up using a 8051 based PSoC instead of the Arm version as it is much cheaper and it may do the job. The micro speed for me is not a big issue if I have programmable hardware. The main issue with the 8051 core is you have to request a free license for the 8051 compiler, and you have to reapply for the license every year. It is possible that the free version of the compiler could disappear in the future.

author: Corporate666
author_rank: Unknown
timestamp: May 11, 2013, 05:33:41 am
content: Quote from: blewisjr on May 11, 2013, 01:44:28 amWe used to use exclusively Atmel chips for our designs (makes it easier having one hardware/software platform). With Atmel, the chip you choose depends on the features you need. One chip may support CANbus, but will have 3 timers and one capture pin. The part with 2 capture pins may have 6 times and 8 PWM channels, but is a much "bigger" chip than you need - you're just buying it for the extra capture pin.With the PSoC, it's different. You have blocks that can be anything - timers, counters, PWM's or whatever you like. So you do not spec your chips based on individual functions, but rather based on how many blocks you need. And there will be several versions of the same chip family in the same package with differing numbers of blocks, flash, SRAM, etc. And I think the chips are competitively priced.As an example, I went to Digikey and typed in ATMEGA, and selected one with 32k of flash and 25 or more IO's. The cheapest one is the ATMEGA329 that is $3.89 in 1,000 unit quantities, or $6.97/ea. That ATMEGA runs at 16Mhz and has 3 timers, 1 input capture, and 4 PWM channels. It has no USB support or DAC and but has SPI, I2C and a UART.I went to Cypress (direct is cheaper than Digikey) and the cheapest PSoC3 with 32k of RAM is $3.44 in 1,000 quantities, or $4.52 for one. It runs at 50Mhz and whatever features you need you can just drag-and-drop those components into the digital blocks. So if you need 10 PWM's, fine. If you need 4 capture pins, fine. If you need 8 timers, fine. If you need less or more memory, fine. If you need I2C, SPI, etc - you just add the necessary components. Your consideration is just how many blocks the chips gives you to work with, not what pre-determined functions the chip supports.The other big thing about PSoC is the analog and processing you can do in the chip. You can build logic and do filtering/conditioning with hardware and reconfigure it any time you like. If you need to invert a signal, or buffer signals, or multiplex signals, you just add those blocks and do whatever you need. And the blocks have API's to make them easy to use. You're not dealing with registers directly unless you want to.Another thing that is nice is being able to abstract the function from the pin. So you can route your PWM to pin 1, or pin 10, or whatever pin you like. If you make a layout error in your board, you can usually just reconfigure your pins to fix it. You can also pass signals right through or put some logic or components like op-amps or comparators inline for fast processing without actually having to do any code at all.Considering the power and pricing, I am not sure why most people wouldn't use PSoC's for most stuff.

author: andyturk
author_rank: Frequent Contributor
timestamp: May 11, 2013, 06:17:20 am
content: Quote from: amspire on May 11, 2013, 02:25:57 amIt's like getting a breadboard full of goodies inside your mcu.I'm looking to convert a prototype that's based on a STM32F103. It has four buffered 5V analog sensors, some voltage dividers to bring the signals down to 3.3V, buttons, a TFT display and a few LEDs for debugging. I'd never considered a PSoC before, but I read a few of jmole's posts and got intrigued.I think I can ditch most of the external analog stuff in previous prototype (op amps and dividers). That'll make assembly easier and (hopefully) reduce the errors introduced by all the discrete components. The analog sensors are 5V and another point for the PSoC is that it can run the ADCs with the same VREF that the sensors are using (instead of having to divide the outputs down to 3V).Another benefit for prototyping is the flexible pin mapping. The STM32 devices are pretty flexible, but you still have to be careful about which peripherals you use because the pin assignments overlap. It requires some fairly serious datasheet study to make sure you're not painting yourself into a corner by needing to run SPI_X and UART_Y simultaneously. Even worse, the the pinouts might work, but there can still be conflicts with overlapping DMA channels (DAMHIK).The PSoC approach seems much more flexible. I've got one of jmole'sfreeSoCboards with an Arduino I/O pinout for "shields." It took a few hours to slice off the mcu and power supplies from the design I'd been working with and convert it to a freeSoC shield. I didn't pay much attention to the Cypress datasheets, since all the pins can be remapped in firmware.Neat stuff!

author: kripton2035
author_rank: Super Contributor
timestamp: May 11, 2013, 08:08:24 am
content: I love the Psoc too. the only drawback I found is that you can at best have 4 opamps insideand for some projects it can be too small.for the other digital and analog parts it's always enought and you can choose the chip for the amount of block you needbut it would be great to have a psoc with 8 opamps and a few digital block.

author: TerminalJack505
author_rank: Super Contributor
timestamp: May 11, 2013, 11:13:33 am
content: These Cypress PSoc chips sound awesome. Which one would you recommend for a hobbyist?That is, one that comes in a hobbyist-friendly package. 0.65mm pin pitch package or bigger, for example.And free (as in beer), unencumbered development software. I don't want to have to pay to use the vendor's hardware or do yearly re-licensing nonsense.

author: blewisjr
author_rank: Frequent Contributor
timestamp: May 11, 2013, 11:24:31 am
content: Quote from: TerminalJack505 on May 11, 2013, 11:13:33 amI agree these things actually sound really awesome and might be really helpful in teaching me how circuits work without having to go out and buy crap loads of components and breadboard them. Is PSoC Creator 100% free to use with no little commercial gripes hidden below? I might grab on of jmole's freeSoC just to learn about various circuits and interfacing type stuff. Then if by some chance I need more op amps or whatever just some perfboard and pins to make a shield for the top. As a circuit noob this thing might teach me a bucket load.

author: Hypernova
author_rank: Unknown
timestamp: May 11, 2013, 12:07:14 pm
content: Quote from: kripton2035 on May 11, 2013, 08:08:24 amHa! once you get get some you will always ask for more. Next thing you know people would start demanding a million gates and multi amp outputs. Personally I think it's a shame they didn't release a M4 version with FPU, given all the analog stuff the core looks a bit gimped for DSP work. I find 67MHz quite low as their top speed considering most other M3's I've seen reach 100+.As to the comment that it should be more popular, I think it suffered to due to the 1st PSoC5's (the non-LP version) having long erratas, promised CAN bus removed, looser analog specs etc, the years of development time didn't help. These were only fixed in the new LP series. Atmel Xmegas were in a similar boat, their ADC's had shortcomings that were only fixed in the later -U series with USB ports.

author: TerminalJack505
author_rank: Super Contributor
timestamp: May 11, 2013, 12:43:07 pm
content: Quote from: TerminalJack505 on May 11, 2013, 11:13:33 amAfter some research I think I have determined the answer to my question is: PSoC 4. These are Cortex M0-based and (soon to be) available in TQFP and SSOP packages.It looks like they haven't hit the streets just yet, though.It looks like they are going to be very nicely priced. I'll have to check them out when they are available.

author: amspire
author_rank: Super Contributor
timestamp: May 11, 2013, 01:34:09 pm
content: Quote from: TerminalJack505 on May 11, 2013, 12:43:07 pmThe more I look, the more features I discover. The built in switching power supply that can convert 0.5V to 3.6V input voltage to 1.7V to 5V. Fantastic! So you can make a circuit that can run of a single NiMh AAA cell. I assume you can also use the output voltage to power the rest of the circuit as well.Definitely, the PSoC 4 is very interesting. The bottom end of the range does not have the programmable logic, so it will be the mid-range ICs that I will have to try out.

author: kripton2035
author_rank: Super Contributor
timestamp: May 11, 2013, 02:00:33 pm
content: to discover the psoc4 you have the pioneer kit @ $25 ...http://www.cypress.com/?rID=77780

author: TerminalJack505
author_rank: Super Contributor
timestamp: May 11, 2013, 02:17:58 pm
content: Quote from: kripton2035 on May 11, 2013, 02:00:33 pmInteresting. Looks like they're directly targeting the hobbyist market with that kit. I'll have to pick one up next time I place an order for components.

author: Spikee
author_rank: Frequent Contributor
timestamp: May 11, 2013, 09:08:15 pm
content: I just bought the last pioneer kit from Mouser.I will make a video when it arrives in a few days to evaluate it.The system on chips seems awesome and the M0 serie is also pretty cheap compared to the normal 8 bit atmel chips.

author: edavid
author_rank: Super Contributor
timestamp: May 21, 2013, 07:13:29 pm
content: Is anyone selling the PSoC Pioneer kit with free shipping? (In the US)

author: Harvs
author_rank: Super Contributor
timestamp: May 22, 2013, 12:00:41 am
content: For those in Oz, element14 now has the pioneer in stock (they didn't when this thread started.) $31.50 + GST.The CY8C4245AXI-483 looks like the only psoc 4 device they've got so far in stock (but it's still an interesting device.)I'll have to grab a board next order I have with them.

author: andyturk
author_rank: Frequent Contributor
timestamp: May 22, 2013, 12:13:43 am
content: There's not much information, but this looks interesting:PSoC5LP POPULTD DEVELOP BOARD

author: FrankBuss
author_rank: Unknown
timestamp: May 22, 2013, 12:41:53 am
content: Two years ago there was a contest with some interesting ideas:http://www.cypress.com/?id=3312The winner project was a mixed analog-digital scope:http://www.cypress.com/?id=3312&conID=235I was at least one of the 100 people who made it into the contest with my idea and I got a free developer kit and free engineering samples of the chip for my own PCB. I was in the final contest phase with this project:http://www.frank-buss.de/MultiLogger/index.htmlStill work in progress, when I have some more spare time, but it can already measure multiple analog voltages and temperature, save it on SD card, transfer to a PC and with capacitive touch buttons, all controlled from the PSoC chip. The interesting part was the voltage divider for the analog inputs for different ranges, which I've done with the analog building blocks of the PSoC and which required just some external resistors, all the rest was in the PSoC. But the integrated OpAmps are not the best.

author: andyturk
author_rank: Frequent Contributor
timestamp: May 22, 2013, 01:03:21 am
content: FrankBuss,Springs for CapSense? Wow, that's neat! How would you fix the layout issues?Also, what didn't you like about the internal op amps? Too much offset error?

author: FrankBuss
author_rank: Unknown
timestamp: May 22, 2013, 07:00:15 am
content: Quote from: andyturk on May 22, 2013, 01:03:21 amThanks, but not my idea, described in this nice Cypress app note:http://www.cypress.com/?rID=48787I don't know how to fix the layout problem, I'm more a digital guy, maybe I just replace it with normal buttons. Was interesting to try cap sense, and looks like magic if you touch just the case, but after all I think I prefer normal buttons.QuoteYes. First I tried an internal PGA for amplifying the input voltage, but at high gain it was not precise enough. I was able to modify it with two of the analog muxes and external resistor networks, which worked well.

author: jmole
author_rank: Regular Contributor
timestamp: May 24, 2013, 06:19:34 am
content: Wanted to chime in RE: PSoC 4.One thing you all should know is that the PSoC 4 has pretty limited resources compared to PSoC 3/5.For example, with PSoC 4, you only get 4 digital blocks compared to 24 in PSoC 5. Compare the datasheets before you buy. There are tons of differences.

author: mkissin
author_rank: Regular Contributor
timestamp: May 25, 2013, 02:15:48 am
content: Quote from: jmole on May 24, 2013, 06:19:34 amI'm hoping that's because they have only released the two cheapest variants (the 4100 series has no UDBs!). There are two more variants which are listed as "coming soon" which will hopefully have more blocks in them. I'll be very disappointed if they top out at 4 blocks.

author: fuffkin
author_rank: Contributor
timestamp: May 25, 2013, 01:21:57 pm
content: I've been using PSoC's for many years and have used them in several products. The ones I've used are PSoC 1's and where they really score is the integration of the analogue devices - which when the PSoC 1 came out (around 13 years ago) was totally unique, eg DAC's, op-amps, comparators. You can also form things like multi-stage low-pass and high-pass filters, so you can have a DAC which then feeds into filtering, that you can change the characteristics of dynamically, all on the chip.For real-world applications I've used PSoc's in sound generators and oodles of high-power LED drivers - you can integrate programmable constant current generators and also generate supply voltages etc. I've often used them as companion chips to PIC's that control them over I2C. You in effect, make your own custom ASIC with them.I think the PSoC 4 is a very impressive family of devices (I never really "got" the PSoC 3 or 5). They are low cost, low power and low pin count. Next time I feel the need to reach for a PSoC, it'll be the PSoC 4 from now on.

author: miguelvp
author_rank: Super Contributor
timestamp: September 06, 2014, 10:31:30 pm
content: I'm resurrecting this thread, since I recently started to play with my dormant PSoC kits.So I hooked it up and got the sample code straight from the IDE and got it all set in no more than a couple of minutes.I did change the Constant Current to 7 bit mode since it seems more accurate than the 8 bit one but I'll give that one a try later.Here are the results:Code:Constant current mode. 7 bits 0-152.4 uA range 1.2 uA increments.000000.00 +- 0.00uA001001.17 +- 0.02uA002002.42 +- 0.02uA003003.65 +- 0.02uA004004.91 +- 0.02uA005006.13 +- 0.02uA006007.36 +- 0.02uA007008.57 +- 0.02uA008009.80 +- 0.02uA009011.00 +- 0.02uA010012.22 +- 0.02uA020024.55 +- 0.02uA030036.73 +- 0.02uA040048.75 +- 0.01uA050060.83 +- 0.01uA060072.94 +- 0.01uA070085.13 +- 0.01uA080097.32 +- 0.01uA090109.46 +- 0.01uA099120.42 +- 0.01uA <- pictured100121.62 +- 0.01uA110133.87 +- 0.01uA120145.93 +- 0.01uA127154.47 +- 0.01uA but this one driftsSo it's pretty accurate and linear other than it's 1.2163 uA increments and it seems more stable in the upper range.It does have constant voltage mode too, but I'll play next with the 8 bit constant current to compare it to these results.Picture when set at 0x63 (99) It was supposed to be 100 but that was giving me 121.62uA

author: miguelvp
author_rank: Super Contributor
timestamp: September 06, 2014, 11:23:19 pm
content: As suspected is a bit more jumpy and where I put 0.01uA is probably 0.015uA because some times I hit places that it doubles the error.So In 8 bits the increments are smaller than they are supposed to be1.1726uA instead of 1.2uAAlso in 8 bits it seems less linear.Code:Constant current mode.8 bits 0-306 uA range 1.2 uA increments000000.00 +- 0.00uA001001.06 +- 0.02uA002002.23 +- 0.02uA003003.39 +- 0.02uA004004.65 +- 0.02uA005005.80 +- 0.02uA006006.98 +- 0.02uA007008.14 +- 0.02uA008009.29 +- 0.02uA009010.45 +- 0.02uA010011.62 +- 0.02uA020023.35 +- 0.02uA030035.06 +- 0.02uA040046.87 +- 0.01uA050058.56 +- 0.01uA060070.28 +- 0.01uA070082.06 +- 0.01uA080093.81 +- 0.01uA090105.53 +- 0.02uA099116.15 +- 0.01uA100117.26 +- 0.02uA110129.06 +- 0.01uA120140.67 +- 0.01uA127148.93 +- 0.01uA130152.38 +- 0.01uA140164.18 +- 0.01uA150175.79 +- 0.02uA160187.58 +- 0.01uA170199.22 +- 0.01uA180210.7 <- DMM Range changed.190222.5200234.3210245.9220257.8230269.5240281.1250292.8255298.8Edit: In the 0-612uA range at 2.4 steps it's stepping at around 2.30 and 2.34single data point using 255 give me 597uA output instead of 612uA

author: miguelvp
author_rank: Super Contributor
timestamp: September 06, 2014, 11:43:33 pm
content: Also I want to note that I'm using the Pioneer as a full programmer debugger as I posted here:https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/msg507751/#msg507751$25 programmer/debugger/devkit and $4 breadboardable prototype kitEdit: fixed linkNext Constant VoltageBut since the VDAC8 is only available for the PSoC 3 and 5LP then I will have to use this:http://www.element14.com/community/thread/27064/l/idac-conversion-to-vdac-enabling-two-idacsBTW for anyone that wants to use C++ instead of C here is a link:http://mbedded.ninja/programming/microcontrollers/psoc/using-cplusplus-with-psoc-creator

author: nuno
author_rank: Frequent Contributor
timestamp: September 07, 2014, 01:57:31 am
content: I think both IDACs on PSoC4 are quite "synched", that is, they "drink" from the exact same ... reference or whatever (can't explain this). I did the triangle wave generator below, analog ramps, all hw with only 1 external capacitor, using 1 switched IDAC that sinks at twice the rate that the other sources. No changing offset, so I assume both IDACs source/sink exactly the same current...This circuit can easilly do 1MHz triangle wave, although with some offset and at a low Vpp of 0.48V; check the wave at WaveOut and TClk @ 1MHz (the IDAC comutation point can be seen).I did this as an introduction design on PSoCs. Before this design I started with another one that used a little more hw and needed the CPU intervention to switch the wave growing direction. This limited the upper frequency at 245KHz, having the CPU on almost 100% usage. After thinking some more about this I reached this all-hw solution. I think a lot of juice can be extracted from this hw.I find it odd that in this thread there was just a small mention of how the PSCoC Creator IDE is good. Damn, it is good, you guys have to try it. And, to my interpretation of the license, there isn't any kind of fee or limitation attached, you can even use it to develop commercial products. PSoC 4 is currently and by far my ARM of choice (the prototyping kit is damn cheap too).

author: miguelvp
author_rank: Super Contributor
timestamp: September 07, 2014, 03:40:52 am
content: Nice, I think I'll try that, thanks!I'm still going through their samples from the IDE, so how about a voltmeter?The sample also converts the analog die temperature to digital.Voltage is using their internal 1.024V reference.The standing board has two pots, one I'm using for the display contrast, the other for the voltage dial.For the constant voltage I need to solder the other male headers because the opamps are on the other side, and that means redoing the jump wires as well (simple since they just need to be moved to the other side and move the display more to the left, maybe tomorrow.

author: kripton2035
author_rank: Super Contributor
timestamp: September 07, 2014, 12:15:10 pm
content: I've got some psoc4 at cypress store for $1 each...http://www.cypress.com/events/?event=psoc4promotion&utm_source=Homepage&utm_medium=Banner&utm_campaign=PSoC4USD1

author: dannyf
author_rank: Super Contributor
timestamp: September 07, 2014, 01:20:40 pm
content: QuoteThey are unlike your typical mcus in a few important regards:1) user programmable parts: those are essentially mcu + cpld (analog+digital). They are highly user configurable. Your imagination is really the limitation as to what they can do - the number of such blocks is limiting on those parts, however;2) programming interface: rather than writing code, the programming interface is mostly a drag-and-drop. I happen to think that's the future of the mcu programming - Cypress is light years ahead of its competitors (ST/Micro/Atmel/NXP, maybe on par with Freescale), and even Keil / IAR in terms of providing an excellent graphical programming interface.3) very flexible remappable pins: this is one step ahead of PIC24's remappable pins - which I considered the best implementation.However, it has some severe limitations:1) the reliance on vendor toolchains: the primary programming interface is PSoC Creator. It doesn't support programmers like jlink. You can export the designs to Keil / IAR (which do support jlink) but Keil / IAR doesn't support the graphical interface. So if you use jlink, you have to go back-and-forth between PSoC Creator + Keil/IAR.2) it is very difficult to code those things natively in Keil / IAR: there is no device header file provided through Keil / IAR. The only way for you to code is to create your own header file, or create a generic PSoC Creator project with all the features and export it to Keil / IAR.3) limited user base;4) limited number of user configurable blocks in the 4100/4200 devices. If they had 6 or 12 such blocks, it would have been superb.It is a very promising product. Hopefully Cypress will continue to enhance it. But I wouldn't jump in right now. I think they are a generation or two away from going big / mainstream.

author: andyturk
author_rank: Frequent Contributor
timestamp: September 07, 2014, 03:54:40 pm
content: Quote from: dannyf on September 07, 2014, 01:20:40 pmJust to add some color...PSoC Creator ships with a GCC 4.7.3 toolchain. There's nothing really special about it. When you press the "Generate Application" button in Creator, it produces all the code necessary to configure the chip and run your application. At that point, you can compile it with any toolchain.Since most of my development happens on a mac (and I'm alergic to IDEs), I run PSoC Creator in parallels and point it at a directory that's shared with OS X. Compiling, flashing and debugging all happen from OS X. Using the segger is a real win here because it's about the only jtag/swd probe other than Cypress' that knows how to flash the PSoC chips.The code generated by Creator is generally very nice. If Cypress' API works for you, then it's very easy to get stuff done. However, if you need to go around their generated code and talk to the hardware directly, it's a big step up in complexity and there's not a lot of documentation (other than reverse engineering the generated code).

author: tszaboo
author_rank: Super Contributor
timestamp: September 07, 2014, 04:05:12 pm
content: Quote from: dannyf on September 07, 2014, 01:20:40 pmThis, and I don't get what is so superb about them. The Psoc3 has a slow 20 bit ADC, but it is cheaper to just use an external, the Psoc4 has up to 32 macrocells. So I can make a 32 bit counter in itOr I can make PWM with it, which is already there in preatty much anything. The 8 bit DAC and 12 bit ADC is not enough for any application I'm looking for, ADCs and DACs start at 16 bit.And we have 2 communication interfaces, which you can set to anything... except any ARM will have all 4 of it for the same price.The only exceptional thing I see here is the 5V and the pin remapping. If there would be some real decent hardware built in, maybe, but it looks like to me that they just didnt add enough precision and size for anything useful.

author: FrankBuss
author_rank: Unknown
timestamp: September 07, 2014, 04:28:39 pm
content: Quote from: andyturk on September 07, 2014, 03:54:40 pmI did this once:http://www.frank-buss.de/rs232toi2c/Was not too difficult, all registers are documented in the Technical Reference Manual (TRM).

author: dannyf
author_rank: Super Contributor
timestamp: September 07, 2014, 04:30:21 pm
content: QuoteI think you have laid out a convincing case that the chip is not for you.However, the fact that it is not for you has zero bearing on if it is not for the rest of us.It doesn't take a rocket scientist to understand that, right? Even a geologist should see through that.

author: dannyf
author_rank: Super Contributor
timestamp: September 07, 2014, 04:41:20 pm
content: QuoteIt is not if you stay with Cypress tools. Yes, if you don't.QuoteFor example, where is GPIO_PRTx_DR register in that manual?I suppose that there is a header file somewhere in Creator but why cannot they just provide that to everyone?

author: dannyf
author_rank: Super Contributor
timestamp: September 07, 2014, 04:46:55 pm
content: I found it - it is in the register TRM. there is also an architecture TRM.How about a header file with all the definitions / addresses?

author: nuno
author_rank: Frequent Contributor
timestamp: September 07, 2014, 05:09:08 pm
content: I didn't check but the header file probably exists. There are (or were, it's been a few months) some CSD registers missing from the register TRM of the 4200, but they are used in the code generated by the IDE, and all by name including bit definitions. I needed to do some agressive code optimization on the 1st design of the triangle wave generator, and I just took a look at the code they generated and optimized it to my case. The code they generate is not very worried with performance, but has the advantage that you can easilly see how to configure the registers.There are some minor issues with the build which I have reported to them:1) In the prototyping kit you need to link with a library which has the bootloader. It happens that for some reason the IDE always re-builds the .a lib (not the entire library, just the final .a). This leads to your project being re-linked again.2) Their "clean" is not an industry standard clean. They won't delete all the generated code, leaving *a lot* of generated files behind. They justify this by saying the user may have modified them, I don't think it is a good (nor acceptable, actually) reason. A "clean" is supposed to clean everything. If generated files may be modified, there should be some other mechanism to deal with this (like user should rename the file and make it an own file).

author: Corporate666
author_rank: Unknown
timestamp: September 07, 2014, 05:43:53 pm
content: Quote from: NANDBlog on September 07, 2014, 04:05:12 pmThe PSoC has it's place, but to say it's not big or precise enough for anything useful is silly. In the PSoC 3 and 4, you're talking chips in the $1-4 range. A 12 bit ADC is pretty good, especially considering you can configure the additional blocks for whatever you like. If you need a fast ADC of more than 20 bits, then you're not going to be looking at $3 MCU's to have it built in anyway.With most chips, you figure out the peripherals you need and then buy the cheapest chip which has those peripherals, and almost always you end up with stuff you don't need and won't use. With the PSoC, you buy a chip with a big enough configurable logic to fit the peripherals you need. I've got projects with dozens of PWM's, others with lots of ADC channels, others with stuff built in programmable logic that would be lots of code in other chips (like drivers for WS2812 LED's, signal decoders, etc).They are amazingly versatile and useful chips. But if you are going to compare one feature of the $3.50 PSoC3 to a $20 dedicated chip and call the PSoC too weak to do anything useful, then pretty much everything made by Microchip, Atmel, ST, Cypress, NXP and TI is useless also, because dedicated single chips exist which do one thing better (at 10 times the price).

author: Corporate666
author_rank: Unknown
timestamp: September 07, 2014, 06:04:36 pm
content: Quote from: AcHmed99 on September 07, 2014, 11:43:46 amI'm not sure what is up with Digikey pricing, but you're better looking right at Cypress.com. The most expensive 12Mhz chip is the CY8C29466 which ranges from $4.03 to $5.29 depending on the package you order. The 29466 range is their "biggest" PSoC1 series chip with 16 digital blocks and 12 analog blocks and the most RAM amongst the PSoC1 series.Honestly, there really isn't much reason to be using PSoC1's at this point... they are old tech, superseded in price, performance and capabilities by the PSoC3 and PSoC4. Plus you have to use the old IDE and toolchain. Better stick with PSoC3/4/5. But for reference, the chip you mentioned - the CY8C27443 is $3.99 on Cypress' website.I think they are very price competitive with other solutions. Looking again at the Cypress website, the PSoC 4 CY8C4245AXI-483 is $1.92 and runs at 48Mhz, has 4 programmable digital blocks in addition to 2 built in dedicated communications blocks (for SPI/I2C/UART) and 4 timer/counter/PWM blocks, programmable op-amps/comparators and a 12-bit ADC and two DAC's and has 32k of flash and has capsense and 36 GPIO's.I think that's pretty good for less than $2.On the cheap end, they also have a PSoC 40000 series for $0.29 with an ARM M0 core, 8k of flash, 5 GPIO's (SOIC-8 package), a serial communicaton block and a timer/pwm/counter block. That seems pretty competitive with what else is out there in the price range.

author: tszaboo
author_rank: Super Contributor
timestamp: September 07, 2014, 06:31:21 pm
content: Quote from: Corporate666 on September 07, 2014, 05:43:53 pmI never said that it should be compared with high end dedicated chips. I pointed out that 12 bid ADC is not enought because anyone makes 12 bit ADC in their MCUs. And making it 20 bit, and selling it for more than a MCU+20 bit ADC+ frontend is not cool. I guess indeed everything below Psoc 3 is legacy, and should be NRND. Either the price point has to be better or the functionality. The above mentioned CY8C4245AXI is doable with a STM32F030 and a LM358 (except capsense), yet it's price is triple of the above. And if you go higher, you are competing with Analog's ADUC7061 microcontroller for exampe: 8 KSPS 24 bit ADC+ 14 bit DAC for e dollar.You probably missed my point: I want them to succeed. There must be a change in the MCU market, because in the last few years only the clock speeds increased and the price and current consumption decreased. I like when they integrate stuff beyond the usual peripherals, but it needs to be competitive. I guess they realized it also, that is why they dropped the price from two something to one dollar for some chips.

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: September 07, 2014, 06:38:03 pm
content: I would genuinely be interested in finding out what the "natural" noise floor of the configurable analog fabric is. And is it the same across the whole psoc series? Is the 20 bit adc really 20 bits or is the enob something closer to 12?

author: dannyf
author_rank: Super Contributor
timestamp: September 07, 2014, 07:07:03 pm
content: Likely specified in the datasheet.I would guess that it is closer to 17/18 bits rather than 20 bits.Thar particular feature is likely to compete with F350 from Silabs.

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: September 07, 2014, 08:26:41 pm
content: Quote from: dannyf on September 07, 2014, 07:07:03 pmOK searching on cypress forums indicate that psoc 3 and 5 have been designed with lower noise than the others and that something like 18.5 bits should be attainable according to cypress applications engineer. However actual users report more trouble reaching that performance. The your mileage may vary quip applies even more profoundly if you are in charge of the analog routing, that makes whatever is printed in the data sheet hard to gauge.Back in the late 70's I believe Intel was the first one to offer a micro controller with on-chip ADC, an 8051 with 10 bit SAR. The Intel guy I talked to at the time said even 10 bits was hard to achieve and down played other manufactures announced offerings as fiction. Well he would, salesmanship to be expected.Looking at many of the 24 bit delta sigma ADC data sheets out there it seems that 22.5 bits enob is about the noise floor limit or wall for all mixed signal processes.Analogue Devices makes a cortex m3 integrated with a 24 bit ADC as another competitor to that scilabs part you linked:ADuCM36x

author: dannyf
author_rank: Super Contributor
timestamp: September 07, 2014, 08:45:26 pm
content: QuoteFor an outboard adc, the practical limit for most engineers is 16-bit adc. If you are really good, maybe 20bit. 24 bit adcs are reserved for the analog Gods,.Yeah, I think 18.5 bits are pushing the truth for most of us.

author: dannyf
author_rank: Super Contributor
timestamp: September 07, 2014, 09:00:24 pm
content: QuoteThat header file is cydevice_trm.h, generated by the Creator -> that sentence reads very religious,I assume that the Creator copied it from somewhere.

author: Corporate666
author_rank: Unknown
timestamp: September 07, 2014, 10:25:18 pm
content: Quote from: NANDBlog on September 07, 2014, 06:31:21 pmYou're proving yourself wrong. Yes, lots of companies offer 10-12 bit ADC's in their chips. So clearly 10-12 bit ADC's are useful amongst their customer base. They offer a 20-bit ADC in some chips which can also support dozens of PWMs or dozens of timers or counters or any other amount of configurable peripherals. Interesting you mention the ADUC7061. It's hardly a dollar... $8.27 on Digikey, 6 channel PWM, 14 GPIO's, only one UART/SPI/I2C interface, etc. By your logic, that chip is overpriced and useless because it can't support 30 PWM's whereas a PSoC3 can for less than half the price.In reality, every chip has it's target, and just like you wouldn't use a ADUC7061 if you need 30 PWM channels, you wouldn't use a PSoC3 if you need a 24bit ADC, just like you wouldn't use an Atmel XMega or a PIC16 for that purpose either. It doesn't make any of the aforementioned chips useless or overpriced or anything else. It means using them for something other than what they are intended for isn't as good as using something for what it was intended for.Gee, what a shocking revelation that is.

author: tszaboo
author_rank: Super Contributor
timestamp: September 12, 2014, 09:31:02 am
content: Wait, let me think about this. A psoc 4200 It has two communication interfaces. You can reconfigure them on the fly and assign it to any pin. Does this mean that you can re-configure it to SPI access a device, change it to I2C access an other one, and if you receive a RTS signal on the serial, you set it to serial to receive data? Hmm, interesting.

author: miguelvp
author_rank: Super Contributor
timestamp: September 12, 2014, 02:33:41 pm
content: I even think you can configure the pins to be hooked to the analog internals and time share the internal hardware. I'm going to play around hooking this to a DE0-Nano for heavy digital processing and back to the PSoC to make the processed data available to the Arm processor, and maybe some channel for video data back to the FPGA to drive a VGA monitor, should be doable.

author: Corporate666
author_rank: Unknown
timestamp: September 12, 2014, 07:50:43 pm
content: Quote from: NANDBlog on September 12, 2014, 09:31:02 amAt the first PSoC training seminar I went to, one of the big topics was dynamic reconfiguration of the device. In PSoC Designer, you could have multiple configurations and just switch between them on the fly, essentially multiplexing the chip's resources:http://www.cypress.com/?rID=2901AFAIK, this is still possible with the PSoC3/4/5, because ultimate the chip is configured by writing configuration registers, but it's no longer built into PSoC Creator, mostly because it is not often used or needed.In the seminar, the example given was a transmitter/receiver. The chip could be configured with a hardware decoder for the incoming signal, for example. Then the chip could be reconfigured for an encoder and transmit through the same UART (for example). By putting it all in hardware rather than software, it frees up software resources and programming hassle.

author: miguelvp
author_rank: Super Contributor
timestamp: September 12, 2014, 08:24:35 pm
content: They have digital and analog multiplexers that will allow you to do that.On the analog multiplexer they have different choicesfor example there is a sequencer so you can just jump to the next, they do offer a get channel call to find out the current channel.They have a hardware one too that the channel is selected input pins, not sure if I could drive the pins by software.Anyway, you can use those to route the limited resources to different input/output pins.

author: miguelvp
author_rank: Super Contributor
timestamp: September 13, 2014, 05:45:32 am
content: Quote from: miguelvp on September 12, 2014, 02:33:41 pmOld Altera paper that uses the old SOPC (now QSys) but should still be applicable.Interfacing an External Processor to an Altera FPGAhttp://www.altera.com/literature/hb/nios2/external_processor_if.pdfIt shows architectures using the Avalon system interconnect fabric but also suggests that you can roll your own Verilog or VHDL without the SOPC (QSys) nor AvalonAs for interfaces via SOPC (QSys) it shows what protocols are available as processor interface solutions:RapidIOPCI ExpresPCIPCI LiteSPIAlso they offer a partial list of peripheral interfaces available for the SOPC builderCANI2CEthernetPIOSPIUARTUSBPretty much you instantiate an Avalon Master interface component that talks to the processor using one of the protocols above to access the resources available to the FPGA. No sample code but lots of links within the document that might provide some code. Not sure.What they mention is that PCI Lite and SPI don't require an OpenCore Plus license.SPI looks like a sensible option too:Towards the end it also suggest building a custom bridge to communicate with an Avalon slave interface for a custom FPGA component.I think I'll try the 1st approach one because Qsys and the whole Avalon signal interconnects give me a headache.But I do like the last one to enable access to the DE0-Nano memory via the FPGA (as in a frame buffer), but I'm still trying to get my head around the Avalon system, but I keep revisiting often and one of these days it will click. I think I'm pretty close to that moment.

author: miguelvp
author_rank: Super Contributor
timestamp: September 18, 2014, 05:33:42 am
content: I didn't get to the FPGA PSoC yet but today I found a little SOIC 0.65 pitch board so I used one of my 4200 SSOP 28 pin chips. I bought 10 SSOPs 10 QFPs and 20 QFN while they were (and still are) a dollar a pop.I also had some 0805 caps so I put it together with the headers and bypass caps.With the bypass you can feed VDDD from 1.8V to 5.5V and get regulated 1.8V out of VCCD.Edit: I used TDK 1uF 25V (C2012X7R1E105K125AB $0.037 qty 100) and Syfer 0.1uF 50V (0805J0500104KJT $0.055 qty 100) both 10% that I got from Mouser.Here is how I wired it up and feed it 3.39V coming from the Pioneer that, also connected the SWD clock and IO as well as the /XRES and ground.The internal regulator is outputing 1.7985V. Well within the range of 1.71 to 1.89 V (1.8 ±5%) if I didn't bypass VDDD and VCCD and shorted them that's the regulated external supply you have to give it, but 3 tiny caps and it's happy from 1.8V to 5.5V.I powered it up and launched Creator and made a blinky which took no time because I just told it to do the example and just wired the led to a pin that I could use.The programmer didn't show the board at the beginning it just showed a cortex m0 and that's it but once I click on the Port Acquire on the kitprog it saw the target chip just fine.pressed program and:Sorry about the flux mess, I don't have anything to clean it with, I couldn't find my kester flux pen so I used some rosin flux.So from begin to end took me 15 minutes to put the board together and less than 2 to wire it up and program it.So I guess this is the $1 one minute PSoC versionWell more than one dollar, maybe $4.But this is an FPGA of shorts, actually you can program your own Verilog based custom components or you can use schematic, no VHDL thoughPlus it has the analog as well since its a 4200Edit: Consumption5 mA removing the LED13.5 mA with the LED while the LED was on 5 mA when it was off.Edit: I forgot, it does have a Sleep, Deep Sleep, Hibernate and Stop Mode (all resumable and different power consumption.Sleep 1.3 mADeep Sleep with 1.8 to 3.6 V input: 1.3 uADeep Sleep with 3.6 to 5.5 V input: 15 uAHibernate: 150 nAStop: 20 nAHibernate and Stop can be woken up with a GPIO pin.

author: miguelvp
author_rank: Super Contributor
timestamp: October 01, 2014, 05:51:43 am
content: So on the thread "One Dollar One Minute ARM Development" it was misunderstood how the $4 PSoC® 4200 Prototyping Kit (CY8CKIT-049-42xx) can be used as a programmer.Thread:https://www.eevblog.com/forum/microcontrollers/one-dollar-one-minute-arm-development/msg521972/#msg521972$4 Programmer Project (needs to be recompiled or it might brick your prototype board):http://www.cypress.com/?rid=92146So I'm going to explain in here all the steps needed to program a virgin CY8C4245PVI-482 28 pin SSOP chip with one of those $4 breakout boards as described in the cypress link.First we need to wire things up.Here is how I'm wiring the board (because the camera angle the pins don't quite correspond to the breadboard the farther you are from the center of the picture, so I added extra lines to show where in the boards they connect).Also I included the internal wiring of the target board with decoupling caps so that it can use the internal voltage regulator and accept an input from 1.8V to 5.5V. I used TDK 1uF 25V (C2012X7R1E105K125AB $0.037 qty 100) and Syfer 0.1uF 50V (0805J0500104KJT $0.055 qty 100) both 10% that I got from Mouser.I used a 470 Ohm resistor to protect the LED because it was just there in my desk.SSOP pinout:Here is the actual wiring with jumpers.First we are going to create and compile a blink program that we will program into the target board.I'm using PSoC Creator 3.0 SP1.1) Create New ProjectFile->New->Project2) Select Empty PSoC4 Design and name the project Blinky, expand the Advanced dropdown menu, change the device to CY84245PVI-482 and Click Ok.3) Add a digital output pin by dragging it from the component catalog.4) Right click on the new pin, rename it to Pin_Blue, clear the HW Connection checkbox and click OK.5) We want pin P4 to drive the LED, so we assign it like this:6) Add the LED blinking code into main.cCode:Pin_Blue_Write(~Pin_Blue_Read());CyDelay(500);7) Compile the program.8 ) When done click on the Results tab, open the Blinky.hex file, hover over the label to find out where the output ends up. We are going to need this file to program our target board. You can right click on the tab and open the containing folder as well.Next we need to download and compile the bootloadable 4 dollars programmer project.

author: miguelvp
author_rank: Super Contributor
timestamp: October 01, 2014, 05:52:50 am
content: Here we are going to configure the programming computer (windows based) to configure the CY8CKIT-049-42xx with a bootloadable (meaning it can be reprogrammed back with another bootloadable firmware) project that will enable you to program an external PSoC board, in this case a CY8C4245PVI-482 28 pin SSOP chip.1) Go tohttp://www.cypress.com/?id=4&rID=98796and download the "4 dollar programmer.zip" project.2) Unzip the project (it doesn't create the directory so you want to use "Extract to 4 dollar programmer_001-93541" (I use WinRaR)3) go into the extracted folder and you'll see a "PSoC 4 Firmware.zip" archive, this one will create the folder so use "Extract Here"4) Navigate to UART_SWD and you'll find a PSoC Creator project named "UART_SWD_Bridge.cywrk", double click on it to open it. (I'm using PSoC Creator 3.0 SP1)5) A prompt will pop up saying that the project contains special code that runs on your computer and do you trust the source of the project etc.. click Yes.6) The Component Update Tool will show next asking to update the obsolete components. Uncheck the Archive before commiting checkbox and click on Next this will change to Finish so hit Finish as well.7) The project is already targeted for the CY8C4245AXI-483 chip that is in the CY8CKIT-049-42xx prototype kit.But you should double click on main.c and change the "#define SCB_UART 1" to "#define SCB_UART 0". If you leave it as 1 it will work too, but it's preferable to use the UDB UART since we the prototype kit uses a 4200 chip.Edit: Nope leave it alone as 1, the comments are wrong, If you already changed it and programmed it, you can change it back to 1 and reprogram the board.8 )After changing the 1 to 0Click on the Build project button, it will compile giving you 2 warnings and one note, just ignore those.9) Time to power up the prototype kit into bootloading mode, for that you press and hold the user button while connecting it to your computer's USB, you will see the in board blue LED flashing fast (about 3 times a second) that indicates that is ready to be programmed.10) Click on the Results tab and double click on the UART_SWD_Bridge.cyacd file to locate where is at. Alternately you can right click on the tab and select "Open Containing Folder"In my case is at "D:\projects\Cypress\4 dollar programmer_001-93541\PSoC 4 Firmware\UART_SWD\UART_SWD_Bridge.cydsn\CortexM0\ARM_GCC_473\Debug"11) Go to Tools->Bootloader Host and under file navigate to where the UART_SWD_Bridge.cyacd file is located, Select the boot loader serial port (you would have to had install the drivers prior to this), leave the port configuration as the default. The light in the board is still blinking fast so hit the Program button (the blue arrow pointing down)12) The light will stop blinking and show solid blue, and the protoboard is ready to program your external board.Continued on the next post.

author: miguelvp
author_rank: Super Contributor
timestamp: October 01, 2014, 05:53:46 am
content: Time to actually program the external board.But first we need to setup Python 2.7 and PySerialhttps://www.python.org/download/https://pypi.python.org/pypi/pyserial1) Once you have that setup, locate the python script, in my case is at "D:\projects\Cypress\4 dollar programmer_001-93541\Python Programmer.py" and right click it and select the "Edit with IDLE" (I took the image from the project website because I can't do an Alt-PrtScr preserving the drop-down.2) Change the COM port to the prototype UART port, in my case is com83) Change the hex file from Part 1 to upload into the external board, in my case it's here:"C:\\Users\\Miguel\\Documents\\PSoC Creator\\Blinky\\Blinky.cydsn\\CortexM0\\ARM_GCC_473\\Debug\\Blinky.hex"Note you have to escape the back slashes within the string.4) Make sure you have closed the "Bootloader Host" from where you programmed the prototype board, or it will interfere because it's still connected to the COM Port. Also it won't hurt to power cycle the prototype board.5) The moment of truth, in IDLE press F5 or select Run->Run Module. A Python Shell with show up spewing a bunch of numbers, it's not the fastest programmer but it will get it done.I took that image from the project page as well.While is programming you will see the prototype board built in LED blink really fast as t's writing data to the external chip. If it's solid then it's not programming at all. (it's more a flickering than blinking because it's doing it at 115Kbps).You can experiment with the code to optimize it, since it programs the whole thing regardless of the size of the program.Other things to try is to export the project to kiel and then use uVision to program the chips, not sure what programmers are supported.The result:

author: miguelvp
author_rank: Super Contributor
timestamp: October 14, 2014, 04:25:14 am
content: So today I decided to export a PSoC creator project to Keil and I was greeted by a nice surprise:Of course I did press the install,even if I don't have a miniprog3 I was thinking that maybe I can modify the kitprog that I use on my Pioneer to make a full programmer/debugger for Keil as well.So on the export it asked me if I wanted to open the exported project with keil, so I went ahead with it.I looked in: Project->Select Device for Target...And selected my chip, it defaulted to Generic CPU Database either clicking ok in there or selecting PSoC devices the target chip was already selected to the one I used in the PSoC Creator project.Then I went to: Flash->Configure Flash Tools... then to the Utilities Tab.There I selected the Use Debug Driver.Then to the Debug tab and selected use (instead of use simulator).The drop down debugger selection had the MiniProg driver on it so I selected that one.Then I clicked on Settings, thinking the KitProg wouldn't be there because it expects a MiniProg, but...There it was KitProg listed and the full port configuration all set and unchangeable, clicked on the detected device and clicked on Port Acquire, even if I don't know if I need to do that.Ok and Ok to save the settings, saved the project and restarted Keil just to make sure it all took in (yeah I'm paranoid)Restarted it again, checked everything was still set as I left it, compiled the code and then selected: Flash->DownloadSure enough it programmed my device and I saw the LED blinking happily.Done? nope, gotta try to debug it. So: Debug->Start/Stop Debug Session (or Ctrl+F5) and...No problem since the PSoC 4 only has 32K of programmable memoryClicked OK and...It programmed it and stopped in the for loop since I had Run to main() selected in the debugger options.So there you have it a $25 dollar PSoC programmer that also works with Keil uVisionEdit: If you don't want to modify the Pioneer KitProg to program an external PSoC, you can still use the updated KitProg and use Keil uVision to program and debug the built in PSoC 4200 chip in the Pioneer itself.

author: mrflibble
author_rank: Super Contributor
timestamp: October 15, 2014, 10:21:02 am
content: Nice, thanks for sharing.So this magic combo works with an evaluation version of Keil? Because if so, that's good to know for future psoc playing around and the inevitable installfest.

author: miguelvp
author_rank: Super Contributor
timestamp: October 15, 2014, 02:22:21 pm
content: Yes it's the evaluation version of Keil, I think that's why the assembly instructions only show 0's and the 32K limit for debug, which is what the 4200 limit is currently at.To be honest I rather stick with PSoC Creator, it's more functional to me. But it's nice that it supports any toolchain, including GCC or ARM's version of GCC.Edit: But if you are going to use the UDBs I looked more into it and they get configured with a prepared table and location list before calling main. I guess we can figure out the addresses and what values do what for the interconnects, or just generate the table in PSoC creator first

author: mrflibble
author_rank: Super Contributor
timestamp: October 15, 2014, 02:53:55 pm
content: Quote from: miguelvp on October 15, 2014, 02:22:21 pmAlways nice when there are a few options. If for no other reason than to havesomeway of sanity checkingifwhen your main dev environment is giving you trouble with one thing or another. And good to know that you can plug in gcc if you want to.QuoteThe configurable logic bits can be described using verilog, right? Or am I misremembering that from earlier on in this thread? If it is anything like schematic entry for regular fpga, then it is probably fun and easy to start out with the pretty gui buttons. And then when you get the hang of it you use the boring textual description of your design.

author: miguelvp
author_rank: Super Contributor
timestamp: October 15, 2014, 03:20:31 pm
content: Quote from: mrflibble on October 15, 2014, 02:53:55 pmI didn't dig too much into this but you are right. You can create a component and then add Verilog code, they also have something called datapaths that programs the UDBs directly but I didn't play with that feature but watched a couple of videos and looks simple enough.Here is a link to a datapath configuration cheatsheet:http://www.cypress.com/?id=4&rID=77887Another related document of Q&Ahttp://www.cypress.com/?docID=31432

author: mrflibble
author_rank: Super Contributor
timestamp: October 15, 2014, 03:58:02 pm
content: Thanks. Noticed this one as well:http://www.cypress.com/?docID=42670It seems a bit like the UDB's are primitives which you can then instantiate in your verilog.Anyways, watching this one to get an impression:

author: miguelvp
author_rank: Super Contributor
timestamp: October 15, 2014, 04:53:09 pm
content: They have multiple ways to access the datapaths and using verilog and udb components or actually use their stand alone datapath configuration tool.More information here:http://www.cypress.com/?docID=49891Link came from the first link in here:http://www.cypress.com/?rID=69959

author: jmole
author_rank: Regular Contributor
timestamp: October 22, 2014, 03:03:10 am
content: Quote from: miguelvp on October 15, 2014, 04:53:09 pmThe new "simple" UDB editor is a great place to start creating your first UDB components. I was pretty overwhelmed at first, but eventually got the hang of it, and managed to configure a hybrid UDB/verilog component that drives TLC5940 LED Drivers. It's nice, because you can use the simplified UDB editor to get a feel for what the UDB does, then take the verilog code it generates and incorporate it into a larger component.Preliminary code/project file is up on github, but still needs quite a bit of work before it's ready for public use. I need to generalize it further to enable daisy-chained units, and add a Customizer GUI (perhaps the most difficult part of the PSoC Component workflow) to make it really usable.Preliminary code is here:https://github.com/jmole/PSoC_TLC5940

author: miguelvp
author_rank: Super Contributor
timestamp: October 22, 2014, 03:13:37 am
content: You should check Kees_library has a lot of goodies:https://github.com/EngineerBro/GlowTimeI'm trying this GlowTime project to drive a 32x32 panel but I I noticed his library and it's quite cool, so far I've used the KEES_PinHelper that if you name the pins certain way it assigns them directly, case insensitive too.So p0_0_blah will be assigned to P0 you can use P0_0_blah as well for the same result. Or you can do thispin_P0_0 for the same pin definition. Pretty handy.Also he has a lot of blocks on that community library and some PSoC Sensei blocks as well are in there.Edit: KEES stands for Chris Keeser (Cypress employee).PSoC Sensei is Brad Budlong (Cypress employee as well) I believe:http://www.cypress.com/?id=2401Edit2: hmm seems he has an interesting project here as well:https://github.com/EngineerBro/Carbon(quadcopter on PSoC 4?)