Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Different between atmega 644 and pic 16f877a ? (URGENT)

Status
Not open for further replies.

ahmedmedhat

Newbie level 4
Joined
Dec 13, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,311
PLEASE Iam a beginner at micro-controller and i want to know urgently wat's the main difference between atmega644 and pic 16f877a or pic 18f452?....is there a big difference in programming between atmega and pic..if i have a code of atmega644 can i apply the same code to pic 16f877a with a small modification or should i change the whole code ?
 
Last edited by a moderator:

throwaway18

Advanced Member level 2
Joined
Jun 9, 2005
Messages
596
Helped
101
Reputation
202
Reaction score
24
Trophy points
1,298
Location
Kent, UK
Activity points
8,363
If the software you have is written in assembly language or you don't have the source code it will have to be completely rewritten. The instruction set is different.

If the code is written in a language like C or BASIC and you have the source code it may or may not be possible to make it work on a diffferent processor with minor changes. In this case you need a compiler for the 16F877.

The ATMEGA644 has more program memory than the 16F877, the software may not use all the memory so it might fit.

If the software just reads and controls IO pins then may be fairly easy to make it run on a different processor.

If the software uses timers, I2C, SPI,UART, internal EEPROM etc then it will be more work.

The ATMEGA644 and the 16F877 have different hardware features, for example the atmega has two UARTs but the PIC only has one.
 

hemporer

Newbie level 6
Joined
Dec 13, 2012
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,333
If you use C launguage to write your code,
you can apply the same code to pic 16f877a simply,
just change header file and relevant register.
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
if i have a code of atmega644 can i apply the same code to pic 16f877a with a small modification or should i change the whole code ?
It actually depends on the code. If it relies heavily on the hardware peripherals/modules, you'll most likely need to rewrite the code from scratch using the code for ATmega as reference, since the registers will vary between ATmega and PIC for the same (similar) peripherals/modules.
 

ahmedmedhat

Newbie level 4
Joined
Dec 13, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,311
It actually depends on the code. If it relies heavily on the hardware peripherals/modules, you'll most likely need to rewrite the code from scratch using the code for ATmega as reference, since the registers will vary between ATmega and PIC for the same (similar) peripherals/modules.
okay...can u please if i send u a code in private message can u take an overall look on the code and see if it heavely depends on hardware peripherals ? :)
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
While a large portion of the code can be easily ported, a lot of it needs to be rewritten. A quick glance reveals the use of the UART, ADC, Compare modules along with the sleep and vectored interrupt functionalities. It's going to take some significant effort on your part to convert the code for use with PIC16F877A. That is, if the code will fit on the PIC16F877A in the first place.
 

throwaway18

Advanced Member level 2
Joined
Jun 9, 2005
Messages
596
Helped
101
Reputation
202
Reaction score
24
Trophy points
1,298
Location
Kent, UK
Activity points
8,363
The ATMEGA644 has 4KB of RAM, the 16f877 only has 368bytes of RAM.

Your program allocates 1000bytes for storing datapoints.

There is not enough RAM.

This program appears to use a realtime preemptive scheduler called TinyrealTime.
It looks tricky to convert to run on a PIC.
 
Last edited:
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top