Difference between revisions of "PWM Generator"

From Ethersex_Wiki
Jump to: navigation, search
(Connection)
Line 25: Line 25:
 
  ifdef(`conf_PWM', `dnl
 
  ifdef(`conf_PWM', `dnl
 
  #ifdef CH_A_PWM_GENERAL_SUPPORT
 
  #ifdef CH_A_PWM_GENERAL_SUPPORT
   pin(CHANNEL_A_PWM, PC0)
+
   pin(CHANNEL_A_PWM, PC0, OUTPUT)
 
  #endif /* CH_A_PWM_GENERAL_SUPPORT */
 
  #endif /* CH_A_PWM_GENERAL_SUPPORT */
 
  #ifdef CH_B_PWM_GENERAL_SUPPORT
 
  #ifdef CH_B_PWM_GENERAL_SUPPORT
   pin(CHANNEL_B_PWM, PC1)
+
   pin(CHANNEL_B_PWM, PC1, OUTPUT)
 
  #endif /* CH_B_PWM_GENERAL_SUPPORT */
 
  #endif /* CH_B_PWM_GENERAL_SUPPORT */
 
  #ifdef CH_C_PWM_GENERAL_SUPPORT
 
  #ifdef CH_C_PWM_GENERAL_SUPPORT
   pin(CHANNEL_C_PWM, PC2)
+
   pin(CHANNEL_C_PWM, PC2, OUTPUT)
 
  #endif /* CH_C_PWM_GENERAL_SUPPORT */
 
  #endif /* CH_C_PWM_GENERAL_SUPPORT */
 
  ')
 
  ')

Revision as of 18:59, 20 May 2012

PWM Generator
Status
Unstable/Broken
menuconfig I/O->PWM Generator
Pinning yes
Ecmd yes
Depends on ECMD
Requires -
Code https://github.com/ethersex/ethersex/tree/master/hardware/pwm

Pulse wide modulator generator with up to 3 channels.


Connection

Every channels needs a port.

At the moment none of the standard boards has a pin configuration already implemented. It would not make much sense, because you would have to adapt it anyway.

So here a example you can modify and copy to the configuration of the board used:

ifdef(`conf_PWM', `dnl
#ifdef CH_A_PWM_GENERAL_SUPPORT
 pin(CHANNEL_A_PWM, PC0, OUTPUT)
#endif /* CH_A_PWM_GENERAL_SUPPORT */
#ifdef CH_B_PWM_GENERAL_SUPPORT
 pin(CHANNEL_B_PWM, PC1, OUTPUT)
#endif /* CH_B_PWM_GENERAL_SUPPORT */
#ifdef CH_C_PWM_GENERAL_SUPPORT
  pin(CHANNEL_C_PWM, PC2, OUTPUT)
#endif /* CH_C_PWM_GENERAL_SUPPORT */
')