AnsweredAssumed Answered

Setting DAC output on aduc842.

Question asked by Marcomartinelli1 on Dec 21, 2012
Latest reply on Dec 22, 2012 by Marcomartinelli1

Hello.

 

I have some problems regarding the set of the dacs output on a aduc842.

I clear the output at the start part of the program and after I cannot set

anymore the outputs of the dacs.

Should I disable the interrupts during the writing on the dacs sfr ?

Is the procedure below correct?

 

 

SETUP:

      ;SETUP UART FOR ADUC 842

      MOV    T3CON,#083H

      MOV    T3FD,#02DH

       MOV     SCON,#52h

 

 

     MOV   DACCON,#01Fh  ;SET BOTH DACS ON , 12 BIT , ASYNC

     MOV   DACOH,#OOH    ;SET  OUTPUT ON DAC0 TO 0 VOLT

     MOV   DACOL,#OOH


     MOV   DAC1L,#OOH    ;SET OUTPUT ON DAC1 TO 0 VOLT

     MOV   DAC1H,#OOH



 

MAIN:

 

      LCALL GETCHAR       ; GET A BYTE FROM UART

      ANL A,#0FH               ; MASK HIGH NIBBLE

      MOV DACOH,A          ; PUT ON DAC SFR

      LCALL GETCHAR

      MOV DAC0L,A

     

      JMP MAIN


    

GETCHAR:

 

       JNB RI,$

       MOV A,SBUF

       CLR RI

       RET

Outcomes