const truncated error....

General discussion on mikroC.
Post Reply
Author
Message
jatin
Posts: 9
Joined: 15 Jan 2008 10:49

const truncated error....

#1 Post by jatin » 16 Dec 2010 19:22

Hello mkroelektronika team .....

i am using pic16f886 to compile a project ... but i get const truncated error.If i delete 2 or 3 lcd8_Cmd commands ther error becomes ok.

My ram is around 50 % used .and flash rom is also around 50 % used .
Please suggest me whaT TO DO .....

USING MIKROC V8.2.....

Sobrietytest
Posts: 619
Joined: 05 Jul 2008 06:05
Location: Thailand

Re: const truncated error....

#2 Post by Sobrietytest » 17 Dec 2010 08:07

Can you post your code?

jatin
Posts: 9
Joined: 15 Jan 2008 10:49

Re: const truncated error....

#3 Post by jatin » 17 Dec 2010 08:18

i am sending you the somplete project in mikroc v8.2.......

please compile and check it out.....


Thanks for ur precious time....
Attachments
triple timer4.rar
(136.86 KiB) Downloaded 178 times

jatin
Posts: 9
Joined: 15 Jan 2008 10:49

Re: const truncated error....

#4 Post by jatin » 17 Dec 2010 08:23

hello dear,

I have ported the code in mikroc pro v3.2 .

I still get some errors regarding lcd display.not working properly some garbage values coming .

Though i get this message from compiler in message box :

IRP bit must be set manually for indirect access to 'txt' variable timer.c
IRP bit must be set manually for indirect access to 'txt2' variable timer.c

Please let me know what exactly this error means.How to correct this error.

I am sending the project of this ported code also .
Please help...
Attachments
TIMER 4 PRO.rar
(90.58 KiB) Downloaded 164 times

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: const truncated error....

#5 Post by tihomir.losic » 23 Dec 2010 10:29

jatin wrote:Though i get this message from compiler in message box :

IRP bit must be set manually for indirect access to 'txt' variable timer.c
IRP bit must be set manually for indirect access to 'txt2' variable timer.c
Hello,

Pointers with PIC16 are “near”: they carry only the lower 8 bits of the address. Compiler will automatically clear the 9th bit upon startup, so that pointers will refer to banks 0 and 1.
To access the objects in banks 2 or 3 via pointer, user should manually set the IRP, and restore it to zero after the operation.
The stated rules apply to any indirect approach: arrays, structures and unions assignments, etc.

EXAMPLE:
From datasheet for PIC16F887:
IRP: Register Bank Select bit (used for indirect addressing).

1 = Bank 2, 3
0 = Bank 0, 1

Before access to component of an array need to set IRP to 1, and after access, manually return to 0.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

Post Reply

Return to “mikroC General”