# pic16f690

#### huida__huida

Joined Apr 18, 2014
7
how to make pic16f690 run because I put the program but when I put it in vcc and ground not work please show me

#### BobTPH

Joined Jun 5, 2013
5,768
1. Show us the entire circuit. What you described might not run for multiple reasons if those are the only coonections.

2. What are the configuration settings? Most notably the oscillator selection.

Bob

#### MrChips

Joined Oct 2, 2009
27,129
Make a list of all the things that can happen that will prevent it from running.

#### jpanhalt

Joined Jan 18, 2008
11,088
1) What is the program supposed to do? Did you write it or get if off the internet?
2) Can you show the code? If you only loaded a hex file, even posting that might help.

Joined Jul 18, 2013
25,982
There are 20 options for the oscillator in the config for the 16f690.
What is yours set to?
Max.

#### huida__huida

Joined Apr 18, 2014
7
Code:
unsigned int x;
unsigned int y;
float pospot;

void main() {
//ANSEL=0X4;
TRISA=0XFF;
//ANSELH=0;
TRISB=0;
do{
pospot=5.0*y/1023;
portb.f4=1;
portb.f5=0;
portb.f6=1;
portb.f7=0;
}
portb.f4=0;
portb.f5=1;
portb.f6=0;
portb.f7=1;
}
portb=0;
}
}while(1);
}

Last edited by a moderator:

#### huida__huida

Joined Apr 18, 2014
7

#### jpanhalt

Joined Jan 18, 2008
11,088
Oscillator selection has nothing to do with the code you posted, except if you use an external crystal, that will be on PortA and will require RA4 to be an output. Presumably, you are also using PortA for analogue input/ADC. You have not initialized PortC. It is set as an analogue input on all pins.

For the oscillator, which do you plan to use:

An internal oscillator (i.e., choices 7 or 8) is often easier to use, and I would recommend selection 8 unless you need the oscillator output for something else.