Songhan SN8P2711 2722 ADC initialization program and application-assembly source code

Source: Internet
Author: User

/* Songhan SN8P2711 2722 ADC initialization program and application instance */INIT_ADC: MOVA, #0XB2 // start the ADC circuit to enable AIN channel B0MOVADM, AMOVA, # 0XF0B0MOVADR,; fad = 1/2 Fcpu sets the ADC conversion rate; MOVA, # 0X1C for a pure analog input port; P4.2 3 4 for a simulated AD port B0MOVP4CON, a ret // --- application instance -----//****************************** * ******** // Function Name: READAD1 // function: Read AD value // entry parameter: NONE // exit parameter: none //************************************* ** READAD1: MOVA, #0XF3; select 3 channels to convert B0MOVADM, AMOVA, # 0X00B0MOVADR, ACALLDLY100U; latency; Start ad A_AD1: latency; wait until the conversion ends B0MOVA, ADBMOVT_NTCM,; the conversion value to the adserver is 8 bits in height.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.