Few queries PIC18F4550, MPLABX

Discussion in 'Embedded Systems and Microcontrollers' started by Vindhyachal Takniki, Apr 29, 2016.

  1. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    349
    6
    I am using PIC18F4550 with MPBALX IDE V2.26, Xc8 V1.32.


    1. Putting string in ROM/flash: I have lots of strings in my code. I want to put those in flash.
    When I use this "rom" keyword, error appears, but if I remove this keyword there is no error. But it places string in data ram, which I dont want. What is solution.

    Error:
    Code (Text):
    1.  
    2. rom const char table[] = "fggx";
    3.  
    4.  
    5. source/global.c:14: warning: (374) missing basic type; int assumed
    6. source/global.c:14: error: (314) ";" expected
    7. nbproject/Makefile-default.mk:158: recipe for target 'build/default/production/source/global.p1' failed
    8. make[2]: Leaving directory 'D:/project/Project_51_ashokji/pic/codes/current_code/V6_lcd/njg.X'
    9. (908) exit status = 1
    10. make[2]: *** [build/default/production/source/global.p1] Error 1
    11. make[1]: *** [.build-conf] Error 2
    12. make: *** [.build-impl] Error 2
    13. nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
    14. make[1]: Leaving directory 'D:/project/Project_51_ashokji/pic/codes/current_code/V6_lcd/njg.X'
    15. nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
    16.  
    17. BUILD FAILED (exit value 2, total time: 508ms)
    18.  
    19.  

    Build successful:

    Code (Text):
    1.  
    2. const char table[] = "fggx";
    3.  


    2. On successful build, code gives some warning. What is corrupted fast interrupt shadow registers?
    Code (Text):
    1.  
    2. :: advisory: (1233) Employing 18F4550 errata work-arounds:
    3. :: advisory: (1234)  * Corrupted fast interrupt shadow registers
    4. :: warning: (1273) Omniscient Code Generation not available in Free mode
    5.  

    3. PIC18F4550 datasheet "DS39632E", gives all registers associated with peripheral on last page of that peripheral.
    Timer0 on Page 131, Table 11-1, has list of register associated with it.
    It also mention TRISA & its bits 0-6.
    What is their use in it?


    4. I have sizeof various datatypes in compiler. Sizeof float & double comes out to be 3 bytes? What does 3 byte means, it should be 4 bytes.
     
  2. dannyf

    Well-Known Member

    Sep 13, 2015
    1,836
    367
    What does the compiler manual say?

    What does the datasheet / errata say?
     
  3. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    349
    6
    1. In xc8, only const is to be used.
    2. It was workaround by xc8.
    3. Only RA4 is used. Datasheet have error because it didnt show other bits grey.
    4. compiler has option to use both 24 or 32 bit floats
     
  4. JohnInTX

    Moderator

    Jun 26, 2012
    2,348
    1,029
    The fast shadow register issue is described in item 4 of the errata:
    http://ww1.microchip.com/downloads/en/DeviceDoc/80478a.pdf
    The compiler is taking care of it for you and just telling you that. Note that it is not a warning but an advisory. Warnings tell you of things that should be resolved before you try to run the code.
     
    Vindhyachal Takniki likes this.
Loading...