Course Design: Single Chip Microcomputer DA Conversion

Publisher:daits摸鱼的Latest update time:2016-09-13 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Course Design: MCU DA Conversion - gududesiling - suixin

 

//Here we use a single buffer mode, the microcontroller sends the DAC0832 every 1s

//The output voltages of the five data 3FH, 7FH, F0H, 0FFH, and 00H change cyclically.

//This program must set up the circuit diagram, and all DA pins are set in working state

 

   ORG 0000H

       AJMP MAIN

 

   ORG 0030H

MAIN:

   MOV A,#3FH

   MOV P0,A

   SETB P3.6 ;WR1 falling edge to convert

   CALL DELAY

   CLR P3.6

   CALL DELAY

  

   MOV A,#7FH

   MOV P0,A

   SETB P3.6

   CALL DELAY

   CLR P3.6

   CALL DELAY

 

   MOV A,#0F0H

   MOV P0,A

   SETB P3.6

   CALL DELAY

   CLR P3.6

   CALL DELAY

 

   MOV A,#0FFH

   MOV P0,A

   SETB P3.6

   CALL DELAY

   CLR P3.6

   CALL DELAY

 

   MOV A,#00H

   MOV P0,A

   SETB P3.6

   CALL DELAY

   CLR P3.6

   CALL DELAY

  

   AJMP MAIN

 

DELAY: ; Delay function

   MOV R4,#5

L3:MOV R5,#100

L2:MOV R6,#250

   DJNZ R6,$

   NOP

   NOP

   DJNZ R5,L2

   DJNZ R4,L3

   RET

 

   END

Reference address:Course Design: Single Chip Microcomputer DA Conversion

Previous article:Course Design: Matrix Keyboard (c51, implemented using scanning method)
Next article:Course Design: Key Counter (Assembly)

Latest Microcontroller Articles
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
    Since development under LINUX is still quite troublesome, is there a more convenient and simple development method under WINDOWS? The answer is yes. Of course, it is not a development tool like ADS, because it ...
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
  • Learn ARM development(18)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号