Searching \ for '[PIC]: MPLAB C18' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=mplab
Search entire site for: 'MPLAB C18'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: MPLAB C18'
2002\08\14@054736 by 8859-9?B?1m1lciBZYWxo/Q==?=

I feel like I am talking to myself here, it seems that there are no MPLAB C18 users on this list, but I will give it one last chance.

I have been struggling with the compiler and I have couple of questions, please help if you know anything:

1. How do you set the configuration bits programmatically?
2. How do you write and read to eeprom (I tried "rom long eTest = 0x1234;" but that does not seem to work, although I get no compiler warnings/errors)
3. How do you define default values in the eeprom in C?  In asm I just write (org 0x2100   de "testing",0)
4. Sometimes, after I have the hex file without any compaints from the compiler, I load it to the programmer (P16PRO, and load the hex file, and I get "Checksum error in object file".  Could this be because I don't have the configuration bits in the hex file?  If so, how come I don't get this error all the time?

The pic used is: 18F452 at 20Mhz.

Please help if you know anything or at least where to get help about the C18.


Regards,


Omer YALHI
spam_OUToyalhiTakeThisOuTspamteksan.com.tr
http://www.teksan.com.tr
Tel : +90 212 613 22 00
Fax: +90 212 544 70 35

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2002\08\14@085218 by cdb

flavicon
face
Although I have downloaded the demo, I have yet to use MPLAB C18, but
my current 'C' compiler requires a double underscore for config info
as in  #__config or #pragma __config with either

#__config 0x3F72 or #__config _XT_OSC | _WDT_NORMAL etc


To persuade data into EEPROM at compile time requires for my
compiler


#asm
_savePC=$
org 0x2100
DATA 'Y','E','S'   ;or '0x59','0x45','0x53'= YES
org _savePC
#asmend
--

_savePC= is needed by my compiler otherwise it becomes confused and
sulks.

I await angry shouting from others.

colin

cdb, bodgy1spamKILLspamoptusnet.com.au on 14/08/2002

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2002\08\14@090250 by Hu, Luhui

flavicon
face
I am also using C18 compiler. I found another issue: it seems that the C18
stores "const" variables both at the program memory and data memory.

Do you know how to select banks using "pragma varlocate"? thanks in advance!

Luke

{Original Message removed}

2002\08\14@090917 by 8859-9?B?1m1lciBZYWxo/Q==?=

Nope, doesn't work that way.  How come they did not put this on the
manual?  I searched everywhere!  If they did put it, then they have made
a very good job of hiding it.

Thanks for the help though,

Ömer YALHI
EraseMEoyalhispam_OUTspamTakeThisOuTteksan.com.tr
http://www.teksan.com.tr
Tel : +90 212 613 22 00
Fax: +90 212 544 70 35


{Original Message removed}

2002\08\14@092351 by Jim Ewald

flavicon
face
You can find C18 users on the Microchip development tools webboard.
Point your browser at:

http://asp.microchip.com/webboard/wbpx.dll/~devtools

The fuses on the F18xxx MCU are set by including in-line assembler,
using the __Config directive (note there are 2 underscores in __Config).
There is a discussion on this topic up on the webboard. There is an
additional parameter to __Config in the PIC 18Fxxx series. It is defined
as:

__Config  mem_addr, config_bits

The fuse addresses and bit maps are defined in the corresponding
P18Fxxx.inc file. For example, the OCS fuse settings might look like:

       __CONFIG    _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H

Sorry that I cannot help with your other questions. I'm still learning
how to use MPASM. C will have to wait for a while.

Regards,
Jim

{Original Message removed}

2002\08\14@093013 by 8859-9?B?1m1lciBZYWxo/Q==?=

I don't need any bank selection yet, so I have not looked into it.  With
IAR C you have to declare the variables with banks and then you can
forget about them when using, bank changing is done automatically.  I
assumed it would be the same case with C18, isn't that so?

Ömer YALHI
oyalhispamspam_OUTteksan.com.tr
http://www.teksan.com.tr
Tel : +90 212 613 22 00
Fax: +90 212 544 70 35


{Original Message removed}

2002\08\14@093419 by 8859-9?B?1m1lciBZYWxo/Q==?=

Jim,

Thank you for the help, although I cannot use the __config command with
the C compiler (yet!) for some reason, the webboard is definetly a big
help.

I appriciate it,
Ömer YALHI
@spam@oyalhiKILLspamspamteksan.com.tr
http://www.teksan.com.tr
Tel : +90 212 613 22 00
Fax: +90 212 544 70 35


{Original Message removed}

2002\08\14@101742 by Hu, Luhui

flavicon
face
I cannot see it is in the generated assembly language because I use its
generated assembly code to check the C18 compiler.

Luke

{Original Message removed}

2002\08\14@105127 by Mike Mansheim

flavicon
face
> I feel like I am talking to myself here, it seems that there are no
> MPLAB C18 users on this list, but I will give it one last chance.

I use CCS, so I can't help with C18 specifics.
However...

> 1. How do you set the configuration bits programmatically?

CCS uses a pragma called #FUSES - you might want to check your manual
for "fuses" - you might be missing it looking for "configuration bits".
That said, I suspect it is instead going to be a syntax variation on
responses you've already gotten.  There must have been example C files
included with the compiler - you can usually figure this kind of stuff
out from those even if it's not clear or seems to be missing from the
manual.

> 2. How do you write and read to eeprom (I tried
> "rom long eTest = 0x1234;" but that does not seem to work, although I
> get no compiler warnings/errors)

eeprom and rom are not the same!  If you can do inline assembly, just
use the short routines in the 18F data sheet for reading and writing to
eeprom - they work just fine.  The "rom" directive is like const - it
forces a variable into program memory (NOT eeprom).  I know this much
about C18 from the CD I got from the masters.  Couldn't find anything
on initializing eeprom data.
There are undoubtedly library functions for doing this - they will be
along the lines of:  x = read_eeprom(3);  try looking for something
similar.  Try searching through all the .h files for the string "eeprom"
to find the prototype.

> 3. How do you define default values in the eeprom in C?  In asm I just
> write (org 0x2100   de "testing",0)

Again, CCS uses a pragma (#ROM).  Perhaps check your list of non-standard
pragmas.

--
http://www.piclist.com hint: To leave the PICList
KILLspampiclist-unsubscribe-requestKILLspamspammitvma.mit.edu


2002\08\14@113254 by Spehro Pefhany

picon face
At 08:59 AM 8/14/02 -0400, you wrote:
>I am also using C18 compiler. I found another issue: it seems that the C18
>stores "const" variables both at the program memory and data memory.

Yes, some compilers do this. It is (obviously) stored in program memory,
and the startup code copies it to RAM. The compiler needs some other
instruction to use it directly from code memory, which you will have to
find in the manual etc.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
RemoveMEspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
9/11 United we Stand

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu


2002\08\14@171736 by Harold M Hallikainen

picon face
I'm running MPLAB C18. I'll see if I can answer some of this.

1. I have not yet found a way to set the configuration bits. I've tried
an ASM file that was linked in, but that did not work. I've posted stuff
here and on the Microchip web board. People on the web board suggested an
asm file. People here suggested some fixes to the asm file to eliminate
errors. If you look in the index of the C18 manual under "configuration
bits," it gives you a definition of them, but nothing else.  So, in
answer to question # 1, I don't know! Let me know if you find out how to
set the config bits from within C18.

2. Similarly, the manual on C18 only gives us a definition of eeprom.
Since the eeprom is not in the memory map, but instead is treated as a
peripheral, I'd expect there to be library functions to talk to the
eeprom. You can define the initial values for eeprom in assembly (sample
code below). I have not tried this in a C based project, though. The C18
libraries manual also includes eeprom in the glossary, but nowhere else.
There are eeprom functions in the I2C library, but these talk to external
eeprom on an I2C bus. I believe to write to internal eeprom, you'll have
to define your own functions (in C or asm). Putting a rom qualifier in
front of a type forces the constant to be in program memory instead of
RAM. It does not force it into eeprom.

3. On default values in eeprom, you MIGHT be able to link in the asm file
(like that below). I have not tried it, though. I know of no way to
define eeprom values directly in C18.

4. don't know about the object file checksum errors. I've never gotten
that on my Promate.


Harold

Sample eeprom intialization ASM below:

; -----------------------------------EEPROM
Allocation-------------------------------------------

LightMeterScaleHi equ   0
LightMeterScaleLo equ   1               ; Light meter scaling factor in eeprom
CC1seconds      equ     2               ; Store custom program curing mode 1 duration
CC2seconds      equ     3
CC3seconds      equ     4
CC4seconds      equ     5               ; Store custom program curing mode 4 duration
RunTime0        equ     0x06            ; Run time counter advanced every 256us
RunTime1        equ     0x07            ;
RunTime2        equ     0x08            ; Advanced every 234uS or hours/256
RunTime3        equ     0x09            ; Hours lo
RunTime4        equ     0x0a            ; Hours hi
LampStartCountHi equ    0x0b            ; Lamp starts hi
LampStartCountLo equ    0x0c            ; Lamp starts lo

       org     0x2100
       de      01, 00                  ; Default light meter scaling factor of 1
 ifdef xenon
       de      d'1'                    ; minimum time for custom cure 1
       de      d'1'                    ; minimum time for custom cure 2
       de      d'5'                    ; minimum time for custom cure 3
       de      d'5'                    ; minimum time for custom cure 4
 else
       de      d'3'                    ; minimum time for custom cure 1
       de      d'10'                   ; minimum time for custom cure 2
       de      d'15'                   ; minimum time for custom cure 3
       de      d'25'                   ; minimum time for custom cure 4
 endif
       de      low(-d'3600'),high(-d'3600'),0, RevCodeMonth, RevCodeDay ; Runtime
initialized at month/day of rev (reset during cal)
       de      0,0                     ; Lamp cycle count initialized at zero




FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

Reach broadcasters, engineers, manufacturers, compliance labs, and
attorneys.
Advertise at http://www.hallikainen.com/FccRules/ .


________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestEraseMEspamspam_OUTmitvma.mit.edu


2002\08\14@172357 by Harold M Hallikainen

picon face
On Wed, 14 Aug 2002 16:30:36 +0300 =?iso-8859-9?B?1m1lciBZYWxo/Q==?=
<RemoveMEoyalhispamTakeThisOuTTEKSAN.COM.TR> writes:
> I don't need any bank selection yet, so I have not looked into it.
> With
> IAR C you have to declare the variables with banks and then you can
> forget about them when using, bank changing is done automatically.
> I
> assumed it would be the same case with C18, isn't that so?


       I believe it is. I've not had to deal with bank switching in C18. It
seems to have taken care of it for me.

Harold


FCC Rules Online at http://hallikainen.com/FccRules
Lighting control for theatre and television at http://www.dovesystems.com

Reach broadcasters, engineers, manufacturers, compliance labs, and
attorneys.
Advertise at http://www.hallikainen.com/FccRules/ .


________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
dl.http://www.juno.com/get/web/.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam.....mitvma.mit.edu


2002\08\15@045228 by 8859-9?B?1m1lciBZYWxo/Q==?=

part 1 4631 bytes content-type:text/plain; (decoded quoted-printable)

Finally I did find it!!!

Here are the configuration bits in ASM to be included in a C18 project.
Don't forget to change the __config lines to your needs.

Hope this helps.

Ímer YALHI
EraseMEoyalhispamteksan.com.tr
http://www.teksan.com.tr
Tel : +90 212 613 22 00
Fax: +90 212 544 70 35


{Original Message removed}
part 2 3264 bytes content-type:application/octet-stream; (decode)

part 3 154 bytes
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads



'[PIC]: MPLAB C18'
2002\10\09@170237 by rusque (Listas)
face
flavicon
face
Hello,

   I'm very disappointed with CCS-PCH and I'm wanting to give MPLAB-C18 a
serious try.

   Anyone here knows the time limit of the demo and beta versions at
http://www.microchip.com/1010/pline/tools/picmicro/code/mplab18/index.htm?

   Also, I can't find the price. How much does it costs?

   Thank you very much,

   Brusque

-----------------------------------------------------------------
Edson Brusque                 C.I.Tronics Lighting Designers Ltda
Research and Development               Blumenau  -  SC  -  Brazil
Say NO to HTML mail                          http://www.citronics.com.br
-----------------------------------------------------------------

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\10@034312 by Claudio Tagliola

picon face
What is your disappointend with CCS-PCH?

Claudio

P.s. I'm not connected to CCS, I only use their compiler.

-----Oorspronkelijk bericht-----

   I'm very disappointed with CCS-PCH and I'm wanting to give MPLAB-C18 a
serious try.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\10\10@065457 by oyalhi

flavicon
face
I have both compilers but not yet used the CCS-PCH.  MPLAB C18 works for
me now.  The price is about 450 USD as I recall.

What was it that you don't like about the CCS-PCH?  Since there is a lot
of info on the net I am considering to switch to CCS-PCH.  Have you
considered purchasing the "PIC C Routines", there is very good info in
there I think.

Ömer YALHI
RemoveMEoyalhiEraseMEspamEraseMEteksan.com.tr
http://www.teksan.com.tr
Tel : +90 212 613 22 00
Fax: +90 212 544 70 35



{Original Message removed}

2002\10\10@110328 by rusque (Listas)

face
flavicon
face
Hello Claudio,

> What is your disappointend with CCS-PCH?

   too much buggy. And I'm not the only one to complain about this.

   The PCM is very stable now, but the PCH have some weird problems
regarding RAM and ROM allocation. The sh*t is that no one have found those
problems on small programs and they are very hard to track on large (more
than 2000 lines) programs where they make a mess.

   For example, I have an application that is working very well. It's a
controller for an automation system. Then I just try to include a line on a
section of the program that isn't even executed at program start (say, at
the configuration menu), and the PIC keeps resseting itself well at the
beginning of main().

   I hope they correct this soon, or I'll have to move to another compiler.
I have to travel monday and show this controller to a client and it will not
be complete just because I've expended the last 3 days trying to track those
horrible compiler bugs.

   Best regards,

   Brusque

-----------------------------------------------------------------
Edson Brusque                 C.I.Tronics Lighting Designers Ltda
Research and Development               Blumenau  -  SC  -  Brazil
Say NO to HTML mail                          http://www.citronics.com.br
-----------------------------------------------------------------

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...