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 CCS Technical Support

Problem with getenv on 18F4431

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



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

Problem with getenv on 18F4431
PostPosted: Sat Nov 01, 2008 2:01 pm     Reply with quote

I'm using getenv on a PIC18F4431 (pch v4.077) with the following lines:

Code:

#locate ADSEL1 = getenv("sfr:ADSEL1")
#locate ADSEL0 = getenv("sfr:ADSEL0")
#locate ADCHS = getenv("SFR:ADCHS")


all of them cause issues with a compiler message of:

Undefined identifier

Can anyone else confirm this?

This part is kind of off the beaten path - so I imagine the compiler database is probably missing the needed info.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah
Guest







PostPosted: Sat Nov 01, 2008 4:12 pm     Reply with quote

The register name, would be ANSEL0/1, not ADSEL. However it is wrong in the register list for the chip, with ANSEL0, labelled as BAUDCON, and ANSEL1 missing.
The version for the 4331 works OK.
If you have the Windows compiler, you can change these yourself, with 'view', 'special registers'.
As a comment, why use #locate, which requires you to define the register?. Why not use #byte, which will do a definition, and a locate, in one line?...

Best Wsihes
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sat Nov 01, 2008 4:18 pm     Reply with quote

Ttelmah wrote:
The register name, would be ANSEL0/1, not ADSEL. However it is wrong in the register list for the chip, with ANSEL0, labelled as BAUDCON, and ANSEL1 missing.
The version for the 4331 works OK.
If you have the Windows compiler, you can change these yourself, with 'view', 'special registers'.
As a comment, why use #locate, which requires you to define the register?. Why not use #byte, which will do a definition, and a locate, in one line?...

Best Wsihes


thanks for the sanity check. I do have the CCS windows compiler but always work in MPLAB. I'll check it (but it is wrong, as you've described)

And I do a struct earlier in the code, so I am defining it it, but these are overlays onto SFR, so I don't think #BYTE is appropriate anymore (also as "exemplified" in the CCS manual/examples.

In the meantime, I'm going to submit this as a bug/correction for PCH.

Thanks a bunch!

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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