No, don't touch a Flash zone, I know it will work.
I can't use a Flash, for this reason.
Pic 1855 USB downloader on pic 18877 demo board is not able to write a Flash zone, so I am forced to use programm memory zone.
I have an idea to use ASM{} commands to read constants from ROM
Back to the roots
But I could check it later, in the one week trip now.
Constants aloccation in ROM by address compilator fail
-
- Posts: 1555
- Joined: 24 Jun 2007 19:27
- Location: 01800 St Maurice de Gourdans France
- Contact:
Re: Constants aloccation in ROM by address compilator fail
for me, Flash and program memory zone is the same !renew wrote: ↑11 Dec 2022 22:44No, don't touch a Flash zone, I know it will work.
I can't use a Flash, for this reason.
Pic 1855 USB downloader on pic 18877 demo board is not able to write a Flash zone, so I am forced to use programm memory zone.
I have an idea to use ASM{} commands to read constants from ROM
Back to the roots
But I could check it later, in the one week trip now.
if you have a USB downloader ( as on StartUSB 18F250 Mikroelectronika)
maybe you can change somme data in flash (program memory zone) by using virtual serial COM trough USB link !
( HID_Read()); to get your new data
and FLASH mikroC Library , with a few additional code . to change data in Rom
Re: Constants aloccation in ROM by address compilator fail
My project is based on microchip DM164142 demo board, with usb loader . It can't to flash Flash zone cells, I tried.
I can show any info on the display, same thing as UART.
I can show any info on the display, same thing as UART.
-
- Posts: 1555
- Joined: 24 Jun 2007 19:27
- Location: 01800 St Maurice de Gourdans France
- Contact:
Re: Constants aloccation in ROM by address compilator fail
OK,
but your application can do it !
After uploading your program into the PIC via the bootloader
you can send new data trough UART link with a special protocol (defined by you!) example send "Flash1770=0X05"
treat the receveived string to extract the new data by your application (your running program )
then change data in Flash Zone ..
not concerned by bootloader limitation !
......except if you want to write into the bootloader application itself...
Re: Constants aloccation in ROM by address compilator fail
Yes, you are right.
But my goal - the users should to be able to change cells during programming PIC to change some parameters of device. My device has only one button so I can't implement a menu.
I mean the cell changing method should be as easier as it's possible.
But my goal - the users should to be able to change cells during programming PIC to change some parameters of device. My device has only one button so I can't implement a menu.
I mean the cell changing method should be as easier as it's possible.
Re: Constants aloccation in ROM by address compilator fail
Hi.
I don't know what is happened, but it started to work now
I just do for pic 1939
And I can to chage cells externally and it works ! Optimisation level Four.
But I have found some other glitch connected with long
In the first case result is -31072
In the second 100000
I don't know what is happened, but it started to work now
I just do for pic 1939
Code: Select all
const char Cells[10] = {0x05, 0x30, 0x08, 0x10, 0x15, 0x13, 0x01, 0x04, 0x14, 0x60} absolute 0x2220;
char Cells_2[10];
volatile char a;
void func (void{
char i;
char txt[5];
for(i=0; i<10; i++){
Cells_2[i] = Cells[i];
}
for(i=0; i<10; i++){
a = Bcd2Dec(Cells_2[i]);
ShortToStr(a, txt);
oled_write(i+1, 0, txt, 5, 'w');
}
}
But I have found some other glitch connected with long
Code: Select all
a = 1000 * 10 * 10; // first case
a = 100000; // second case
LongToStr(a, txt);
oled_write(2, 0, txt, 12, 'w');
In the second 100000