PE will not let me do this because the counter is already used.
In my case these 2 PPG will *NEVER* be used at same time.
What is best way to force PE to generate these beans.... Or any other workable solution.
PE v3.09 CW PI IDE v4.41
I think that your solution with using additional user code was completely correct and there is not other way how to currenlty solve it in ProcessorExpert (PE).
Generally PE does not support run-time confuguraiton.
Anyway I will pass your request to developers.
best regardsVojtech FilipProcessor Expert Support Team
it seems that you have used some non-standart way to add the second PPG component to your project. The error reporting on your screen-shots is correct, you have selected the same timer device and pin in both components.
To avoid the problem change value of "Compare - period" porperty to another value than TPM1PP, and consequently value of appropriate pin in "Output pin" property for example in IR_LED1 component.
Thanks for your response.
Why do you say I've used a non-standard way to add second PPG component?What is the standard way?In my case led0 works alone as does led1 each on separate port pins.You also say to change TPM1PP but there are no other options for TPM1.
There is only one counter for that TPM and no others are available.
The problem is that PE will not let me share a resource when it thinks there is a conflict when in fact there is no conflict because the resource is never required simultaneously
Hello,Sorry for my previous confusing post I didnt read your original post properly. However I am still not sure if I understand your goal correctly.PPG component does not allow timer sharing. You have two options:1) You can also consider usage of PWM component instead of PPG component. Multiple PWM components can share one timer, however PWM does not allow to change period of the signal at runtime.
2) In case you need to switch the output pin on PPG component please add only one component to the project and select a pin. As you can see on the attached screen-shot:
"1" in SOPT2_T1CH0PS corresponds to the PTC0 and 0 corresponds to the PTA. So if you need to toggle with these pins it would be necessary do this in user code, example follows: /* OutPut on PTC0_TPM1CH0_ADP8 */ SOPT2_T1CH0PS = 0x01u; /* OutPut on PTA0_PIA0_TPM1CH0_TCLK_ADP0_ACMPPLUS */ SOPT2_T1CH0PS = 0x00u;If its not sufficient for you, please provide more details including detailed description of your project related to PPG outputs.
SG16 has two TPMs with two channels on each - see SG16.png
Regarding standard way: In case you create new project with SG16, add two PPG components from Component Library they do not report any error after settings of timing values and the first PPG component will allocate TPM1 and the second PPG component TPM2.
Thanks again for your response.
Your option 1 is not workable due to the requirement of variable period at runtime.Your option 2 is a very good idea but unfortunately the hardware already is built.
Basically your second sentence says it all.PE does not allow multiple uses of CPU resources even though the hardware and application requirements will permit it!
This was essentially my original question.How do you force PE to do something it does not want to do?
This is the solution I am using:1 Use PE to generate PPM_1.2 Copy PE generated PPM_1 component source code to a user module.3 Disable PPM_1.4 Use PE to generate PPM_0.5 Fix some initializing that PE didn't do for PPM_1.
I am the first to admit this is ugly messy and dangerous.I wish PE would make this sort of stuff a little easier to do.
I face the same problem in a servo demonstrator I am rewriting, based on the Axiom HCS08GB60 board and a hacked Futaba servo. I'm using CW10.
The Futaba H-bridge driver chip wants to see the PWM pulses on one pin to drive the motor clockwise, and on another pin to drive the motor counterclockwise. In order to avoid adding external pulse steering logic, I opted to drive the two lines from two PWM channels on the same timer. Of course, my software avoids ever activating both PWMs at the same time!
In the new version of the demonstrator code, I want to vary the rep rate (PRF) as well as the duty cycle (DC). The available PPG would seem ideal for this, except, as you point out, you can't instantiate two PPGs on the same timer, because their PRF setting methods would (presumably) interact, so the Processor Expert disallows it.
So I installed a single PPG to implement one of the PWM outputs, but can't install another PPG, or even a PWM component on any other channel of that timer.
It would not be difficult, in principle, to create a "slave" PPG component, which was just like the current one, except that it would have no PRF method, and therefore no interference with the PRF method of the existing "Master" type of PPG.
The short term solution which I will undertake is as follows:
1. Build the project with just one PPG component, thus implementing one of the two required PWM outputs.
2. Create a user module for the second PWM output. This will contain clones of the DC-setting methods, but no clone of the PRF-setting methods. The clones will, of course, refer to their own capture/compare channel. The names of these methods will be of the same form as those given to the PPG methods, to minimize confusion.
3. The DC setting methods on the second channel will use the same scaling algorithms and the same source of PRF data (presumably the timer reload register) as the PPG component.
4. PRF will be set using the PPG's method.
I see that I'm a forum "Newbie." I was with Motorola Semi Division/Group/Sector most years from 1969 to 1998.
Retrieving data ...