A/D, D/A conversion
Contents
FAQ-ID = 78ad- nnnn
78ad -0001
|
How to evaluate an 8-bit A/D converter using a flash device with a 10-bit A/D converter
|
| Q1 |
Microcontrollers with an on-chip 8-bit A/D converter and microcontrollers
with an on-chip 10-bit A/D converter are supported by the same flash version microcontroller,
but how are they differentiated?
|
| A1 |
This applies the following subseries.
| uPD78F0034A | for | uPD780024A/0034A Subseries |
| uPD78F9116A | for | uPD789104A/9114 Subseries |
| uPD78F9136A | for | uPD789124A/9134A Subseries |
| uPD78F9177 | for | uPD789167/9177 Subseries |
| uPD78F9418A | for | uPD789407A/9417A Subseries |
| uPD78F9436 | for | uPD789426/9436 Subseries |
| uPD78F9456 | for | uPD789446/9456 Subseries |
For these products, the same flash version microcontroller is used to evaluate
mask version microcontrollers with an on-chip 8-bit A/D converter
and those with an on-chip 10-bit A/D converter.
For this purpose, the mapping of the result register and bit configuration have been specialized.
10-bit result data is stored in the higher 10 bits of a 16-bit register,
and this 16-bit register is mapped as follows.
| Addr0 | : The lower 2 bits of the 10-bit result are stored in bits 7 and 6 |
| Addr0+1 | : Stores the higher 8 bits of the 10-bit result |
When evaluating a 10-bit A/D converter,
read from Addr0 using a 16-bit transfer instruction (MOVW)
and obtain a 10-bit result from the higher 10 bits of the 16-bit register.
When evaluating an 8-bit A/D converter,
read from Addr0+1 using an 8-bit transfer instruction (MOV)
and obtain an 8-bit result from the 8-bit register.
In actual programming, 8-bit A/D converter or 10-bit A/D converter is determined
when the target device is specified (based on the device file).
Since the address and word/byte configuration are automatically determined
when the conversion result register (ADCR0) is specified,
it is not necessary to be aware of which address to access.
|
78ad -0002
|
Developing a uPD780021A (8-bit A/D) program using the uPD78F0034A (10-bit A/D).
|
| Q1 |
I want to develop a program using the uPD78F0034A and finally write it in the uPD780021A.
However, the uPD78F0034A has a 10-bit A/D converter and the uPD780021A has an 8-bit A/D converter.
Is it possible to develop a uPD780021A program using the uPD78F0034A without any additional changes?
|
| A1 |
Yes.
To develop a uPD780021A program with the uPD78F0034A, write the program as for the uPD780021A.
When this program is written in the uPD78F0034A
and the uPD78F0034A executes an 8-bit transfer instruction,
the A/D conversion result is 8 bits.
This operation is same as in the uPD780021A.
(The 10-bit A/D converter of the uPD78F0034A is divided into higher 8 bits and lower 2 bits,
and the higher 8 bits contain the same result as an 8-bit A/D conversion operation.)
To evaluate using the uPD78F0034A,
set the IMS register to 42H to make the memory configuration the same as that of the uPD780021A.
|
78ad -0003
|
8-bit A/D conversion using uPD78F9116 [78K0/S]
|
| Q1 |
I am using the uPD78F9116 (flash memory version) to develop a set in which the uPD789102 (mask version) will be used.
However, when I execute assembly, the following error occurs:
MOV A, ADCR0
|
| A1 |
In the uPD78F9116, ADCR0 is defined for use for the 10-bit A/D converter,
so only a 16-bit memory manipulation instruction can be used to manipulate ADCR0.
When using the uPD78F9116 to evaluate the uPD789102 (which has an on-chip 8-bit A/D converter), as is the case in your inquiry,
you will need to create a program at the program development stage using a device file for the uPD789102, and then execute assembly.
(Reference)
User's Manual
"uPD789104A,789114A,789124A,789134A Subseries"
Differences Between Flash Memory and Mask ROM Versions in CHAPTER 18 uPD78F9116A, 78F9116B, 78F9136A, 78F9136B
Caution
When using A/D conversion result register 0 (ADCR0) for the 8-bit A/D converter (in uPD789104A, 789124A Subseries),
use an 8-bit memory manipulation instruction to manipulate the register,
and when using it for the 10-bit A/D converter (in uPD789114A, 789134A Subseries), use a 16-bit memory manipulation instruction.
However, when using the uPD78F9116A as the flash memory version of the uPD789101A, 789102A, or 789104A,
or when using the uPD78F9136A as the flash memory version of the uPD789121A, 789122A, or 789124A,
ADCR0 can be manipulated using an 8-bit memory manipulation instruction.
In this case, execute assembly using the object file assembled by the uPD789101A, 789102A, or 789104A,
or by the uPD789121A, 789122A, or 789124A, respectively.
|
|
| |
| Q2 |
I want to install the same software into both the uPD789111A and uPD789101A and switch them by the signals via the input pin.
However, MOV A, ADCR0 and MOVW AX, ADCR0 cannot co-exist.
|
| A2 |
The ADCR0 register cannot be used for both 8 and 16 bits.
If this kind of usage is required, instead of explicitly using ADCR0, prepare two pointers,
one that points to the byte data at address 0xFF15 and one that points to the word data at address 0xff14,
and access the address 0xFF15 pointer in the case of an 8-bit conversion result,
and the address 0xff14 pointer in the case of a 16-bit conversion result.
However, we recommend creating a program using only the uPD789111A,
and use the higher 8 bits of the conversion result when you want an 8-bit value.
|
| |
| Q3 |
I plan to develop my set using the uPD78F9116A and use the uPD789102A mask version for mass production.
However, there are differences between the 8-bit and 10-bit A/D converters; should I execute processing to switch these converters?
|
| A3 |
No such processing is required.
All you need to do is use the uPD789102A to create the program, and then write that program to the uPD78F9116A.
|
 |
|
(2006/04)
|
 |
|
78ad -0004
|
How is the 10-bit A/D conversion result input?
|
| Q1 |
Regarding the 10-bit A/D converter of the uPD78F9116,
how is the 10-bit A/D conversion result input?
|
| A1 |
The 10 bits of the conversion result are allocated from bit 15 of the 16-bit readout.
0 is input to the lower 6 bits.
Therefore, the 16 bits that are read out and the conversion result are as follows.
| Readout data |
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Conversion result |
bit 9 | bit 8 | bit 7 | bit 6 |
bit 5 | bit 4 | bit 3 | bit 2 |
bit 1 | bit 0 |
0 | 0 | 0 |
0 | 0 | 0 |
|
78ad -0005
|
High-speed 6-bit shift method for 10-bit A/D conversion result
|
| Q1 |
In the case of the uPD78F9116A,
the 10-bit A/D conversion result is stored from the higher 15th bit.
Is there any way to shift the data 6 bits to the right at high speed?
Current method used:
ad_buff = ADCR0;
ad_buff >>= 6;
|
| A1 |
Basically, a program must be written using the assembler,
and then that program is called as function from the C program.
The main text of the assembler program for the normal model is as follows.
_funcsub: XCH A,X ;GET B1,0 IN A
ADD A,A ;SET CARRY WITH B1
XCH A,X ;GET B9-B2 AND SAVE B0
ADDC A,A ;ADD B1 TO B8-B2 AND SET CARRY WITH B9
XCH A,X ;GET B0 AND SAVE B8-B1
ADDC A,A ;GET B9 AND SET CARRY WITH B0
XCH A,X ;GET B8-B1 AND SAVE B9
ADDC A,A ;ADD B0 TO B7-B1 AND SET CARRY WITH B8
MOV C,A ;SAVE B7-B0 TO C RETURN VALUE
MOV A,X ;GET B9
ADDC A,A ;ADD B8 TO B9
MOV B,A ;SAVE B9,B8 TO B
RET
This program shifts the data of the AX register and stores the shifted result in the BC register.
When a function is called from the C program with a value in add_buff,
and the return value is also stored in ad_buff, use as following format:
ad_buff = funcsub(ad_buff);
|
 |
|
(2006/04)
|
 |
|
78ad -0006
|
Description of conversion time in uPD789445 Preliminary Product Information
|
| Q1 |
I have a question about uPD789445 A/D input.
Regarding the conversion time in the 8-bit A/D converter characteristics,
the top line has "AVDD = 2.7 to 5.5V" and the bottom line is blank.
Does this mean "AVDD = 1.8 to 2.7V"?
|
| A1 |
That is correct.
If nothing is written in the Conditions column,
this means that the condition on the top of the specification table applies.
|
78ad -0007
|
Why do the A/D conversion times described in user's manuals and data sheets differ?
|
| Q1 |
What is the relationship between the conversion time selected using the ADM register
in the user's manual and the conversion time in the data sheet for the uPD780058?
|
| A1 |
Please select a suitable conversion time for the system using the ADM register,
within the range that satisfies the conversion time in the data sheet.
The conversion time in the data sheet is the guaranteed value for the hardware of the device.
In other words, it describes the performance indicating up to what speed conversion is possible for the device.
If the conversion time specified by the ADM register exceeds the range of the data sheet,
the conversion operation is not guaranteed.
The description of the ADM register in the user's manual only shows the kind of settings that are usable.
Since the optimum settings for a given operating clock frequency can be selected,
please select suitable values for your system requirements within the range in the data sheet.
|
| |
| Q2 |
In the user's manual for the uPD789102A, there is a caution related to A/D conversion time selection that says,
"Do not set the A/D conversion time so that it exceeds 14 us."
What does this "14 us" mean?
|
| A2 |
This 14 us is the performance limit of the device's A/D conversion hardware.
Conversion cannot be performed faster than this.
|
 |
|
(2006/04)
|
 |
|
78ad -0008
|
Does A/D conversion end by the time specified by the ADM register?
|
| Q1 |
In the case of the uPD789445, the conversion time under the condition of ADM0 = 88H (fx = 4MHz) is 30us.
Will A/D conversion end normally just by waiting 30us from the time the input channel is specified?
|
| A1 |
Even if the input channel is specified, this does not mean that A/D conversion will start immediately.
Instead of waiting for the end of conversion using a soft timer in this way,
wait for INTAD0 to occur or wait for ADIF0 of the IF1 register to be set.
(Once it has been ascertained that ADIF0 is set, clear ADIF0.)
|
| |
| Q2 |
I am executing A/D conversion at an operating frequency of 1 MHz and with FR02, FR01, and FR00 set to 48/fcc.
When I measured the conversion time using an oscilloscope, by lighting an LED during the conversion operation,
it took about 80 us. If the clock frequency is 48/fcc, shouldn't one A/D conversion take about 48 us?
|
| A2 |
Once conversion starts, conversion will end in the time specified by FR02 to FR00.
However, the CPU clock differs from the A/D operating clock, so even if A/D conversion is started by the CPU,
conversion may not actually start immediately.
Also, although ports are manipulated by the program via conversion end interrupts,
time is required between generation of the conversion end interrupt and start of interrupt servicing,
and for the program to execute processing. Because the clock frequency in your inquiry is low,
at least 2 us are required to execute one instruction.
Due to all these factors, conversion seems to take about 80 us.
|
 |
|
(2006/04)
|
 |
|
78ad -0009
|
Can the pins not specified for analog input be used as ports?
|
| Q1 |
Can pins other than those specified by the analog input channel specification register be used as input ports?
|
| A1 |
Yes. Pins other those used as analog inputs can be used as input ports.
Note, however, that reading an input port during conversion reduces the conversion accuracy.
|
| |
| Q2 |
This question concerns A/D conversion using the uPD789166.
The user's manual says, "The conversion resolution may drop if a port input instruction is executed during conversion."
To what extent will the resolution drop?
|
| A2 |
The resolution will drop by the extent to which the lowest bit of the accuracy guaranteed by the device is affected.
|
| |
| Q3 |
The uPD789166 User's Manual states that the conversion resolution will drop
if an input instruction is executed on the port that is shared with the A/D converter (P60 to P67) during A/D conversion.
Does this mean the resolution will drop just for the A/D conversion operation that occurs when the input instruction is executed?
|
| A3 |
Yes, only that conversion result is affected.
|
| |
| Q4 |
Why will the conversion resolution drop if a port input instruction is executed during conversion?
|
| A4 |
The amplitude of digital signals is larger than that of analog signals, and therefore digital signals affect surrounding circuits.
In the case of just digital signals, even if the noise generated is large,
there is no negative effect as long as the threshold voltage is not exceeded.
However, in the case of analog signals, there is a direct effect on the surrounding circuits equivalent to the amount of noise generated.
The accuracy of A/D conversion therefore drops due to the noise from the digital signals.
|
 |
|
(2006/04)
|
 |
|
78ad -0010
|
The A/D conversion results in the low-voltage region are not as expected.
|
| Q1 |
Regarding the A/D conversion performance in the uPD780034A with VREF = 5V,
when observing the uPC1093 output while changing the input voltage from 0 to 5V,
the conversion results for input voltages lower than 1.25V
sometimes deviate upward and do not form a linear I/O curve.
|
| A1 |
I do not know the level of the uPC1093's cathode current,
but when Vka = Vref and the load capacitance is large,
there may be a problem in the safe operating area.
Moreover, the minimum level of the reference voltage of the uPC1093 is 2.440V.
Please check whether there is an error in the reference voltage or not.
Also, when using an aluminum electrolytic capacitor,
the capacitance almost entirely disappears for high frequencies.
In this case, use a capacitor that has good frequency characteristics.
For details, refer to the data sheet of the uPC1093.
Furthermore, please check the noise in the analog input signal.
If noise may be a cause, then try adding a ceramic capacitor, referring to the device's UM.
|
78ad -0011
|
What problems are there when changing the A/D reference voltage AVref from 5V to 3.5V?
|
| Q1 |
I would like to change the reference voltage for the uPD780988 (supply voltage of 5V, reference voltage of 5V) to 3.5V.
Are there any cautions or problems I should be aware of?
|
| A1 |
When using an AVref of 3.5V,
the overall error for A/D conversion compared to when using 5V worsens by 50%,
(from TYP: 0.2% FSR to 0.3% FSR), and the other conversion error characteristics also worsen.
For details, refer to the A/D converter characteristics in the data sheet or the user's manual.
Moreover, the conversion time is lengthened from 14us (MIN) to 19us (MIN).
These are the points to be careful about.
|
78ad -0012
|
Is the series resistor string cut off by ADCS0 = 0?
|
| Q1 |
Regarding the A/D converter, is the series resistor string cut off by making ADCS0 = 0 ? (uPD780034A)
|
| A1 |
Yes.
As described in the user's manual,
the current flowing to the series resistor string is cut off by stopping the A/D operation (ADCS0 = 0),
making it possible to lower the current consumption.
|
78ad -0013
|
What happens if I do not connect the dedicated A/D conversion power supply pins (AVDD and AVSS)?
|
| Q1 |
The uPD789101A has two dedicated power supply pins (AVDD and AVSS) for A/D conversion.
Are there cases when these pins are not connected?
|
| A1 |
If these pins are not connected, normal A/D conversion results cannot be obtained.
The current may flow from AVDD via an internal protection diode connected to VDD.
Therefore, it appears as if operation is occurring,
but the result is not guaranteed to always be the same.
|
| |
| Q2 |
I am using the P60/ANI0 to P62ANI2 pins of the uPD789104A as A/D input and the P63/ANI3 pin as an input port.
The P63 pin is pulled up to VDD via a resistor, but the pin level will not rise up.
AVDD is supplied when ANI0 to ANI2 start to be used.
|
| A2 |
A diode is inserted at the ANI pins for protection, so it is not possible to input a voltage higher than AVDD.
In your case, this diode is causing the current input to P63/ANI3 via the resistor to flow to the AVDD side.
Be sure to apply the same voltage as VDD to AVDD even when not executing A/D conversion.
|
 |
|
(2006/04)
|
 |
|
78ad -0014
|
Is it not possible to obtain normal values unless the A/D conversion result is read twice?
|
| Q1 |
The uPD78F0078 has the restriction that "the normal value cannot be obtained unless the A/D conversion result is read twice".
Is there a way to cope with this other than using software?
|
| A1 |
There is no hardware workaround.
Moreover, reading twice is not a countermeasure.
The conversion result when A/D conversion is started may be not normal,
therefore discard this result and use the next conversion result.
Once A/D conversion starts, the second and subsequent conversion results are of normal accuracy,
so as long as the first conversion result after A/D conversion is started (after conversion is enabled)
is discarded, it is OK to read conversion results only once, even when channels are switched.
|
78ad -0015
|
What are the set/reset conditions for the INTAD (A/D conversion end) interrupt flag?
|
| Q1 |
What are the set/reset conditions for the INTAD interrupt flag for the uPD780058?
|
| A1 |
Set occurs when A/D conversion ends or when setting is performed by software.
Reset occurs when the CPU is reset, when clearing by software is performed, or when the INTAD interrupt is acknowledged by the CPU.
|
| |
| Q2 |
What happens to the INTAD flag when CS = 1 is written immediately before the end of A/D conversion?
|
| A2 |
When CS is set to 1 again during A/D conversion, conversion is performed again from the beginning.
|
78ad -0016
|
When using port pins as alternate function (A/D) pins, should the PM register setting be input or output?
|
| Q1 |
When using the pins of port 3 to port 6 of the uPD784038 as their alternate functions,
setting the PM register to either input or output is OK. How about A/D pins?
Is it equally possible to make the mode setting input or output?
|
| A1 |
No it isn't.
In the case of port 3 to port 6, the function is determined by the PMC register or MM register.
In the case of using the pins of port 7 as A/D pins,
specify the input mode using the PM register and disable the output buffer.
A/D conversion itself is performed even if the PM register is set to output,
but a signal input externally will conflict with the microcontroller output.
|
78ad -0017
|
What is the A/D accuracy of the uPD780054?
|
| Q1 |
What is the accuracy of the A/D input block in the uPD780054?
|
| A1 |
The description in the data sheet is as follows.
When TA = -40 to +85°C, AVDD = VDD = 2.0 to 6.0V, AVSS = VSS = 0V
± 0.6% (MAX) when 2.7V ≤ AVREF0 ≤ AVDD
± 1.4% (MAX) when 2.0V ≤ AVREF0 < 2.7V
|
|
78ad -0018
|
What is the A/D converter accuracy during low-voltage operation?
|
| Q1 |
For the A/D converter of the uPD789104A, the overall error for the range of
2.7 to 5.5V is ±0.6% MAX.
What is the overall error for the range of 1.8 to 2.7V?
|
| A1 |
The overall error for the range of 1.8 to 2.7V is ±1.2% MAX.
|
| |
| Q2 |
Is the accuracy of the A/D block of the 78K0S superior to that of the 75XL Series,
such as the uPD750064?
|
| A2 |
The accuracy of the A/D block of the uPD750064 is 3LSB, so consider it to be
almost the same.
|
78ad -0019
|
Equivalent circuits of A/D converter
|
| Q1 |
What is the equivalent circuit of the A/D converter block of the uPD78002x?
Also, what is the sampling time?
|
| A1 |
Actually, it is not a simple RC circuit, but the following equivalent circuit
of an A/D converter is comparatively close to this product.
To fully charge the internal capacitance, it is necessary to drive using a lower
impedance.
Moreover, the charging time is approximately 1/8 of the A/D conversion time.
(This is not a guaranteed value and should be treated as a reference only.)
|
78ad -0020
|
How much is the impedance of an A/D input pin?
|
| Q1 |
In the uPD784031, when using a type 20-A pin in the data sheet as an A/D pin,
how large is the input impedance?
|
| A1 |
The impedance of this pin changes over time.
Moreover, the sampling capacitor's capacitance is in the order of a few pF.
During sampling, a current flows in order to charge the capacitor, but normally
it is just leakage current.
Therefore, the impedance fluctuates according to the status.
This A/D pin must be driven using a low impedance in the order of just a few
kΩ.
This is because, during sampling, the sampling capacitor for conversion must
be charged within the A/D accuracy.
A high accuracy cannot be obtained when the drive impedance is high.
|
78ad -0021
|
What is the capacitance of capacitors that can be connected to the A/D pin?
|
| Q1 |
What is the capacitance of the electrolytic capacitor that can be attached to the
A/D input port for the uPD789166/uPD78F9177?
|
| A1 |
Connecting a large electrolytic capacitor to an analog input is not a problem
in itself.
However, when a capacitor is connected, the pin voltage may exceed the power
supply voltage at power ON/OFF due to the influence of the electric charge accumulated
in that capacitor.
To prevent this, be sure to add a diode to release this electric charge. (Refer
to the User's Manual.)
|
78ad -0022
|
What is the maximum current that flows from the D/A converter's output pin?
|
| Q1 |
What is the maximum current per channel (ANO0, ANO1) for the internal D/A converter
of the uPD784214 and uPD78F4216?
|
| A1 |
Basically, no current flows in this D/A converter.
This D/A converter consists of an R-2R resistor ladder.
Therefore, the internal resistor is about 5.3kΩ as standard, and the
resistor is connected in series with the AVref1 impedance.
Therefore, the level changes sharply when current is applied, resulting in lower
accuracy.
It is not recommended to let current flow through the D/A output.
It is necessary to receive the signal with a high impedance of about 10MΩ.
(Refer to description of overall error conditions in the Data Sheet.)
|
78ad -0023
|
How to sample 8 analog inputs almost simultaneously [78K4]
|
| Q1 |
What
is a good way of sampling 8 analog inputs (ANI0 to ANI7) almost simultaneously
in the uPD784217A?
|
| A1 |
In the PD784037, this can be done using the scan mode and macro function. However,
because the uPD784217A does not have a scan mode, you should use the macro service.
Start up the macro service using the A/D conversion end interrupt and write
the value of the next channel to ADIS.
The conversion result cannot be read by this processing alone, so set the conversion
count to one and set VCIE to 0 to make the A/D conversion interrupt occur immediately.
Of course, it is then necessary to execute processing to read out the A/D result,
set the next ADIS data, and set ISM and MSC to 1 via this interrupt servicing.
(If you use type B, ADIS values are input serially to the memory, so they do
not have to be set each time.)
With this processing, the specification of the next channel is made by the macro
service, and reading out of the conversion result is done via a normal interrupt.
However, because there is a strict time limit on this interrupt servicing, it
is impossible to judge whether this method is viable without sufficient evaluation
of the A/D conversion time and the processing time.
|
 |
|
(2006/04)
|
 |
|
78ad -0024
|
Conversion processing time [780034A Subseries]
|
| Q1 |
Is it possible to start up the uPD78F0034A from the standby state via an external
interrupt and complete an operation to read the A/D converted voltage within
10 ms?
|
| A1 |
Yes, it is possible.
In the case of 10 ms, this processing is even possible in STOP mode by using
a ceramic resonator.
|
| |
| Q2 |
What is the processing time in HALT mode?
|
| A2 |
The time required for different kinds of processing is shown below.
| Processing |
Number of Clocks |
Conditions |
| Time until interrupt acknowledgment |
About10 |
|
| A/D startup processing |
7 |
|
| Time for 1st A/D conversion |
144 |
uPD78F0034B, 12MHz, 4.5V |
| 120 |
8.38MHz, 4.0V |
| 96 |
5MHz, 2.7V |
| Time required for two A/D conversions |
288 |
uPD78F0034B, 12MHz, 4.5V |
| 240 |
8.38MHz, 4.0V |
| 192 |
5MHz, 2.7V |
| Processing waiting due to asynchronicity of CPU
and A/D converter (with one cycle as worst case) |
144 |
uPD78F0034B, 12MHz, 4.5V |
| 120 |
8.38MHz, 4.0V |
| 96 |
5MHz, 2.7V |
| Waiting for 2nd conversion end interrupt(*1) |
10 |
|
| Readout of conversion value |
8 |
|
By totaling these, an approximate time can be calculated as follows.
| Number of Clocks |
Processing Time |
Conditions |
| 467 |
About 40us |
uPD78F0034B, 12MHz, 4.5V |
| 395 |
About 50us |
8.38MHz, 4.0V |
| 323 |
About 65us |
5MHz, 2.7V |
(*1)
This processing is also required for the first conversion end interrupt,
but because in terms of time this processing is executed in parallel with
the second conversion operation, only the second interrupt appears in the calculation.
|
 |
|
(2006/04)
|
 |
|
78ad -0025
|
Reference voltage setting [780034A]
|
| Q1 |
I understand that the voltage to be A/D converted must be between AVss and AVref,
so is it possible to input 1 V to AVss and 4 V to AVref, and convert 3 V,
which is between AVss and AVref, at a resolution of 256?
|
| A1 |
No, this is not possible.
AVss must be the same potential as Vss.
AVss not only can be used as the reference potential for external analog input,
but can also be used internally as the reference potential for the digital circuit interface.
It is therefore not possible to connect AVss and Vss to different potentials.
|
 |
|
(2006/04)
|
 |
|
78ad -0026
|
Non-generation of A/D conversion end interrupt [All 78K]
|
| Q1 |
I created the following program using the uPD789177Y and tried to execute A/D conversion,
but the interrupt request flag would not become set.
ADM0 = 0x28;
ADS0 = 0x00;
ADMK0 = 0;
ADCS0 = 1;
EI();
while(ADIF0 == 0) ;
|
| A1 |
There
is a problem with this program.
The A/D conversion end interrupt mask is released and the CPU is set to the interrupt enabled status.
In this state, an interrupt will be acknowledged, at which point the interrupt request flag ADIF0 will
be cleared.
ADM0 = 0x28;
ADS0 = 0x00;
ADMK0 = 1;
ADCS0 = 1;
EI();
while(ADIF0 == 0) {
NOP();
}
ADIF0 = 0;
|
 |
|
(2006/04)
|
 |
|
|