|
|
View previous topic :: View next topic |
Author |
Message |
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
Problem with getenv on 18F4431 |
Posted: Sat Nov 01, 2008 2:01 pm |
|
|
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
|
|
Posted: Sat Nov 01, 2008 4:12 pm |
|
|
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
|
|
Posted: Sat Nov 01, 2008 4:18 pm |
|
|
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 |
|
|
|
|
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
|