Home

Application circuit of ADuC812 Microcontroller

Application circuit of ADuC 812 Microcontroller

Abstract :ADµC812 as a new generation of microcontrollers, with powerful than the previous single chip has a broader application. Found in practical applications , the chip itself, there are still some problems and should pay attention to the special requirements of use . This summary of these issues for readers to reference . Keywords :SPI -line debugging data conversion Introduction ADµC812 is a highly integrated high-precision 12-bit data acquisition system , its function block diagram shown in Figure 1 . Can see from the figure , the chip not only integrates the re- programming non-volatile flash / electrical erase program memory , high-performance 8-bit ( with 8051 -compatible ) MCU, also includes high-performance 8-channel ADC and self-calibration 2 -channel 12-bit DAC. As with all 8051 -compatible devices with the same , for program and data memory , ADµC812 have their own separate address space : 64KB external program address space and 16MB external data address space. However, unlike other devices , which includes on-chip flash memory technology to provide users with 8KB of flash / electrical erase program memory , 640B of the flash / electrical erase data memory . The chip integrates all the auxiliary function blocks to full support for programmable data acquisition core . The auxiliary function blocks include a watchdog timer (WDT), power supply monitor (PSM) and the ADC DMA function . In addition, multi- processor interface and I / O expansion offers 32 programmable I / O lines , I2C compatible with standard SPI and UART serial port. Different from previous 80C51 microcontroller , ADµC812 unique online debugging and download from the support of the development kit ADµC812 QuickStart development system to provide . In other words, the user system to retain ADµC812 circumstances, through the development of the serial communication system and ADµC812 can be directly on the user system debugging , and commissioning, will have to debug in a good program to the ADµC812 . Although the excellent performance with the above ADµC812 , but because it is a new micro- controller, compared with the previous MCU in use , there are many differences . Therefore, during ADµC812 system development application, there are still many problems that need attention . Now, our product development in the application of ADµC812 found some of the attention of the problems and their solutions below. Problems with the application 1 . online debugging Notes ADµC812 and other SCM prominent difference is the development of systems to support its different . QuickStart Development System is to support the development of ADµC812 kit , perfect function, including downloading , debugging, and simulation and so on . (1) RS232 interface circuit For users to develop systems for online debugging and download the most important, is the most commonly used , but both had to go through the serial port on PC, the UART serial port with ADµC812 connection between the serial port data cable Communication to work. Therefore , users in the development of applications , it should also design an RS232 interface circuit ( shown in Figure 2 ) to achieve and ADµC812 PC- Serial communication . As the PC- RS232 Interface Circuit is the only development system and user access , so it is online debugging and downloading capabilities to achieve the key . The development of the user's system development process , often appear online communication failure. Cause of the phenomenon for many reasons , but most likely the work exceptions are generated by the interface circuit . RS232 interface circuit to judge whether the work properly, according to the following steps one by one, check the RS232 communication is normal . ? V + and V- pin voltage is high enough ( more than +8 V , respectively , and -8V). If the voltage is low , it may ADM202 chip has been damaged . ? R1IN ± 12V of the existence of foot pulses . If there are instructions to send the signal PC, the normal aspects of communication . ? R1OUT feet if there +5 V signal . If there is , it indicates ADM202 receiving PC, the signal is working properly . ? T1IN feet if there +5 V signal . If there are instructions on the PC, communication ADµC812 generated response; otherwise it is ADµC812 communication problems , indicating ADµC812 not working properly . ? T1OUT ± 12V of the existence of foot pulses . If it exists, but can not access online ADµC812 debug state , it indicates DB9 and the PC serial interface cable between the machine in question . Click to enlarge (2) PSEN pin User system with RS232 interface circuit , the need to ground through a 1kO resistor connected to the PSEN pin is pulled to ADµC812 low (see reference [ 1] , [ 2]) , to enter the online debugging and download status . Therefore , PSEN pin down is online debugging and download the key to achieving the other . It is worth emphasizing , PSEN pin and the 1kO resistor connected between ground does not necessarily guarantee that PSEN is low . If the PSEN pin damage caused by static , then the 1kO resistor can not be PSEN pin down . The test proved that the PSEN pin injury is not serious, can be direct -to-ground short-circuit the PSEN be pulled to low ; if serious injury , even if the direct ground , the device still does not work . Therefore, the use of ADµC812 should be particularly careful to guard against static electricity . Such as electric soldering iron soldering chips should be grounded , and wear anti-static bracelet . As ADµC812 debugger is detected in the user's system when the PSEN pin reset state , and therefore the probability of success to improve the communication can be instantly reset the user's system will PSEN pin directly to ground short circuit . But ADµC812 chip debug or download the state into line after , PSEN pin through the 1kO resistance grounding should . Of course, if procedures need to download the offline operation , PSEN pin should be disconnected with the 1kO pull-down resistor , otherwise , ADµC812 will always remain online debugging state . (3 ) resource consumption issues ADµC812 with three 16-bit timer / counters , namely: Timer 0, Timer 1 and Timer 2 . Each timer / counter includes two 8-bit registers THX and TLX (X = 0,1 and 2). All three timers / counters can be configured as a timer or counter , this function and the same as a SCM . As with other MCU different , ADµC812 with online debugging features , so chip in the line of work under some of the features will be limited. This is because the online debugging, communication between computers and chips take up some resources lead . Proven , Timer 1 is one of the resources are occupied . If the user debug the program online using the timer 1, then either set breakpoints or single step or continuous operation , there will be the implementation of the program can not happen . However, if the program timer 1 blocked, the program can run correctly and achieve the intended function of the user . Of course , online debugging program can use the Timer 0 and Timer 2, because they were not occupied . Although the online debugging, Timer 1 can not be used , but it does not mean that users can not use the timer in the user's system . Users can first use the timer 0 to achieve intended function , the debugging passed, and then use Timer 1 to achieve ; Timer 1 can also be achieved directly , but only blind transfer , after due process must be downloaded to run offline . 2.A / D converters use ADµC812 conversion module within the integrated ADC , includes 8-channel , 12-bit , single-supply A / D converter, the A / D converter is based on the conventional capacitor DAC composed of successive approximation converter , receiving the analog input range 0 to + VREF (+2.5 V). In addition, this module also provides users with on-chip reference , calibration features , all components within the module can easily register by 3 SFR interface settings . In short , ADµC812 the ADC module has to be compared with the general performance of ADC chip , and simple operation , high reliability, sampling rate up to 200kHz. (1 ) reference voltage A / D converter 's 2.5V reference voltage can be provided by the chip , an external reference may also be driven by the VREF pin . If using internal reference , VREF and CREF are in between the pins and AGND should be connected 100nF capacitor for decoupling . The decoupling capacitor should be placed close to the VREF and CREF pin . In order to achieve the required performance , it is recommended to use an external reference , the benchmark should be between 2.3V and the analog power supply AVDD . As the on-chip benchmark of precision, low drift and calibration by the factory , and when the ADC or DAC is enabled , the VREF pin will appear in this reference voltage . Therefore, when carrying out system extensions can be on-chip 2.5V reference benchmark as a power source to use . Removal of a micro -chip benchmark used within the converter should be buffered in the VREF pin and AGND should be connected between this pin and the 100nF capacitor . In practice, special attention should be the internal VREF will remain until the ADC or the DAC power-down module of the peripheral equipment is their respective power- up enable bit . (2 ) analog input Compared with other ADC chip , ADµC812 the ADC module has a shortcoming, which is normal ADC analog input range is 0 ~ +2.5 V; while allowing the input voltage range can only be a positive voltage (0 ~ +5 V). The experiments show that if the analog input voltage exceeds +2.5 V ( max +5 V), ADC sampling results for the maximum (0FFFH), although the results wrong, but did not affect normal work ADµC812 ; However, once the negative input Analog voltage , it will affect the ADµC812 work , the performance of the ADC 's reference voltage (VREF = +2.5 V) disappears and the sample result is not correct, and if the time input negative voltage , it may damage the chip . Thus, in practice, if found to start the ADC VREF after the end of no voltage , you should immediately reset the chip , and check the analog input signal amplification part of the collection . To ensure that the analog signal into ADµC812 0 ~ +2.5 V range , the order to re- start the ADC. Practical application, should ensure that the analog input voltage is positively charged flat . 3 . Parallel I / O ports of the use of Like other single chip , ADµC812 has four general-purpose data port (P0 ~ P3) to exchange data with external devices , and in addition be used as general-purpose I / O , the ports can achieve some external memory operation . Other ports and devices are the other functions multiplexed peripherals . (1) P1 port It is noteworthy that , in ADµC812 in port 0,2 and 3 are two-way port, 1 is the only input . As can be seen in Figure 3 in the P1 port of the circuit includes a bit latch and input buffer , but there is no output driver , so I can only be configured for P1 digital input or analog input , not for export . When used as an analog input port P1 , which corresponds to ADµC812 8-channel analog-digital conversion within the input port ADC0 ~ ADC7. If in actual use , no need to use both 8 -channel ADC , the remaining P1 can be set to digital input port pins , but it should be noted at this time , it used the standard 8051 universal digital input I / O port different that the high effective . Therefore , P1 port for digital input, whether the input signal is detected before , shall write to the corresponding port 0 , and then judge . This requires the system design should be used as digital input port P1 plus a pull-down resistor , typically a few kO. (2) P2 I As mentioned earlier , ADµC812 the P2 port is bi-directional ports , including input buffers and output latches and output drivers . Mouth with the corresponding port P2 SFR, can be the mouth of the port pin P2 independently configured to digital inputs or digital outputs , and read them , write access . The P2 and the general population in general-purpose MCU I / O port usage of the same . However, the external data memory access ADµC812 time , P2 is used not only to the output port 8-bit addresses (A8 ~ A15), but also for high output 8-bit address (A16 ~ A23), this usage is similar to P0 port . The difference is , P0 port is the data and address bus multiplexing, and the P2 port is in place , high byte address bus multiplexing . Therefore , P2 port used for external expansion data memory capacity , they should adopt a latch to latch high byte address , as shown in Figure 4 . 4 . external addressing the problem Different from other SCM , ADµC812 has 24 address lines . It can address the external data memory space 16MB, this large -capacity storage to meet the needs of many applications . As the external data memory space up to 16MB, for inter- site use only DPTR register is not enough. Therefore , ADµC812 the data pointer by three 8-bit registers , namely DPP ( page byte register ), DPH ( high byte register ) and DPL ( low byte register ), conducting internal and external code to access or When the external data access by them to provide memory addresses . Like other single chip , DPTR is still two registers by the DPH and DPL to form , and use the same; while the DPP is the highest for the A23 ~ A16 send 8-bit address registers , which is equivalent to If we register each external data into 64KB 1 , different DPP values will correspond to a different page , so named for the page register . 5.SPI serial port on the impact of P3 To facilitate the MCU to communicate with various peripheral devices , ADµC812 provides three serial I / O Ports : UART interfaces , I2C -compatible serial interface and serial peripheral interface (SPI). Which , SPI interface is the industry standard synchronous serial interface , which allows MCU with a variety of peripheral devices to the serial mode (8 -bit data while simultaneously being sent and received ) to communicate. Because you can only use four lines with a direct interface to a variety of standard peripheral devices , therefore , SPI serial communication interface has a wide range of applications . However, we are using the SPI serial ADµC812 to communicate , find it with other chips (with SPI serial port function) is different from the SPI serial port P3 will enable the impact , and its behavior as : whether the actual input port P3 Why is the value of peace , P3 port internal latch are identified as high , so the program such as judgments of JB or JNB transfer instructions will lapse. This shows that , SPI serial port P3 will only be enabled as an output port to use . Therefore, at the same time using the SPI serial port for input and P3 , in order to avoid the error occurred , must be detected in each input port P3 will be before the SPI serial prohibited . Conclusion ADµC812 as a new type of micro- controller, microcontroller could be compared with the general power of . It is within the integrated 8-channel ADC and dual 12-bit precision DAC, so that it can be very effective in simplifying the data acquisition system part of the instrument , while it provides three types of serial communication , all kinds of serial devices to meet the interface . It can download online debugging and user-friendly system greatly developed . Exploration and applications over a period of time , we have basically mastered the various functions ADµC812 , gained some experience and lessons learned , this paper aims to provide users with reference information .