Menu

16F1825 and 16F1829

mkstevo
2018-09-07
2018-09-08
  • mkstevo

    mkstevo - 2018-09-07

    Hello.
    I was compiling a program earlier today for the 16F1829 and thought that following successful compilation the reported program size of 70% looked rather excessive. I then had a vague memory of this happening some time back. I checked the 16F1829.dat file dated 15th Dec 2017 and the entry for Prog which I took to be the program size was:

    Prog=8192
    

    Checking the datasheet for this chip shows the program space as 14kb so I edited the file to read:

    Prog=14336
    

    Which I hope is correct for the 14kb shown in the datasheet. I had a recollection that the 16F1825 had the same error so edited it to read the same too. My program now occupies a more reasonable 40% of program space. Much better!

     
  • Anobium

    Anobium - 2018-09-07

    Steve I need to correc this.

    The table PIC12(L)F1822/1840/PIC16(L)F182x/1847 Family Types in the datasheet shows 8kb (words). Where did you see 14 kb. May be I am being dim.. help me.

     
  • Anobium

    Anobium - 2018-09-07

    OK. Hugh and I have discussed offline.

    The original value of 8192 is correct, the size is measured in words (which is the same as instructions on 16F chips) in the .dat files.

    Microchip in the past usedthe value of 8192 , but then they started using bytes on the website instead to make their chips sound bigger!!

    An exampe: Chips are 8192 words, which is 8192 * 14 = 114688 bits, or 14336 bytes. It is an odd measurement because dividing 14336 by 14/8 to see how many instructions you can use is extra maths work.

    So, sorry, the value should be 8192.

    We had some confusion about memery size on AVR chips a while back, those had the wrong sizes because the Atmel figures were in bytes but Gret COW BASIC was in words, all program memory measurements in the compiler are in words now.

     
  • mkstevo

    mkstevo - 2018-09-07

    I see what you are saying there and it makes sense.

    So the compiler and the .dat file list the memory space in 'Words' not 'Bytes'.

    The Microchip website list the memory space in 'Bytes' not 'Words'.

    I've clearly typed more than I thought, so my program does actually occupy 70% of the space in my processor.

    Sorry for any confusion I have inadvertently caused.

     
    • Anobium

      Anobium - 2018-09-07

      It got me thinking! So, nothing to change in the .dat and stop using large strings!!

       
      • mkstevo

        mkstevo - 2018-09-08

        Looking at it, my code does stretch to 1,400 lines of Basic, so perhaps I have typed more than I thought?

         

Log in to post a comment.