0

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
1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by laguna92651
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.