anyone familiar with ATMEGA163 and PIC16f877

Discussion in 'Programmer's Corner' started by creme, Dec 4, 2010.

  1. creme

    Thread Starter New Member

    Dec 4, 2010
    4
    0
    HI there,

    i am an EE student. i am working on a project about security system. I have the whole coding of the project but the code is for ATMEGA163. However, my supervisor insisted to used PIC16f877 for the project. Can anyone here that is familiar with both ATMEGA and PIC help to translate those programming code for me? Please help me...
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Is your source code in C, assembly, or BASIC?

    How many lines of code is it?

    If it is in C, then porting isn't usually an insurmountable task.

    Post your source code, use the {code} forum tags, or click the octothorpe(#) to put the tags around the selected text in this forum's editor.
     
  3. creme

    Thread Starter New Member

    Dec 4, 2010
    4
    0
    The original ATMEGA source code is in C. The one i am using to program my PIC is in assembly. It is a lengthy lines of code. I am new to the microcontroller and microprocessor. I find it difficult to program the whole system. If anyone are willing to help me, i can email you the whole source code of ATMEGA for your review.
     
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Trying to refactor AVR C to PIC Assembly would be harder than simply starting over.

    What does the system need to do with inputs and outputs?
     
  5. creme

    Thread Starter New Member

    Dec 4, 2010
    4
    0
    or can PIC16f877 be program by using AVR C?? would the PIC works if the code is in C?
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    There are several C compilers available for PIC. I use BoostC, mikroC is another, but C18 from microchip may be the closest to ANSI C that you will find to convert AVR code to.

    The port names are different, as are some I/O practices, the majority should be OK.

    Though without knowing application details, I can't really say it will be easy. Something like an RGB LED controller is ported rather easily. More complicated gets more complicated.
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Post your code here. And your schematic. Then we may be able to help you. This will also prove that you have not found some ATMEGA source code on the internet. That fits your assignment. And now you are hoping that some people will do all the work for you, in order to translate to microchip code. We do not mind helping people in here. But you have to put in some effort by your self also.
     
  8. creme

    Thread Starter New Member

    Dec 4, 2010
    4
    0
    i have another questions...if i am using CCS PCM C compiler, does it mean that my programming should have been in C?
     
Loading...