CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

Also ? about write_bank

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
RT
Guest







Also ? about write_bank
PostPosted: Wed Nov 14, 2001 4:37 pm     Reply with quote

If you write a value to ram using the write_bank function from a function outside of main():

a) Is that value preserved by the PIC, or can it be overwritten?

ie:

main()
{
write_funtion(); //Will this print 65
)

void write_funtion()
{
write_bank(3,0,0x65);
printf("\%u",read_function());
}

void read_function()
{
int hex_sixty_five;
hex_sixty_five = read_bank(3,0);
return hex_sixty_five;
)

b) Does this save RAM because it seems to not increase my RAM usage if I use it instead of an array?
___________________________
This message was ported from CCS's old forum
Original Post ID: 1107
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: Also ? about write_bank
PostPosted: Wed Nov 14, 2001 5:55 pm     Reply with quote

Local variables are not perserved between function calls but your not talking about variables your talking about RAM locations. I would guess that your RAM usage report is based on RAM assigned to variables and does not account for directly addressed RAM.

:=If you write a value to ram using the write_bank function from a function outside of main():
:=
:= a) Is that value preserved by the PIC, or can it be overwritten?
:=
:=ie:
:=
:=main()
:={
:= write_funtion(); //Will this print 65
:=)
:=
:=void write_funtion()
:={
:= write_bank(3,0,0x65);
:= printf("\%u",read_function());
:=}
:=
:=void read_function()
:={
:= int hex_sixty_five;
:= hex_sixty_five = read_bank(3,0);
:= return hex_sixty_five;
:=)
:=
:= b) Does this save RAM because it seems to not increase my RAM usage if I use it instead of an array?
___________________________
This message was ported from CCS's old forum
Original Post ID: 1111
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group