Anonymous
Not applicable
Oct 28, 2014
03:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 28, 2014
03:29 AM
Hi all , i am working with PSoC 5LP. I have continious changable Analog Signals. I convert it to Digital with help of ADC. From this Result i want to generate PWM (Output1 Forwards, Output2 Ruckwards). All in 16-Bits. So i have range upto 65536. I have Analog Input 0,1 to 3,3v. So if i gave Input 1,6v than i have 50% Duty Cycle of generated PWM. PWM Basic Configuration: 16-Bit UDB PWM Mode: Two Outputs Period: 65535 CMP Value1: 32767 CMP Value2: 32676 CMP Type 1: Less CMP Type 2: Greater Dead Band: Disable Interrupt: None Clock with 12MHz freq. Here is the code. In ADC_Result i have 12-bit ADC result. From this result i want to generate 2 PWM Outputs. I know that i have to use WritePeriod(), WriteCompare(), WriteDeadtime() APIs. Code: int32 ADC_Result; uint16 i=0; int pwmValue, pulseWidth; int main() { // Start the components Sys_Init(); // CyGlobalIntEnable; // Uncomment this line to enable global interrupts. // Start Clock & PWM Clock_Start(); PWM_Start(); while(1) { pwmValue = ADC_Result // Which equation i have to use. PWM_WritePeriod(pwmValue); PWM_WriteCompare1(); } } I read the PWM datasheet & also check the Example PWM Programms but still i am much confsed for this following questions. 1. Need i Dead Band? 2. Which equation for converting ADC result into PWM? 3. Need i Interrupt/Global Interrupt ? Regards Shveta
Labels
- Labels:
-
PSoC 5LP
127 Replies
Attachments are accessible only for community members.
Anonymous
Not applicable
Nov 19, 2014
08:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 19, 2014
08:50 AM
Anonymous
Not applicable
Nov 20, 2014
03:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 20, 2014
03:03 AM
@Dana Give me ur Skype id. & tell me @ which time can me talk?
Anonymous
Not applicable
Nov 20, 2014
07:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 20, 2014
07:59 AM
@Dana give me ur Skype id.
Nov 20, 2014
04:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 20, 2014
04:58 PM
I am going to suggest you start a new post with the following -
1) Detailed specs
2) Drawing of overall application, by block or schematic, what you are driving externally
3) All relationships, eg. expected waveform vs V, described in math
4) Detailed timing diagram of desired waveforms
Get a set of fresh eyes, better than mine, to take a look at your needs.
Regards, Dana
Anonymous
Not applicable
Nov 20, 2014
09:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 20, 2014
09:33 PM
@shveta
It would be better to give the complete specification/requirement of your whole project, as the solution of one part would need to change if that is not applicable with other parts that people don’t know. So it is basically going in circles.
However, it should also be noted that people here are willing to HELP you and point you the direction/approach to solve your problem, not to SOLVE the problem for you. And I remember that in another forum, a teacher found that the student is asking people to fix the program and gave a warning to the student.
Anonymous
Not applicable
Nov 24, 2014
05:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 24, 2014
05:15 AM
@Dana I want to generate 1 PWM Signal with deadtime Input (A/D channel). PWM Clock freq. = 25 MHz Deadtime Value = 2 to 24 (0.5v to 3.25v) I am bit confuse that how can i get Ton & Toff, cloc k freq. How can i do this? pls help me.
Anonymous
Not applicable
Nov 24, 2014
07:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 24, 2014
07:15 AM
@Dana My Project is for implementing H-Bridge MOSFET.
Anonymous
Not applicable
Nov 25, 2014
03:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 25, 2014
03:57 AM
@Dana It was my mistake. Accually i Need only deadtime value as Input with vary Duty cycle, nothing is fixed. Now can upls help me for doing this. Regards Shveta