Size code


Closed Thread
Results 1 to 5 of 5

Thread: Size code

  1. #1
    Join Date
    Nov 2008
    Location
    sao paulo - brasil
    Posts
    23

    Default Size code

    Dear Friends,

    I Use 0 16f877 7 years ago with pbp.

    now I need more space and I opted for the 18f4520.

    when I compile in the 16f877 the hex it is with 8056 bytes and in the 18f4520 it is with 14450.

    how is it so big in the 18f4520?

    what do make to reduce the size of the generated code?

    use the pbp 2.47 and mcs 2.3.0.0.

    the initial header of the 877

    HS_OSC, WDT_ON, PWRT_ON, BOD_ON, LVP_OFF, PROTECT_ON,WRT_OFF

    in advance thankful,

    vicce.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: Size code

    Hi,

    are you sure the numbers apply to same "memory units" ???

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: Size code

    The PIC18F4520 have X Kbytes of Flash memory and can store up to Y single-word instructions! Look the datasheet.
    When I migrated to 16f877 to 18f452 I was think in 2x the memory of the 16f877, then I perceved it also. Is normal, but I don't know to explain better, sorry!

    Pimentel

  4. #4
    Join Date
    Nov 2008
    Location
    sao paulo - brasil
    Posts
    23


    Did you find this post helpful? Yes | No

    Default Re: Size code

    Ok Pimentel obrigado,

    Vi que voce e' brasileiro,

    Entao o final da memoria apontada no compilador pelo mcs nao 'e 16384 para o 18f452 e sim 32768.esta correto isto ?

  5. #5
    Join Date
    Dec 2006
    Location
    Brasil, Sao Paulo, Campinas
    Posts
    54


    Did you find this post helpful? Yes | No

    Smile Re: Size code

    Quote Originally Posted by vicce67 View Post
    Ok Pimentel obrigado,

    Vi que voce e' brasileiro,

    Entao o final da memoria apontada no compilador pelo mcs nao 'e 16384 para o 18f452 e sim 32768.esta correto isto ?

    Fala aí colega, blz?
    acho que é isso sim ( no datasheet diz 32k bytes de flash (32768 se vc fez as contas,rsrsrs) e 16384 #single word instructions). No MCS deve mostrar words usadas então acho que é isso sim!

    É mais ou menos por aí...eu tinha uma aplicação usando um 16F877A que tem 8k de flash, mas eu precisava de mais memória. Então migrei p/ o 18F452 e esperava que o mesmo código que eu tinha no 877A ficasse com o mesmo tamanho e p/ minha surpresa qdo compilei notei que tinha quase 16k...daí lendo o datasheet vi esse lance de single word...e já viu né. Vc deve ter tido essa mesma dúvida... eu acabei de fazer um teste...eu tenho um programa usando o 18f452 que ao compilar mostra 5278 words usadas....daí eu mudei p/ PIC 16F877A e compilei de novo...deu 3124 words. Não sei se ajudou mas é isso mesmo...denorex...parece mas não é, kkkk
    abraço

    Pimentel
    Last edited by Pimentel; - 7th April 2011 at 01:45. Reason: esqueci de comentar

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts