Searching \ for 'Cannot write information from RCREG to Element in' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=cannot+write+information
Search entire site for: 'Cannot write information from RCREG to Element in'.

No exact or substring matches. trying for part
PICList Thread
'Cannot write information from RCREG to Element in '
1998\07\31@171734 by Chris Adamson

flavicon
face
Yo,
       I cannot seem to dump the data contents of the RCREG1 into an element of
an array... for the data never shows up in the element! This is strange
because the device certainly picks up characters (by viewing the sfr RCREG1
at breakpoints).


rom unsigned char RcByteUSART1;
.
.
.

void GetMessageUSART1()
{

RcByteUSART1 = RCREG1; // to guarantee that the interrupt goes away

if (RCREG1== 'a')
RcDataBuffer[0] = RcByteUSART1;
.
.
.
/***************************************/
By setting a variable such as

ram unsigned char dude;
dude = RcDataBuffer[0];

The variable "dude" never gets the letter 'a'.

Am I missing something here? Does this have something to do with the fact
that rom pointers and ram pointers are not compatible? (Because the array
is like a constant pointer).

Any suggestions?

Thanks for your help and thanks to all those who have responded to my pleas
for help in the past.

Chris Eh?


Chris Adamson, Programmer
Identec Solutions
spam_OUTcadamsonTakeThisOuTspamidentec.com
phone: 1-250-860-6567

1998\07\31@180306 by kfisk

flavicon
face
Chris,

As you know, my PIC brains are a little light.  However, from a 'C'
perspective I would say your problem is in the assignment to a ROM
variable(?). What you appear to have defined is a "char" size memory
location -space- to hold a value, not a pointer and this value is ROM. While
the register gets your value, you can never transfer that value to a ROM
location.

The way I see it is if you change you "rom" to "ram" it should work.

If I'm wrong, well I chock it up to my rusty PIC brain. Otherwise, hope it
helps.

Cheers,

K. Fisk <.....kfiskKILLspamspam@spam@wkpowerlink.com>
< Opinions are my own worthless dribble that might otherwise be put to more
constructive uses 0->

{Quote hidden}

Not pointers! What you have create is space, or locations not pointers.

> (Because the array
> is like a constant pointer).

This is true, the array name is like a constant pointer.

>
> Any suggestions?

1998\07\31@185129 by Chris Adamson

flavicon
face
At 03:04 PM 7/31/98 -0700, you wrote:
>Chris,
>
>As you know, my PIC brains are a little light.  However, from a 'C'
>perspective I would say your problem is in the assignment to a ROM
>variable(?). What you appear to have defined is a "char" size memory
>location -space- to hold a value, not a pointer and this value is ROM. While
>the register gets your value, you can never transfer that value to a ROM
>location.
>
>The way I see it is if you change you "rom" to "ram" it should work.
>
>If I'm wrong, well I chock it up to my rusty PIC brain. Otherwise, hope it
>helps.
>
>Cheers,
>
>K. Fisk <kfiskspamKILLspamwkpowerlink.com>
>< Opinions are my own worthless dribble that might otherwise be put to more
>constructive uses 0->

Kevin,
       Thank you for the suggestion. We would really like to change it from rom
to ram... however, the ram directive seems to only refer to the 512 bytes
of internal ram on the PIC17C752. Our machine will have tons (relatively)
of ram to hold buffers and such. The only problem is, we must declare these
memory sections as rom or "codepage" (in the linker file). This seems to be
a real shortcoming of the compiler...

Do you know of any way into tricking the compiler and/or linker into
believing that external ram is actually ram? Or am I missing some big
concept here?

Thanks.
Chris Eh?


Chris Adamson, Programmer
Identec Solutions
.....cadamsonKILLspamspam.....identec.com
phone: 1-250-860-6567

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...