Author Topic: Few queries PIC18F4550, MPLABX  (Read 1934 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Few queries PIC18F4550, MPLABX
« on: April 29, 2016, 04:35:14 pm »
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: [Select]
rom const char table[] = "fggx";


source/global.c:14: warning: (374) missing basic type; int assumed
source/global.c:14: error: (314) ";" expected
nbproject/Makefile-default.mk:158: recipe for target 'build/default/production/source/global.p1' failed
make[2]: Leaving directory 'D:/project/Project_51_ashokji/pic/codes/current_code/V6_lcd/njg.X'
(908) exit status = 1
make[2]: *** [build/default/production/source/global.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/project/Project_51_ashokji/pic/codes/current_code/V6_lcd/njg.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

BUILD FAILED (exit value 2, total time: 508ms)



Build successful:

Code: [Select]
const char table[] = "fggx";



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


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.
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Few queries PIC18F4550, MPLABX
« Reply #1 on: April 29, 2016, 05:10:51 pm »
first question: declaring those as constants will put them in program memory, period. If you're still not sure, check the xc8 user manual on how to put constants in rom

second question: check the errata document, located after the datasheet in the product page. that's what the compiler is telling you. you probably have extended instruction set active, which is bugged, or something simillar
 

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Re: Few queries PIC18F4550, MPLABX
« Reply #2 on: April 30, 2016, 02:24:32 am »
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
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf