Pic output low signal

Status
Not open for further replies.

Thanks again for all the Patience,

I don't intend changing or interfering with the crystal oscillation .
What I want to do is as follows:
Using the clock out pin of the pic as the clock for the SPI protocol and using the same
output to connect to a inductor and from there to the SPI receiver pin and then compare
to the previous result.

The reason i want to use a SPI protocol is because as I see it oscillating a freq.
via a PIO is implemented by clearing and setting a single bit and in order to be able
to see changes in the freq. a register result is need and not a bit change.
I'm attaching a code which I thought of using in the first place for implementing the idea
and I didn't see any way for the part of getting the change of frequency information.


I hope I'm clear enough, Amitai

Code:
		LIST P=PIC16F877
		include <P16f877.inc>

		org			0x00
reset:	goto		start

		org			0x04
start:	bcf			STATUS, RP1
		bsf			STATUS, RP0		;bank 1
;------------------------------------------------------------------------------
		movlw		0xFE
		movwf		TRISC			;portC: RC0-Output
;------------------------------------------------------------------------------
		bcf			STATUS, RP0		;bank 0

LOOP:	bsf			PORTC,0			;RC0 = '1'
		call		DELAY_1m
		bcf			PORTC,0			;RC0 = '0'
		call		DELAY_1m
		goto		LOOP

;------------------------------------------------------------------------------

DELAY_1m:
		movlw		0x2f			;  N1 = 47
		movwf		0x30
cont2:	movlw		0x10			;  N2 = 16
		movwf		0x31
cont1:	decfsz		0x31,1
		goto		cont1
		decfsz		0x30,1
		goto		cont2
		return						

;------------------------------------------------------------------------------

		end

- - - Updated - - -

I have now also a PIC16f88 which has an internal osc. and using it
I can be sure that I don't change somehow the pic's routine freq. , and it
seems to have the same functions which I need as the PIC16f877

Amitai
 

If the PIC has hardware SPI then it will generate clock for slave.
 

TO make it more simple: create a frequency by the pic and receiving a frequency by the pic. (the compare can be left out in
the mean time)

Amitai
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…