I'm writing a program to output a stair step waveform from VoutA. How do I tell PORTP to output 2 volts?

#include 	"d:\miniide\hc12.inc"
		
		org	$1000
		ldaa	#$FF
		staa	DDRP		; configure PORTP for output
		ldaa	#$6F
		staa	DDRCAN	; configure PCAN6..PCAN5 for output
		bclr	PORTCAN,$20 ; select VOUTA output

		xx	xxxxx  ; need to know how to output 0 volts
		bclr	PORTCAN,$40 ; generate a rising edge on PORTCAN6 pin
		bset	PORTCAN,$40 ;		"
		jsr	delay

		xx	xxxxx  ; need to know how to output 2 volts			
		bclr	PORTCAN,$40 ; generate a rising edge on PORTCAN6 pin
		bset	PORTCAN,$40 ;	
		jsr	delay

		xx	xxxxx	; need to know how to output 4 volts			
		bclr	PORTCAN,$40 ; generate a rising edge on PORTCAN6 pin
		bset	PORTCAN,$40 ;	
		jsr	delay

		end

Is there any other information I can provide on this question. I just need the syntax and opcode to output different levels on PORTP, 0, 2 and 4.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.