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.

Pic16f690 - detecting RF signal and leds

Status
Not open for further replies.

Mr Oriel

New Member
Hey fellas, I'm not too familiar with programming in C for the PIC16F690 -

I'm hoping I could get some pointers for the Pic16f690 I'm utilizing in my Control Circuit .. from the Rf detectors, linked to the Pic via 3x2 header , so the idea is that a comparator program, which monitors the 3 inputs, determines which one is the strongest reading and then lights up the led accordingly in that direction (3 leds on the board).

Correct me if I'm wrong, but if I were doing this :

TRISC=0x00; //Ensure pins 14,15,16 are input
ANSEL|=0x70; //Enable pins 14,15,16 for analoge input
TRISX reigister, where X is replaced with the port letter it is connected to?
TRISA=0x02; for pin 17 (as per my schematic)


If anyone can offer guidance / feedback, that'd be awesome ..
I've attached the control circuit project from Altium (if that helps :p )
 
Go have a look at the Pickit2 LPC lessons. The one on the ADC is what you are lookng for. Once you have that working it's prob easiest just to read in the MSB/LSB of the ADC and do some simple subtractions (and bit test the carry bit) to bubble sort the solution.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top