题目:把一个1mhz的脉冲通过两次分频转换成1hz的方波。(通道0、通道1、通道2、控制字地址 分别为280h,281h,282h,283h)
答案:
code segment
assume cs:code
start:mov dx,283h
out dx,00110111b;选中通道0,工作在3方式下,对bcd码自减
mov dx,280h
mov al,0h
out dx,al
mov al,10h
out dx,al
mov dx,283h
out dx,01110111b;选中通道1,工作在3方式下,对bcd码自减
mov dx,281h
mov al,0h
out dx,al
mov al,10h
out dx,al
code segment
end start
注:连线:clk0-1mhz
gate0-"1"
out0-clk1
gate1-"1"
out1-逻辑笔