| Electronic Components Datasheet Search |
|
HT46R02 Datasheet(PDF) 26 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT46R02 Datasheet(HTML) 26 Page - Holtek Semiconductor Inc |
|
26 / 60 page ![]() HT46R01/HT46R02/HT46R03 Rev. 1.00 26 September 21, 2007 PWM Output Control The PWM output is pin-shared with the I/O pin PA4. 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.4 to ensure that the PWM out- put 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 PWM register, writ- ing a high value to the corresponding bit in the output data register PA.4 will enable the PWM data to appear on the pin. Writing a zero value will disable the PWM output function and force the output low. In this way, the Port A data output register can be used as an on/off con- trol for the PWM function. Note that if the CTRL0 register has selected the PWM function, but a high value has been written to its corresponding 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 PWM output is setup and controlled. mov a,64h ; setup PWM value of 100 ; decimal which is 64H mov pwm,a set ctrl.5 ; select the 7+1 PWM mode set ctrl.3 ; select pin PA4 to have a PWM ; function clr pac.4 ; setup pin PA4 as an output set pa.4 ; PD.0=1; enable the PWM ; output :: clr pa.4 ; disable the PWM output - pin ; PD4 forced low Analog to Digital Converter The need to interface to real world analog signals is a common requirement for many electronic systems. However, to properly process these signals by a microcontroller, they must first be converted into digital signals by A/D converters. By integrating the A/D con- version electronic circuitry into the microcontroller, the need for external components is reduced significantly with the corresponding follow-on benefits of lower costs and reduced component space requirements. A/D Overview Each of the devices contains a 4-channel analog to digi- tal converter which can directly interface to external an- alog signals, such as that from sensors or other control signals and convert these signals directly into either an 8-bit, 9-bit or 12-bit digital value, depending upon which device is used. Device Input Channels Conversion Bits Input Pins HT46R01 4 8 PA0~PA3 HT46R02 4 9 PA0~PA3 HT46R03 4 12 PA0~PA3 The following diagram shows the overall internal struc- ture of the A/D converter, together with its associated registers. A D C S o u r c e f S Y S / 2 ¸ N A C S R R e g i s t e r A D C V D D P A 0 / A N 0 P A 1 / A N 1 P A 2 / A N 2 P A 3 / A N 3 A / D r e f e r e n c e v o l t a g e A D R o r A D R L A D R H A / D D a t a R e g i s t e r s P C R 0 ~ P C R 2 A D C S 0 ~ A D C S 2 S T A R T E O C A D C R R e g i s t e r P i n C o n f i g u r a t i o n B i t s C h a n n e l S e l e c t B i t s S t a r t a n d E n d o f C o n v e r s i o n B i t s C l o c k D i v i d e R a t i o A/D Converter Structure |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |