Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help..How to use LM95071 with pic micro

Status
Not open for further replies.

Shohadawy

New Member
I want somebody to give me an advice about using the LM95071 as a temperature sensor in a temperature control circuit that is pic-based
 
Is this your final year project?

When is it due in?

Have you searched Google
 
This reads 16 bits on an SPI device.
The initialisation needs to set tncs and tsc as outputs, and tsio as an input.
This routine is called each time you want to read the temperature.


Code:
readtemp

	bcf	tncs_port, tncs	;starts on high to low edge
	movlw	0x10
	movwf	count1		

read_bit

	rlf 	temp_lsb, f
 	rlf 	temp_msb, f		;rotates both bytes left
							
	bsf 	tsc_port, tsc		;raise clock

	bcf 	temp_lsb, 0		;clear bit 0
	btfsc	tsio_port, tsio		;check data from LM95071
	bsf 	temp_lsb, 0		;set bit 0 if data is set

	bcf 	tsc_port, tsc		;lower clock


	decfsz	count1, f		;decrement counter
	goto	read_bit		


	bsf 	tncs_port, tncs		;raise Not Chip Select = stop LM95071

	return
 
OK ,I'm sorry that I've disturbed you... but it's up to you if you don't want to answer my disturbing questions
 
He's already answered, your question, read the link in Wikipedia and don't use such an obscenely large font.
 
Shohadawy said:
OK ,I'm sorry that I've disturbed you... but it's up to you if you don't want to answer my disturbing questions

We prefer a larger font, sometimes color works. We're unlikely to do your homework for you, but many work for cash ;)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top