Difference between revisions of "PWM Generator"

From Ethersex_Wiki
Jump to: navigation, search
(Created page with "{{i18n|PWM Generator}} {{Module |NAME=PWM |MENUCONFIG={{I/O}}->PWM Generator |STATUS={{unknown}} |PINNING=yes |ECMD={{has_ecmd}} |CONTROL6={{???}} |DEPENDS=ECMD |REQUIRES= - …")
 
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{i18n|PWM Generator}}
 
{{i18n|PWM Generator}}
 
{{Module
 
{{Module
|NAME=PWM
+
|NAME=PWM Generator
 
|MENUCONFIG={{I/O}}->PWM Generator
 
|MENUCONFIG={{I/O}}->PWM Generator
|STATUS={{unknown}}
+
|STATUS={{Unstable}}
 
|PINNING=yes
 
|PINNING=yes
 
|ECMD={{has_ecmd}}
 
|ECMD={{has_ecmd}}
|CONTROL6={{???}}
+
|CONTROL6=
 
|DEPENDS=[[ECMD]]
 
|DEPENDS=[[ECMD]]
 
|REQUIRES= -
 
|REQUIRES= -
Line 12: Line 12:
 
}}
 
}}
  
Pulse wide modulator generator with upto 3 channels.
+
Pulse wide modulator generator with up to 3 channels.
  
 +
This module uses the avr timers to generate the pwm signals, so for every channel a timer is necessary.
 +
It depends on the hardware and other modules, if three timers are available for the the three channels.
  
== Anschluss ==
+
To get background infos you can have a look at this tutorial (in german): [[http://www.mikrocontroller.net/articles/AVR-Tutorial:_PWM AVR-Tutorial: PWM]]
 +
 
 +
Status: Basic modul works - tested and used 2012-05-25
 +
 
 +
 
 +
== Connection ==
 +
 
 +
Every channels requieres a port, but since the timers are used, the ports have a predefined assignment - depending on the mcrocontroller.
 +
 
 +
Nevertheless you have to do some pin definition.
 +
Here the version for the AtMega32:
 +
 
 +
ifdef(`conf_CH_A_PWM_GENERAL', `dnl
 +
  pin(CHANNEL_A_PWM, PD5, OUTPUT)
 +
')
 +
ifdef(`conf_CH_B_PWM_GENERAL', `dnl
 +
  pin(CHANNEL_B_PWM, PD4, OUTPUT)
 +
')
 +
ifdef(`conf_CH_C_PWM_GENERAL', `dnl
 +
  # error 3 Channel pwm unsupported.
 +
')
 +
 
 +
You can also use the script add-hardware (in folder scripts) to generate a board-layout for your current configuration. I don't know the current status of the script - so it is possible, that not every features is supported.
 +
 
 +
== Optional components ==
 +
 
 +
=== PWM Wave ===
 +
 
 +
Output of wave files
 +
 
 +
=== PWM Melody ===
 +
 
 +
Melody generator
 +
 
 +
=== PWM Servo ===
 +
 
 +
Control a servo motor

Latest revision as of 17:57, 25 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.

This module uses the avr timers to generate the pwm signals, so for every channel a timer is necessary. It depends on the hardware and other modules, if three timers are available for the the three channels.

To get background infos you can have a look at this tutorial (in german): [AVR-Tutorial: PWM]

Status: Basic modul works - tested and used 2012-05-25


Connection

Every channels requieres a port, but since the timers are used, the ports have a predefined assignment - depending on the mcrocontroller.

Nevertheless you have to do some pin definition. Here the version for the AtMega32:

ifdef(`conf_CH_A_PWM_GENERAL', `dnl
 pin(CHANNEL_A_PWM, PD5, OUTPUT)
')
ifdef(`conf_CH_B_PWM_GENERAL', `dnl
 pin(CHANNEL_B_PWM, PD4, OUTPUT)
')
ifdef(`conf_CH_C_PWM_GENERAL', `dnl
  # error 3 Channel pwm unsupported.
')

You can also use the script add-hardware (in folder scripts) to generate a board-layout for your current configuration. I don't know the current status of the script - so it is possible, that not every features is supported.

Optional components

PWM Wave

Output of wave files

PWM Melody

Melody generator

PWM Servo

Control a servo motor