PDA

View Full Version : Problem with 16F877A but not with 16F876A



savnik
- 15th May 2008, 09:32
I have use the 16f876a for a frequency meter (base on AN592), and works fine.
Yesterday i test the same programm with 16f877a but not work and i don't why.

My configuration is:
' PIC16F877A
' Xtal 4MHZ

CMCON = 7 ' PortA = digital I/O
ADCON0 = %11100001
ADCON1 = %10000000
TRISA = %11111111

The same configuration work with 16F876A.

Acetronics2
- 15th May 2008, 09:51
Hi, Savnik

did you verify the quiescent state collector voltage meets PIC input specs ???

I feel the problem in the Trans. hfe and not in the Pic ....

Alain

savnik
- 15th May 2008, 11:48
Hi, Savnik

did you verify the quiescent state collector voltage meets PIC input specs ???

I feel the problem in the Trans. hfe and not in the Pic ....

Alain
I use BF199 and not 2N3904(as show at picture).
The same circuit work on 16f876a.
I believe the problem is with the configurations

Acetronics2
- 15th May 2008, 12:16
I use BF199 and not 2N3904(as show at picture).
The same circuit work on 16f876a.
I believe the problem is with the configurations

BF 199 has a "special" pinout ( b-e-c )... not the same as 2N3904 ... if my souvenirs are good ...

and hfe is far lower than the 3904 ... ( I've just measured ~ 50 @ 2.5 ma on some of mines )


the Only differences between 876 and 877 is the Port number ... as you do not use PORTD and PORTE ( I hope ...) , you can directly program the 877 with the 876 Hex !!!

Alain

savnik
- 15th May 2008, 14:21
The bf199 work with 16f876a.
I have spent many hours with no result.

mister_e
- 15th May 2008, 20:58
I'm surprised it works with a 16F876a looking at the current ADCONx settings...

savnik
- 15th May 2008, 21:48
I'm surprised
Why;
Where i am wrong with ADCONX

skimask
- 16th May 2008, 01:03
Where i am wrong with ADCONX
Because you've got digital signals going into a port configured for analog input...

savnik
- 16th May 2008, 07:36
Because you've got digital signals going into a port configured for analog input...
with 16f876a i use ra0-ra1-ra2-ra5 as analog and ra3-ra4 as digital , and with those configurations work very well.But with 16f877a not.

skimask
- 16th May 2008, 14:11
with 16f876a i use ra0-ra1-ra2-ra5 as analog and ra3-ra4 as digital , and with those configurations work very well.But with 16f877a not.
Well, you didn't tell us that now did you?

mister_e
- 16th May 2008, 14:18
Refer to ADCON1 register table
http://ww1.microchip.com/downloads/en/DeviceDoc/39582b.pdf
page 130

The way you have it right now, all AN inputs are analog.