- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Shveta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shveta is starting a new thread as suggested, but still need the followings
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
Besides that, some times it helps to review what we know/don't know to move forward
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you read any information about deadtime and what it is for and why it is needed? So you would understand more about your project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1, Do you mean that you have to set the deadtime in steps of 40ns? ie the dead time (in ns) would be 210, 250,,, ?and no need to have dead time 220, 230...?
2. Do you mean that the frequecy of the Pulse is control by another analog pin? If so what is the range of frequency/period of the output.?
3. Do you have a flow chart or pseudo code to show what you have done or how you would write the program? No need to show the PSoC code yet and don't worry about the PSoC APIs yet.
4. how is the external hardware/wiring?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not quite easy as I understand: 40ns resolution are a frequency of 25MHz (1 / 40e-09). The clock frequency of a normal speed PSoC is 67MHz but should be set to 50 MHz, this will give the best resolution for 40ns steps.
So a value of 10 clock cycles is 200ns, 12 clock cycles give 240ns and so on. When you can live with this error of 10 ns you are fine off.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Bob
thank u very much bob.
But the Problem is how can i implement this in program ?
Regards
Shveta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As Bob says. What is the acceptable error of the dead time? ie Xns +-?ns or Xns +-%?
Also what is the relationship between the 2nd AD input to the output frequency? Is it a linear relationship to the input ? or the output is in steps, like that of the dead time? also what is the resolution required for the output frquency?
Don't jump to the implementation now. let's clarify the requirment first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@HL
Exceptable Error of the deadtime is Xns +-.
1st AD input to give PWM frequency & 2nd to give Deadtime.
Each n every inputed frequency i have to give all possible deadtime (from min to max).
So e.g frequency min. input = 0.5v for 250kHz then from 2nd AD input i set deadtime (from min to max).
So i think it's output is in input. We take output value of frequency as input for deadtime. So the output is in Step of the deadtime.
Requiered resolution for output frequency is 16bit.
Regards
Shveta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shveta, if it is easier for you to post in German language, I can translate for you.
In the table you provided in your first post: What units is the item "Output"?
Have there been any additional written instructions you have got?
You did not answer the question regarding the required precision of delta x (whatever delta x is)
What is delta x???? and what is x when there is a delta there should be at least two of those
As you can see is the input in V not linear, there are some "jumps" in it. Since there are only a few entries the easiest solution will be to build two tables that contain the required two values for the PWM: Frequency and delta x. or whatever is needed.
The index of the table will be calculated from your input voltage which seems to be in the range of 0.5 to 3.5 Volts. This would prohibit the usage of 3.3V as Vcc for the PSoC 5
As you can see there are some thoughts required before starting to program the first statement.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Bob
Sorry it was my mistake.
Delta x is the value of one single PWM wave with x1=on time & x2 = off time.
In table I wrote this value from the Oscilloscope.
Regards
Shveta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So let us discuss the first entry: Input = 0.5V; Ontime - Offtime = 210 ns WHAT IS THE "OUTPUT" = 4 ???
or
0.5V, OffTime - Ontime = 210ns?
As I tried to show you, the finest granularity is 20ns which signifies that it is impossible to have values like 210. Only 200 or 220 are possible, can you live with that?
Ah, slowly I get it, you have got two channels and the first signal is longer than the second and the second lies completely within the first. Right?
_____|--------------|______
_______|--------|_______
Can you sketch what delta x is and what "Output" = 4 is???
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To help you get acquainted to PWM, drop one onto your schematic window, give it a 50MHz clock and configure it as in the attached picture. Play with the Deadband Clock cycles and watch ph1 and ph2. Is that what you want? Any of ph1 or ph2 need to be inverted before brought out to a pin?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Bob hello,
I need for 0.5v input, Offtime-Ontime = 200ns.
ya..you are right. I have two PWM channels first is longer than the second & the second lies completly within the first.
Instead of 4 take 200ns min deadtime & 1µs max deadtime.
ya.. i need it. ph1 has On then Ph2 has Off & vice versa.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So your problem is solved: You can now buid a table which contains in terms of clock cycles
the deadband (2..256 = 40ns..5µs)
the period which always has to be greater than 2*deadband
When you measure your incoming voltage you only have to classify which of the table entries has to be used.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The PWM_Start() will override your settings you have done before
The comments for period and clock do not follow what you have set in reality
You do not change yet the dead-time value or period
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To get the value of the dead time you can
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. you should only use one of the three methods. not all 3. Pick one to use.
2. your program
if(Deadtime_Ans_Old <= 0.5)
{ Dead_Time = Deadtime_Array[0]; }
if(Deadtime_Ans_Old <= 0.5 && Deadtime_Ans_Old > 0.7)
{ Dead_Time = Deadtime_Array[1]; }
can you tell us what the higlited instruction is for? if th input is 0.6V, what would happen?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On line 78 you write
Deadtime_Ans1 = ADC_DelSig_CountsTo_mVolts( Deadtime_Ans ); // Convert A/D counts to mV equivalents
and later you use this value setting the deadtime
PWM_1_WriteDeadTime((uint8) Deadtime_Ans1 ); // Update PWM Deadtime value
There is no 1:1 relation between the mV and the deadtime. Thus the reason I suggested to use a table, but not on paper, but a table in program
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Shveta,
sorry for disturbing you. I have the same problem. I want to produce two phase signals with dead band. Could you help me if you have solve the problem?
Thanks a lot
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Setup is right in the global properties -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content