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

addressmod, #type

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



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

addressmod, #type
PostPosted: Wed Nov 07, 2007 2:16 pm     Reply with quote

Can someone spot the error of my ways here:

Code:

#define CRYSTAL     40000000
#include "18F8722.h"

#device ANSI
#device ICD=TRUE
#pragma device CCSICD=TRUE
#fuses  DEBUG,NOWDT

#fuses  H4
#use delay(clock=CRYSTAL,RESTART_WDT)
#use RS232 (DEBUGGER,DISABLE_INTS)

addressmod(FASTRAM,0x0100,0x015F);
#type   default=FASTRAM         //  This line gives "Error: Unknown Type"
int8    pa = 0;
#type   default=

void    main (void)
{
    for ( ;; ) {
        if ( pa  == 0 )
            pa = 0x20;
        else pa >>= 1;
    }
}



I've read the help file, searched the forum. Must have overlooked something really simple. The compiler (PCH V4.060) gives "Error: Unknown type" on the #type line following addressmod(). What am I missing?

Thanks all,
Ken
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Nov 07, 2007 3:02 pm     Reply with quote

CCS's own example from the #type section in their manual doesn't work.
It gives the same error messsage.
I suggest you email CCS support and ask them about it.
Code:
#include <18F452.h>
#fuses XT,NOWDT,BROWNOUT,PUT,NOLVP
#use delay(clock=4000000) 
//#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

#TYPE default=area
addressmod (user_ram_block, 0x100, 0x1FF);
#type default=user_ram_block
#type default=

//=======================================
void main()
{

while(1);
}
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Wed Nov 07, 2007 3:16 pm     Reply with quote

Thanks PCM - I have done that, and will post their response.

Ken
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Wed Nov 07, 2007 3:36 pm     Reply with quote

Wow, these guys are quick !

From CCS:

For RAM use you need two blank arguments as follows:

addressmod(FASTRAM,,,0x050,0x05F);

It verifying this here I did find two compiler issues however. We did not allow
the = to initialize when it should be OK for RAM and the identifiers did not show
in the .SYM file. Both issues are fixed in the 4.061 release coming out today.

So, watching for 4.061 Smile

Ken
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