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

data memory on PIC 16F506

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



Joined: 31 May 2012
Posts: 5
Location: Israel

View user's profile Send private message

data memory on PIC 16F506
PostPosted: Thu May 31, 2012 9:26 am     Reply with quote

Hi,

I'm trying to use a PIC 16F506 which according to datasheet has 67 bytes Sram (page 2 on data sheet).
My compiler is giving 100% memory use and my .SYM file shows only 32bytes. (see below)
Code:

008.7   C1OUT
00B.7   C2OUT
00D     @SCRATCH
00E     @SCRATCH
00E     _RETURN_
00F     @SCRATCH
010     @SCRATCH
011     @TRIS_B
012     @TRIS_C
013-014 PulseLength
015     Res
016     counter_no_mov
017     vib_count
018     FSM
019.0   ThermSafety
019.1   mov_flag1
019.2   last_moving
019.3   Thermi_flag
019.4   switch_flag
01A     TriggerBounceCounter
01B     count_moving
01C     FSM_mov
01D     test
01E     main.@SCRATCH1
01E     thermi.@SCRATCH1
01E     RF_output_control.@SCRATCH1
01E     IsMovingOn.@SCRATCH1
01E     BlinkLeds.@SCRATCH1
01E     IsTriggerBtnPressed.@SCRATCH1
01E     PowerState.@SCRATCH1
01F     main.@SCRATCH2

Does someone have any idea why I can't use all 67 bytes?

Thanks in advance for any help,
Daniel.
danyl9



Joined: 31 May 2012
Posts: 5
Location: Israel

View user's profile Send private message

I mean data memory on PIC 16F506
PostPosted: Thu May 31, 2012 9:28 am     Reply with quote

I mean: data memory on PIC 16F506
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu May 31, 2012 10:45 am     Reply with quote

Add the line shown below in bold. It tells the compiler to use all RAM
in 16F PICs:
Quote:

#include <16F506.h>
#device *=8
#fuses INTRC_IO, NOWDT
#use delay(clock = 4M)

Look in the #device section of the compiler manual:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
danyl9



Joined: 31 May 2012
Posts: 5
Location: Israel

View user's profile Send private message

PostPosted: Thu May 31, 2012 3:58 pm     Reply with quote

hi,

thanks very much for your input.
I added the following and its works!!:
#device PIC16F506
#device *=8
#nolist
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