#include "c:\miniide\hcs12.inc" org $1500 movb #$FF,DDRB ; configure PORTB for output bset DDRJ,$03 ; configure PJ1~PJ0 for output bclr PTJ,$02 ; select VOUTA output loop inc PORTB ; increase the output by one step bclr PTJ,$01 ; generate a rising edge on PJ0 pin bset PTJ,$01 ; " bset PTJ,$01 ; add 9 more “bset” instructions to provide 2 ms bset PTJ,$01 ; for D/A conversion to complete bset PTJ,$01 ; " bset PTJ,$01 ; “ bset PTJ,$01 ; “ bset PTJ,$01 ; " bset PTJ,$01 ; “ bset PTJ,$01 ; “ bset PTJ,$01 ; “ bra loop ; to complete the D/A conversion end