Output Compare Bean for MC9S08DZ60?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Output Compare Bean for MC9S08DZ60?

Jump to solution
1,795 Views
jgirard1
Contributor III

I do not see an Output Compare bean in my Processor Expert.  I do see Input Capture.  Why is there not an Output Compare? 

 

I am able to use the Init_TPM bean to get some access to the Output Compare, but the code generated is rather limited and will still require extra manual coding.

 

Is there a bean in existance or some other alternate I can use?

Labels (1)
Tags (1)
0 Kudos
1 Solution
1,361 Views
ProcessorExpert
Senior Contributor III

Directly accessing hardware registers means that the component is low-level because it's strongly MCU dependent and there are limitations and issues when such components are created.

Please see my post on other thread where I have explained the details:

https://community.freescale.com/message/95176#95176

I have also posted there an example of a component extenting TimerOut component that provides you an interface for changing output action (toggle, set, clear) that should be quite easily etensible for producing Manchester encoding output.

 

best regards
Petr Hradsky
Processor Expert Support Team

View solution in original post

0 Kudos
10 Replies
1,361 Views
ProcessorExpert
Senior Contributor III

Could you be more specific in what task you need to handle ? Do you need to generate some signal by producing output on compare? There are component for such tasks - TimerOut, PWM or PPG, take a look at these components if they will be  useful for your application.

 

best regards
Petr Hradsky
Processor Expert Support Team

0 Kudos
1,361 Views
jgirard1
Contributor III

Yes, I need to generate a complex protocol waveform.  Bi-phase Manchester data to be specific.  I have always used Output Compare for this.  I figure there would be a simple Bean to initialize, turn on, turn off, set the time, get the time, set the edge, handle the interrupt, etc.  Nothing complicated, just a  little abstraction to control the registers and put the basic access methods and events in the correct locations within the project.

 

I suppose I could create my own Bean, but I do not have a license for the Processor Expert Component Wizard.

0 Kudos
1,361 Views
bigmac
Specialist III

Hello,

 

If you have previously coded the transmission protocol, why not simply incorporate this code into your project?  This would seem the simpler solution.  As you are aware, using output compare mode is a simple concept.  The main complexity would the determination of the required output state after each half-bit period - which I assume a generalised timing bean would not address.

 

I have also attached my take on a possible encoding procedure.

 

Regards,

Mac

 

0 Kudos
1,361 Views
jgirard1
Contributor III

Thanks for the input, but your answer is quite an obvious one.

 

The whole concept of using Processor Expert is for abstraction away from the low-level hardware which makes your code platform independant and completely re-usable without modification.  If I develop a high-level Manchester code generator that connects directly to MCU's low-level registers using bit manipulation and hex numbers, then it is no longer a high-level Manchester code generator.  Anytime I want to re-use this piece of code, I need to check/edit and manipulate the register accesses.

 

0 Kudos
1,361 Views
bigmac
Specialist III

Hello,

 

I do not view the generation a Manchester code sequence to be a "high level" function, but would see it as a very basic hardware driver function.  Additionally, as you can see from the sample code, the ISR processing is necessarily simple, so as to avoid compromising the maximum allowable communications rate.  Since Manchester code requires two interrupts per bit, this may even warrant a case for using inline assembly code within the ISR.

 

With multiple levels of abstraction within the ISR code, you will potentially get a worse performance than might otherwise be the case with the more direct approach.  How would you estimate the maximum throughput for each MCU type under consideration, to determine whether what you propose will work?  Surely this will involve a detailed understanding and analysis of the operation of the code and the timer module, which you seem to be attempting to avoid.

 

Regards,

Mac

 

0 Kudos
1,362 Views
ProcessorExpert
Senior Contributor III

Directly accessing hardware registers means that the component is low-level because it's strongly MCU dependent and there are limitations and issues when such components are created.

Please see my post on other thread where I have explained the details:

https://community.freescale.com/message/95176#95176

I have also posted there an example of a component extenting TimerOut component that provides you an interface for changing output action (toggle, set, clear) that should be quite easily etensible for producing Manchester encoding output.

 

best regards
Petr Hradsky
Processor Expert Support Team

0 Kudos
1,361 Views
jgirard1
Contributor III

When you use inheritence, I notice that the inherited component generates a file called "inhr1.c".  While I can understand and appreciate the reasons why it does this, it begs me to question why can't it all be done in one new file?  Why can't all the inherited code just be placed in the new source file for the descendent component?  Are there any other inheritence options or ways of doing this to get it all into one self-contained file?  It seems to me that it would be a much cleaner and more managable solution.

0 Kudos
1,361 Views
jgirard1
Contributor III

Can anyone answer if it is always necessary for the files 'inhr1.c', 'inhr2.c', etc. to always appear when using inheritance?  Is there an option to have the new decendant contain everything in one file?  I would assume it is split up this way so other components can share the same components without having duplicate code appear.  Is my assumption correct?

0 Kudos
1,361 Views
ProcessorExpert
Senior Contributor III

Currently, it's not possible to have code of inherited components generated into one file. Each component has it's one module.The reason is that there might appear conflicts when the source code of inherited module and descendand would be merged into one file. For example you can have same function with different content.

The reason for numbering is that you can have more instances of the same component in the project, so conflicts in naming would occur.

 

best regards
Petr Hradsky
Processor Expert Support and Servicepacks Team

0 Kudos
1,361 Views
bigmac
Specialist III

Hello,

 

Posting this question to one of the Processor Expert forums might be more appropriate.

 

Regards,

Mac

 

0 Kudos