| Electronic Components Datasheet Search |
|
HT56R25 Datasheet(PDF) 64 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT56R25 Datasheet(HTML) 64 Page - Holtek Semiconductor Inc |
|
64 / 131 page ![]() HT56R22/HT56R23/HT56R24/HT56R25/HT56R26 Rev. 1.00 64 March 11, 2010 Summary of A/D Conversion Steps The following summarises the individual steps that should be executed in order to implement an A/D con- version process. · Step 1 Select the required A/D conversion clock by correctly programming bits ADCS2, ADCS1 and ADCS0 in the register. · Step 2 Select which pins are to be used as A/D inputs and configure them as A/D input pins by correctly program- ming the PCR7~PCR0 bits in the ADPCR register. · Step 3 Enable the A/D by clearing the ADONB in the ACSR register to zero. · Step 4 Select which channel is to be connected to the internal A/D converter by correctly programming the ACS2~ACS0 bits which are also contained in the reg- ister. · Step 5 If the interrupts are to be used, the interrupt control registers must be correctly configured to ensure the A/D converter interrupt function is active. The master interrupt control bit, EMI, in the INTC0 interrupt control register must be set to ²1², the multi-function interrupt enable bit, EMFI, in the INTC1 register and the A/D converter interrupt bit, EADI, in the INTC1 register must also be set to ²1². · Step 6 The analog to digital conversion process can now be initialised by setting the START bit in the ADCR regis- ter from ²0² to ²1² and then to ²0² again. Note that this bit should have been originally set to ²0². · Step 7 To check when the analog to digital conversion pro- cess is complete, the EOCB bit in the ADCR register can be polled. The conversion process is complete when this bit goes low. When this occurs the A/D data registers ADRL and ADRH can be read to obtain the conversion value. As an alternative method if the in- terrupts are enabled and the stack is not full, the pro- gram can wait for an A/D interrupt to occur. Note: When checking for the end of the conversion process, if the method of polling the EOCB bit in the ADCR register is used, the interrupt enable step above can be omitted. The accompanying diagram shows graphically the vari- ous stages involved in an analog to digital conversion process and its associated timing. The setting up and operation of the A/D converter func- tion is fully under the control of the application program as there are no configuration options associated with the A/D converter. After an A/D conversion process has been initiated by the application program, the microcontroller internal hardware will begin to carry out the conversion, during which time the program can continue with other functions. The time taken for the A/D conversion is 16tAD where tAD is equal to the A/D clock period. Programming Considerations When programming, special attention must be given to the PCR7~PCR0 bits in the ADPCR register. If these bits are all cleared to zero no external pins will be se- lected for use as A/D input pins allowing the pins to be used as normal I/O pins. Setting the ADONB bit high has the ability to power down the internal A/D circuitry, which may be an important consideration in power sensitive applications. The ADONB bit should be set high before entering any of the low power operating modes or be- fore a HALT instruction is executed to reduce power consumption. A/D Transfer Function As the device contain a 12-bit A/D converter, its full-scale converted digitised value is equal to FFFH. Since the full-scale analog input value is equal to the VDD voltage, this gives a single bit analog input value of VDD/4096. The diagram show the ideal transfer function between the analog input value and the digitised output value for the A/D converter. Note that to reduce the quantisation error, a 0.5 LSB off- set is added to the A/D Converter input. Except for the digitised zero value, the subsequent digitised values will change at a point 0.5 LSB below where they would change without the offset, and the last full scale digitised value will change at a point 1.5 LSB below the VDD level. A/D Programming Example The following two programming examples illustrate how to setup and implement an A/D conversion. In the first example, the method of polling the EOCB bit in the ADCR register is used to detect when the conversion cycle is complete, whereas in the second example, the A/D interrupt is used to determine when the conversion is complete. |
|
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 |