Tuesday, 5 April 2016

DAC interfacing with 8086

Q: Write a ALP to interface DAC with 8086.

Software: Minicom
OS: Fedora(Linux-64 bit)



;mov al,01 = start of conversion from digital to analog
;67 address of command word register
;61 address of A
;63 address of port B
;65 address of port c


Dyna-86>A 4000        ;delay procedure                                                          
0000:4000  MOV CL,FF                                                            
0000:4002  DEC CL                                                               
0000:4004  JNZ 4002                                                             
0000:4006  RET 

;DAC Square Wave
Dyna-86>A 2000                          
0000:2000  MOV AL,80  ;port A acts as the output port                  
0000:2002  OUT 67,AL
0000:2004  MOV AL,01
0000:2006  OUT 63,AL
0000:2008  MOV AL,00                                                            
0000:200A  OUT 61,AL                                                            
0000:200C  CALL 4000 ;delay                                                            
0000:200F  MOV AL,FF                                                            
0000:2011  OUT 61,AL                                                            
0000:2013  CALL 4000                                                            
0000:2016  JMP 2008                                                             
0000:2018  INT 3                                                                
0000:2019                                                                       

;Staircase Wave
Dyna-86>A 3000                                                                  
0000:3000  MOV AL,80                                                            
0000:3002  OUT 67,AL                                                            
0000:3004  MOV AL,01                                                            
0000:3006  OUT 63,AL                                                            
0000:3008  MOV AL,00 ;0 Volts                                                            
0000:300A  OUT 61,AL                                                            
0000:300C  CALL 4000                                                            
0000:300F  MOV AL,7F    ;2.5 V                                                        
0000:3011  OUT 61,AL                                                            
0000:3013  CALL 4000                                                            
0000:3016  MOV AL,FF    ;5 V                                                        
0000:3018  OUT 61,AL                                                            
0000:301A  CALL 4000                                                            
0000:301D  MOV AL,7F    ;2.5 V                                                         
0000:301F  OUT 61,AL                                                            
0000:3021  CALL 4000                                                            
0000:3024  JMP 3008                                                             
0000:3026  INT 3                                                                
0000:3027

Triangle Wave Generator

Dyna-86>A 7000 
0000:7000  MOV AL, 80
0000:7002  OUT 67, AL
0000:7004  MOV AL, 01
0000:7006  OUT 63, AL
0000:7008  MOV AL, 00
0000:700A  OUT 61, AL
0000:700C  INC AL
0000:700E  CMP AL, FF
0000:7010  JNZ 700A
0000:7012  OUT 61, AL
0000:7014  DEC AL
0000:7016  JNZ 7012
0000:7018  JMP 7008
0000:701A  OUT 61, AL
0000:701C  JMP 7008
Dyna-86>G 7000


Ramp Wave or Sawtooth wave Forward
Dyna-86>A 6000                                                                  
0000:6000  MOV AL,80                                                            
0000:6002  OUT 67,AL                                                            
0000:6004  MOV AL,01                                                            
0000:6006  OUT 63,AL                                                            
0000:6008  MOV AL,00                                                            
0000:600A  OUT 61,AL                                                            
0000:600C  INC AL                                                               
0000:600E  CMP AL,FF                                                            
0000:6010  JNE 600A                                                             
0000:6012  OUT 61,AL                                                                                                                            
0000:6014  JMP 6008                                                             
0000:6016  INT 3                                                                
0000:6017

No comments:

Post a Comment