Jump to content

Component: PWM Free (Peripheral CAL): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(4 intermediate revisions by 2 users not shown)
Line 17: Line 17:
==Component Source Code==
==Component Source Code==


Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/PWM_Free.fcfx FC_Comp_Source_temp/PWM_Free.fcfx]
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_PWM_Free.fcfx FC_Comp_Source_PWM_Free.fcfx]


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/PWM_Free.fcfx FC_Comp_Source_temp/PWM_Free.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_PWM_Free.fcfx FC_Comp_Source_PWM_Free.fcfx]


==Detailed description==
==Detailed description==
Line 78: Line 78:


Example showing how to build a component using a CAL component [[Using_CAL_Components|Using CAL Components]].
Example showing how to build a component using a CAL component [[Using_CAL_Components|Using CAL Components]].




Line 91: Line 93:


===ChangePeriod===
===ChangePeriod===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ChangePeriod'''
| width="90%" class="mtx-class-macrohead" | '''ChangePeriod'''
|-
|-
| colspan="2" | Change the Period (and prescaler) for this PWM Channel 
| colspan="2" | Change the Period (and prescaler) for this PWM Channel 
Line 115: Line 117:


===Disable===
===Disable===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Disable'''
| width="90%" class="mtx-class-macrohead" | '''Disable'''
|-
|-
| colspan="2" | Disable this PWM Channel 
| colspan="2" | Disable this PWM Channel 
Line 129: Line 131:


===Enable===
===Enable===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Enable'''
| width="90%" class="mtx-class-macrohead" | '''Enable'''
|-
|-
| colspan="2" | Enable this PWM Channel 
| colspan="2" | Enable this PWM Channel 
Line 143: Line 145:


===GetList===
===GetList===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetList'''
| width="90%" class="mtx-class-macrohead" | '''GetList'''
|-
|-
| colspan="2" | Returns CHANNEL or PRESCALE list from the FCD and updates the internal property  
| colspan="2" | Returns CHANNEL or PRESCALE list from the FCD and updates the internal property  
Line 162: Line 164:


===GetValue===
===GetValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetValue'''
| width="90%" class="mtx-class-macrohead" | '''GetValue'''
|-
|-
| colspan="2" | Returns Named property Value  
| colspan="2" | Returns Named property Value  
Line 181: Line 183:


===SetDuty10Bit===
===SetDuty10Bit===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDuty10Bit'''
| width="90%" class="mtx-class-macrohead" | '''SetDuty10Bit'''
|-
|-
| colspan="2" | Set the Duty Cycle for this PWM Channel. PIC/AVR - Range: 0-1023 16-bit PIC - Range: 0-65535 
| colspan="2" | Set the Duty Cycle for this PWM Channel. PIC/AVR - Range: 0-1023 16-bit PIC - Range: 0-65535 
Line 200: Line 202:


===SetDuty8Bit===
===SetDuty8Bit===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetDuty8Bit'''
| width="90%" class="mtx-class-macrohead" | '''SetDuty8Bit'''
|-
|-
| colspan="2" | Set the Duty cycle (0-255) for this PWM Channel 
| colspan="2" | Set the Duty cycle (0-255) for this PWM Channel 
Line 219: Line 221:


===SetValue===
===SetValue===
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetValue'''
| width="90%" class="mtx-class-macrohead" | '''SetValue'''
|-
|-
| colspan="2" | Sets the Value of the property PERIOD, PRESCALE or CHANNEL (if CHANNEL also updates the PORT from FCD)  
| colspan="2" | Sets the Value of the property PERIOD, PRESCALE or CHANNEL (if CHANNEL also updates the PORT from FCD)  
Line 244: Line 246:
==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-

Latest revision as of 14:23, 13 July 2026

Author Matrix Ltd
Version 1.3
Category Peripheral CAL


PWM Free component

A low level implementation giving direct access to the CAL

Component Source Code

Please click here to download the component source project: FC_Comp_Source_PWM_Free.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_PWM_Free.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Example showing how to build a component using a CAL component Using CAL Components.







Macro reference

ChangePeriod

ChangePeriod
Change the Period (and prescaler) for this PWM Channel 
- UINT period
period value PIC/AVR: 0-255 16-bit PIC: 0-65535 
- UINT prescaler
prescaler 1,4,16,64 
- VOID Return


Disable

Disable
Disable this PWM Channel 
- VOID Return


Enable

Enable
Enable this PWM Channel 
- VOID Return


GetList

GetList
Returns CHANNEL or PRESCALE list from the FCD and updates the internal property  
- STRING Name
 
- STRING Return


GetValue

GetValue
Returns Named property Value  
- STRING Name
 
- STRING Return


SetDuty10Bit

SetDuty10Bit
Set the Duty Cycle for this PWM Channel. PIC/AVR - Range: 0-1023 16-bit PIC - Range: 0-65535 
- UINT duty
Duty value 0 - 1023 
- VOID Return


SetDuty8Bit

SetDuty8Bit
Set the Duty cycle (0-255) for this PWM Channel 
- BYTE duty
duty value 0 - 255 
- VOID Return


SetValue

SetValue
Sets the Value of the property PERIOD, PRESCALE or CHANNEL (if CHANNEL also updates the PORT from FCD)  
- STRING Name
 
- STRING Value
 
- VOID Return


Property reference

Properties
Channel
PWM Channel selector 
Alt Pin Enable
Alternative Pin Enable (if available on target device) 
Port
 
Period Register
PWM Period Register value 
Prescaler Divide
Prescaler Divider value 
PWM Timer
Timer associated with PWM to drive the output. Warning - All PWM channels linked to the same timer will share the same period and prescaler settings. 
Clock Speed
 
Period (uS)
 
Frequency (KHz)
 
Master Divider