PDA

View Full Version : What is the main difference Bet. 16f877 vs 16f877A



uludere72
- 15th February 2006, 14:53
I couldn't see any differenece!!

Melanie
- 15th February 2006, 15:13
Go look again... how about Comparators and a Voltage Reference Module as a start...

uludere72
- 16th February 2006, 08:11
does it work properly with my ex program which is writen for 16f877 ..!!

Melanie
- 16th February 2006, 09:51
Do I have a crystal ball? Actually yes, there's one next to my monitor, but when I look in it I can see all kinds of things but unfortunately your program isn't one of them!

If you are blinking a LED on PortB, you got no worries...

If you are using any pin that is shared with a Comparator, then just like the Datasheet says... it's not going to work without adding code to disable those comparators first.

uludere72
- 21st February 2006, 11:28
thanks for your kind response
!

Joann
- 1st May 2006, 10:14
I also have the same problem,i have a code compiled for pic16f877
the data,clock pin is on porta pin,when i program it on pic16f877a i did not work.
how would i disable the comparator.

mister_e
- 1st May 2006, 13:06
Comming from the migration sheet...
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=863&stc=1&d=1146485135">

Joann
- 2nd May 2006, 10:53
The problem is this,i connected as follows to pic16f877a
porta.0 = clock to 74hc
porta.1 = clock to 74hc
porta.2 = clock to 74hc
porta.3 = input..
porta.4 = input..
porta.5 = output..

portb.0 - 7 = outputs.
portc.0 - 7 = outputs.

i have tried to ,cmcon = 7
adcon1 = 7
still is not working .
but the code work on pic16f876.

mister_e
- 2nd May 2006, 13:55
Is your programmer support the 16F877a as it can have some programming time difference.

Also, the A serie are bit much noise sensitive, be sure you place the proper psu filtering cap close to your PIC.

Joann
- 2nd May 2006, 16:38
i will try to fit in the capacitor,.
is there any other thing i can do to make it work.?

Joann
- 2nd May 2006, 16:41
my programmer supports 16f877a, and i buld it my self and i use it with winpic800 software or icprog, it works very fine i have been programming 16f877a and 16f628a with it works fine.

paul borgmeier
- 2nd May 2006, 17:04
If the registers are wrong, your PIC could be running and not doing what you want it to do. If the A part is more sensitive to noise, you might be having hardware issues (as Steve noted). Attack your problem systematically.

The first thing I would do is make sure the PIC (same one you are using in the same setup) was alive after programming. If you have an unused Pin that is not hardwired to one of the rails, toggle it and see if your PIC is alive.

Insert something like this near the top of the code you are trying to make work. Place after you set the Port values and directions. For example is PortB.7 is unused ..

Add this ....

TRISB.7 = 0

AliveTest:
PortB.7 =1
Pause 1000
PortB.7 = 0
Pause 1000
goto AliveTest

The rest of your code is still here

Recompile and reprogram you PIC. Monitor PortB.7 with a voltmeter and see if your PIC is alive. If a Pin on PortB toggles, repeat with an unused pin on PortA. If neither toggles, you have hardware or config issues. If they both toggle or only PortB toggles, you probably have register setting problems. Report back with your findings for more ideas of how to debug your problem.

Paul Borgmeier
Salt Lake City, Utah
USA

Joann
- 2nd May 2006, 17:47
i will just do that right away.

Joann
- 3rd May 2006, 08:40
i have run the alive test i didnt work, and what surprise me is when i run another code on the pic it works..
any solution or do i post the source here.

mister_e
- 3rd May 2006, 13:39
Sounds weird to me so just post your Whole code AND the according .HEX compiled file to compare.

paul borgmeier
- 3rd May 2006, 14:03
Great information (and you are closer to a solution) -
Let me make sure I understand

- The code works on a 16F876 but not a 16F877A
- The alive test does not work on the 16F877a when inserted into your code and the PIC inserted into your circuit
- The same16F877A works when tested with other code in another circuit

If the above is all true, it sure sounds like a hardware / config issue.

What do you have connected to pin 1 of the 877A

Describe your power supply?

Do you have all four Vdd and Vss pins connected?

Do you have decoupling caps between each pair of Vdd and Vss?

What are your config setting?

What are you using for an oscillator?

What registers are you using and how are they set?

If we cannot find the problem with this information, the nest step is to post a schematic and code.

Paul Borgmeier
Salt Lake City, Utah
USA

Joann
- 3rd May 2006, 17:06
this is my connection

On porta.0 = clock of 74hc574
On porta.1 = clock of 74hc574
On porta.2 = clock of 74hc574
On porta.3 = cts
On porta.4 = serialin
On porta.5 = serialout

I use three 74hc574
portb.0-7 = pin2 -pin8 of 74hc574
portc.0-7 = pin2 - pin8 of 74hc574

Joann
- 4th May 2006, 16:16
I thank everybody in the forum who contributed to make my effort to become succesful.
the code now is working perfect.
filter caps,and cmcon = 7
adcon1 =7
and configuration,and a little hardware fault,.

Joann
- 17th May 2006, 15:03
How can i read the whole byte on the i2c 24c16?
The code i wrote is this,"i2cread dpin,cpin,$a0,char,[char2disp]"
It only reads the first 256bytes,only, i am using the code to display moving sign display on led matrix.

mister_e
- 17th May 2006, 15:12
Your variables declaration and a snip of your code woud help!

Joann
- 17th May 2006, 15:18
Can you please give me some example,.

Joann
- 17th May 2006, 15:23
I decleared ,,char var byte
char2disp var byte.
Please shed more light on this.

sandeepdevang
- 5th March 2007, 08:11
hi... i am working on a project called "sms based device control".... i am done with the circuit and have started working on the codes... i have written the codes keeping pic16f877a in mind... but the debugger available in the college is MPLAB ICD2.. which contains the pic16f877 IC.... is it possible for me to run the same pic16f877a code here... otherwise what do i do?

ledsignmen
- 20th March 2007, 18:29
I couldn't see any differenece!!
I have had code running in 16F877 for years. I have PortA.5 as input I have a 1K pullup on A.5. I have a push button that connects A.5 to ground when the button is pressed. I have set the lower 3 bits of CMCON = 1. I have set ADCON1 = 7. I have placed a .1 cap from pin 7 to ground. Any press of the button results in a RESET of the 16F877A.
There are no problems when I use 16F877 but the 16F877A resets ever time.
What do I try next ???

mackrackit
- 20th March 2007, 19:14
Try CMCON=7 instead of 1.

Do you have a pull-up of around 470 from MCLR to VDD?

ledsignmen
- 21st March 2007, 19:22
Dave,
Thanks for the input.
When I said that the lower 3 bits of CMCON were set = 1
I SHOULD have said that Each of the lower 3 bits is set to 1
which makes CMCON = %00000111 which = 7.

I do have a 1K pullup to +5 on MCLR.

I have also discovered that if I set the config bits for the 16F877A
to turn the Brownout reset = OFF the code I have been running in
the 16F877 now also runs perfectly in the 16F877A.

What is it about pulling PortA.7 to ground with a pushbutton switch that
could lead to a system reset ??? And why would turning the brownout
reset OFF correct that problem ???

Thanks,
Dan

mackrackit
- 21st March 2007, 23:30
Sounds like a power supply problem or maybe something causing a short when the button is pushed.

The data sheet states when VDD drops to 4V a you have a brown-out.
Are both VDDs powered? Check the voltage on VDD when the button is pushed.

Two points to clarify.
Why the .1 cap to ground and not a pull-up of say 10k?
PORTA.7??? pin 7 is PORTA.5.

ledsignmen
- 22nd March 2007, 17:42
Dave,

Sorry about the mistakes in my typing . . .
I have TRIED a .1 cap to ground on PortA.5 because some comments in this thread indicated that might be of benefit. And it sort of makes sense as a method for smoothing out the switch bounce noise generated by a push button switch.

And there IS a 1K pullup on PortA.5.

It was my confusion that typed PortA.7 in the previous text.
I SHOULD have typed PortA.5 and got that mixed up with the pin number which resulted in my typing PortA.7.

This whole thing is about PortA.5 which is also Pin 7.

I do have +5 to both VDD pins and the 5 volt source is a 150 watt switching supply.

I have had a friend of mine look at VDD and Master Clear with his scope and both of these are steady as a rock when the push button is pressed and the whole thing RESETS.
Pressing the pushbutton to pull PortA.5 to ground does create a little noise from the switch bounce but I cannot see that any amount of noise on an input should result in a reset ??? Do you think ??

Thanks again,
Dan

skimask
- 22nd March 2007, 17:48
Time to show us the schematic of the whole thing I suppose...

mackrackit
- 22nd March 2007, 18:00
I assume this is all on a test bench. I have had noise problems with switches when the device in the field next to a plasma cnc. Switch in question would start the torch.

Tell us a little more about the project along with the schematic.

mister_e
- 22nd March 2007, 22:52
to answer the original question What is the main difference Bet. 16f877 vs 16f877A

The answer is 1588F03 ;) :D

skimask
- 23rd March 2007, 01:39
to answer the original question What is the main difference Bet. 16f877 vs 16f877A

The answer is 1588F03 ;) :D

Only a real GEEK would get that! :D

mackrackit
- 23rd March 2007, 04:01
I figure the difference is FFFEA770FD.

That is being the 16F877 came first.:rolleyes: