| Electronic Components Datasheet Search |
|
HT48R01A Datasheet(PDF) 20 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT48R01A Datasheet(HTML) 20 Page - Holtek Semiconductor Inc |
|
20 / 49 page ![]() HT48R01A Rev. 1.10 20 August 4, 2008 Prescaler Bits T0PSC0~T0PSC2 of the TMR0C register can be used to define a division ratio for the internal clock source of the Timer/Event Counter enabling longer time out periods to be setup. Buzzer Function Operating similar to a programmable frequency divider, the buzzer function within the microcontroller provides a means of producing a variable frequency output suitable for applications, such as piezo-buzzer driving or other interfaces requiring a precise frequency generator. BZ and BZ pins are a complimentary pair and pin-shared with I/O pins, PA0 and PA1. The function is selected via the CTRL0 register, however, if not selected, the pins can operate as normal I/O pins. Note that the BZ pin is the in- verse of the BZ pin generating a kind of differential output and supplying more power to connected interfaces such as buzzers. The CTRL0 register can select a single BZ pin or the complimentary pair BZ and BZ. The timer overflow signal is the clock source for the buzzer circuit. The output frequency is controlled by load- ing the required values into the timer prescaler and timer registers to give the required division ratio. The counter will begin to count-up from this preload register value until full, at which point an overflow signal is generated, caus- ing both the BZ and BZ outputs to change state. The counter will then be automatically reloaded with the preload register value and continue counting- up. If the CTRL0 register has selected the buzzer function, then for both buzzer outputs to operate, it is essential that the Port A control register PAC bit 0 and PAC bit 1 are setup as outputs. If only one pin is setup as an out- put, the other pin can still be used as a normal data input pin. However, if both pins are setup as inputs then the buzzer will not function. The buzzer outputs will only be activated if bit PA0 is set to ²1². This output data bit is used as the on/off control bit for the buzzer outputs. Note that the BZ and BZ outputs will both be low if the PA0 output data bit is cleared to ²0². The condition of data bit PA1 has no effect on the overall control of the BZ and BZ pins. Using this method of frequency generation, and if a crystal oscillator is used for the system clock, very pre- cise values of frequency can be generated. I/O Interfacing The Timer/Event Counter, when configured to run in the event counter or pulse width measurement mode, re- quires the use of an external timer pin for its operation. As this pin is a shared pin it must be configured correctly to ensure that it is setup for use as a Timer/Event Coun- ter input pin. This is achieved by ensuring that the mode select bits in the Timer/Event Counter control register, select either the event counter or pulse width measure- ment mode. Additionally the corresponding PAC Port Control Register bit must be set high to ensure that the pin is setup as an input. Any pull-high resistor connected to this pin will remain valid even if the pin is used as a Timer/Event Counter input. Programming Considerations When configured to run in the timer mode, the internal system clock is used as the timer clock source and is therefore synchronised with the overall operation of the microcontroller. In this mode when the appropriate timer register is full, the microcontroller will generate an internal interrupt signal directing the program flow to the respec- tive internal interrupt vector. For the pulse width mea- surement mode, the internal system clock is also used as the timer clock source but the timer will only run when the correct logic condition appears on the external timer input pin. As this is an external event and not synchronised with the internal timer clock, the microcontroller will only see this external event when the next timer clock pulse arrives. As a result, there may be small differences in measured values requiring programmers to take this into account during programming. The same applies if the timer is configured to be in the event counting mode, which again is an external event and not synchronised with the internal system or timer clock. T i m e r O v e r f l o w B u z z e r C l o c k P A 0 D a t a B Z O u t p u t a t P A 0 B Z O u t p u t a t P A 1 Buzzer Function |
|
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 |