# pic16f882

Status
Not open for further replies.

#### birdman0_o

##### Active Member
Hey guys,

I just wasted 2 hours trying to get an LCD to work on PORTA of this chip. I switched it to PORTC and then it worked fine...I checked the DS and couldnt see any possible issues. Could somebody enlighten me?

ANSEL was cleared.
Is CMCON cleared by default? thats the only thing I didnt try...

#### Smartie

##### Member
Hey guys,

I just wasted 2 hours trying to get an LCD to work on PORTA of this chip. I switched it to PORTC and then it worked fine...I checked the DS and couldnt see any possible issues. Could somebody enlighten me?

ANSEL was cleared.
Is CMCON cleared by default? thats the only thing I didnt try...

you mean comparators? no, by default they are on, consult the datasheet to find the value that switches them off.

#### Pommie

##### Well-Known Member
The comparators are off by default. I can't see any reason it wouldn't work on PORTA.

Edit, are you sure you accessed ANSEL/H in the right bank. They are in bank 3 on this chip.

Mike.

Last edited:

#### Smartie

##### Member
The comparators are off by default. I can't see any reason it wouldn't work on PORTA.

Edit, are you sure you accessed ANSEL/H in the right bank. They are in bank 3 on this chip.

Mike.

Are you sure?
I always have to include
Code:
	movlw	0x07
movwf	CMCON			;turn comparators off
at the start of my programs when ever i program on the 16F628A to get porta to work right

Last edited:

#### birdman0_o

##### Active Member
Yea, im not using the 628A though, the 88X series takes care of that
Yea i have no clue either mike!

I soldered up the clock to get it off the breadboard, everything works EXCEPT!
Now it displays every number except 1 and 4?!?!? Perhaps I need a good night sleep to figure these two things out...

#### Pommie

##### Well-Known Member
Are you sure?
I always have to include
Code:
	movlw	0x07
movwf	CMCON			;turn comparators off
at the start of my programs when ever i program on the 16F628A to get porta to work right

On the later chips they turned them off by default. I think this is because it frustrated so many people.

Mike.

#### birdman0_o

##### Active Member
Hey Mike, I've been having this weird problem with my programmer (pickit 2 )
When I try to use ICSP, it doesnt recognize the chip, but when I plug it into the zif socket it works...I did work prior too. At first it did this with the pic16f88, then didnt work. Then it worked with the 882, but now doesnt work.

Just a frustrating night.

#### Pommie

##### Well-Known Member
I thought the problem with the 16f88 was the timer1 oscillator sharing the ICSP pins. With the 882 are you using intosc with MCLR turned off?

Mike.

#### birdman0_o

##### Active Member
Yup. Its something that's wrong with my programmer, I think I'll need to catch you in the chat sometime.

Maybe tomorrow, I need sleep now, cheers!

Status
Not open for further replies.

Replies
39
Views
5K
Replies
7
Views
2K