| поискавой системы для электроныых деталей |
|
HT46R006 датащи(PDF) 45 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT46R006 датащи(HTML) 45 Page - Holtek Semiconductor Inc |
|
45 / 72 page ![]() HT48R006/HT46R006 Rev. 1.00 45 October 24, 2011 PWM Output Control The PWM output is pin-shared with the I/O pin PA2. To operate as a PWM output and not as an I/O pin, the cor- rect bits must be set in the CTRL0 register. A zero value must also be written to the corresponding bit in the I/O port control register PAC.2 to ensure that the corre- sponding PWM output pin is setup as an output. After these two initial steps have been carried out, and of course after the required PWM value has been written into the PWMn register, writing a high value to the corre- sponding bit in the output data register PA.2 will enable the PWM data to appear on the pin. Writing a zero value will disable the PWM output function and force the out- put low. In this way, the Port data output registers can be used as an on/off control for the PWM function. Note that if the CTRL0 register have selected the PWM func- tion, but a high value has been written to its correspond- ing bit in the PAC control register to configure the pin as an input, then the pin can still function as a normal input line, with pull-high resistor options. · PWM Programming Example The following sample program shows how the PWM0 output is setup and controlled. mov a,64h ; setup PWM value of decimal 100 mov pwm0,a set ctrl0.5 ; select the 7+1 PWM mode set ctrl0.2 ; select pin PA2 to have a PWM function clr pac.2 ; setup pin PA2 as an output set pa.2 ; enable the PWM output :: clr pa.2 ; disable the PWM output_ pin ; PA2 forced low |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |