Cypress PSoC 5LP: CY8C58LP  PWM Outputs - Page 1
Forum section: electronics / general

author: picandmix
author_rank: Frequent Contributor
timestamp: May 14, 2017, 10:56:12 am
content: Hi,Being a basic 8 bit Pic / Arduino user, and having just looked at some of the documentation on the above chip / 5LP kit boards with its mind blowing array of functions, am just after a little help regarding the PWM and UDB operations, as have not yet been able to understand all the info in the datasheets.Am looking to run 16 outputs with a 16 bit PWM, all using the same frequency, say around 1khz, but each having its own independently controlled duty cycle; is this possible via the UDBs ?thanks in advance..

author: r.vlad
author_rank: Newbie
timestamp: May 14, 2017, 05:35:23 pm
content: I did a quick test in PSoC Creator, for the CY8CKIT-059 (CY8C5888LTI-LP097): I've added 8 PWM components (16bit UDB, 2 outputs each) and there are enough resources. You can write the compare value for each output/each component via the provided API functions to set the desired duty cycle.I recommend you add all the components you need in PSoC Creator and see the resource usage.

author: newbrain
author_rank: Super Contributor
timestamp: May 14, 2017, 06:00:17 pm
content: In theResourcesection of the datasheet, at page 44, there's a table reporting the consumption of a PWM component.For a 16bit, UDB based, PWM component two datapath cells are consumed, independent of the number of outputs, though the table does not clearly state.Since you have stated that all the PWMs have the same frequency, it's possible to use a dual output PWM fro a total of 8x2=16 datapath cells used and 16 independent outputs.This leaves a good amount resources free to add further logic and interfaces.PS: ninjaed by r.vlad

author: danadak
author_rank: Super Contributor
timestamp: May 14, 2017, 07:03:01 pm
content: Similar screenshots with some comments on resources at end of thread -https://www.eevblog.com/forum/microcontrollers/best-way-to-add-external-dacs/25/Regards, Dana.

author: picandmix
author_rank: Frequent Contributor
timestamp: May 14, 2017, 07:32:24 pm
content: Thanks all, very good of you to check out that it can do that pwm task, there is so much to learn about those chips and the PSoC Creator.Just hope I'm up to the task !? though it does seem an exciting challenge.Ordering a CY8CKIT-059 from Farnells tonight , so hopefully will be able to do some hardware testing on Tuesday

author: danadak
author_rank: Super Contributor
timestamp: May 16, 2017, 10:20:25 am
content: There is a very active well supported forum at Cypress.com for PSOC,with a number of experts helping daily.Regards, Dana.

author: picandmix
author_rank: Frequent Contributor
timestamp: May 16, 2017, 12:07:55 pm
content: Quote from: danadak on May 16, 2017, 10:20:25 amYes, thanks, have already found them and dozens of other videos, datasheets etc etcReceived the board this morning and just starting to go thought the PSoC tutorials, seems a little bit different from Pic16F Assembly code !!An email friend was also impressed by the looks of this 5LP board and his also arrived today, so will have someone direct to bounce off any little problems before bothering the forums.Though we are a right pair, I'm full of cold/flu and he broke his leg (tib) last night, so between us we might get past lesson one by midnight

author: danadak
author_rank: Super Contributor
timestamp: May 17, 2017, 04:36:54 pm
content: Hopefully you tackle it with C as all the components you placeand use have a rich call library of C functions to control thecomponent. Virtually no more need to write drivers per seunless you do a custom component, even then C largelyused.Remember, almost all components have to have theComponentName_Start( ) called to make them run. Unlessyou need to set component parameters in code the componentdefaults to the ones you pick in its config wizard, shown inmenu when you double click component.Regards, Dana.

author: picandmix
author_rank: Frequent Contributor
timestamp: May 18, 2017, 08:28:34 am
content: Thanks again.Its all going well testing out the basic functions one by one, lcd, rtc etc though more looking forwards to being able it fully utilize the advanced custom features of the UDBs etc.Was looking around the Cypress forum, and it looks like you are in there too as DaK ? so sure we will meet again.