Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Pic output low signal

Status
Not open for further replies.
Hi,

All communications like USART, SPI, I2C need exacting timings to be able to work with the devices they connect to.

Your best way forward is to look for a Pic project that does the detecting but from a standard port pin/s so allowing you to use a proper crystal as the main oscillator which then allows you to run the program code and communications properly.

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
 

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top