Author Topic: Cypress PSoC 5LP: CY8C58LP PWM Outputs  (Read 3742 times)

0 Members and 1 Guest are viewing this topic.

Offline picandmixTopic starter

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Cypress PSoC 5LP: CY8C58LP PWM Outputs
« on: May 14, 2017, 10:56:12 am »
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..

 

Offline r.vlad

  • Newbie
  • Posts: 7
  • Country: ro
Re: Cypress PSoC 5LP: CY8C58LP PWM Outputs
« Reply #1 on: May 14, 2017, 05:35:23 pm »
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.

vladradoiu.wordpress.com
 
The following users thanked this post: picandmix

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Cypress PSoC 5LP: CY8C58LP PWM Outputs
« Reply #2 on: May 14, 2017, 06:00:17 pm »
In the Resource section 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  :(
Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: picandmix

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Cypress PSoC 5LP: CY8C58LP PWM Outputs
« Reply #3 on: May 14, 2017, 07:03:01 pm »
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.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: picandmix

Offline picandmixTopic starter

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Cypress PSoC 5LP: CY8C58LP PWM Outputs
« Reply #4 on: May 14, 2017, 07:32:24 pm »
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  :)

 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Cypress PSoC 5LP: CY8C58LP PWM Outputs
« Reply #5 on: May 16, 2017, 10:20:25 am »
There is a very active well supported forum at Cypress.com for PSOC,
with a number of experts helping daily.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: picandmix

Offline picandmixTopic starter

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Cypress PSoC 5LP: CY8C58LP PWM Outputs
« Reply #6 on: May 16, 2017, 12:07:55 pm »
There is a very active well supported forum at Cypress.com for PSOC,
with a number of experts helping daily.


Regards, Dana.

Yes, thanks, have already found them and dozens of other videos, datasheets etc etc   

Received the board this morning and just starting to go thought the PSoC tutorials, seems a little bit different from Pic16F Assembly code !! :phew: :phew:  ;D

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  ;D
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Cypress PSoC 5LP: CY8C58LP PWM Outputs
« Reply #7 on: May 17, 2017, 04:36:54 pm »
Hopefully you tackle it with C as all the components you place
and use have a rich call library of C functions to control the
component. Virtually no more need to write drivers per se
unless you do a custom component, even then C largely
used.

Remember, almost all components have to have the
ComponentName_Start( ) called to make them run. Unless
you need to set component parameters in code the component
defaults to the ones you pick in its config wizard, shown in
menu when you double click component.



Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: picandmix

Offline picandmixTopic starter

  • Frequent Contributor
  • **
  • Posts: 395
  • Country: gb
Re: Cypress PSoC 5LP: CY8C58LP PWM Outputs
« Reply #8 on: May 18, 2017, 08:28:34 am »
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.  :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf