View previous topic :: View next topic |
Author |
Message |
mjdale2003
Joined: 10 Oct 2004 Posts: 21 Location: UK
|
12F683 compiler |
Posted: Mon Feb 07, 2005 2:49 pm |
|
|
Hi i an running version 3.127 of the ccs compiler and was wondering if there is any way i can compile for a 12F683 by creating a headder file for the chip and/or creating the device in the chip editor or am i going to have to buy a new copy of the compiler which would be ideal but there must be another way
Regards
Michael Dale |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 07, 2005 6:23 pm |
|
|
I don't have PCWH and no one else has responded yet, so I'll
try to answer this anyway.
I looked at the data sheets for 12F675 and 12F683. The 12F683 has
double the memory that the 12F675 has (ROM, RAM and EEPROM).
Maybe, you could use the 12F675 data as a base and modify it to use
the larger memory size. The RAM map for the 12F683 has 16 bytes
of common RAM at the top of each bank. Does the device editor have
a way to indicate that ?
You will also have to modify the Config Word, since it's different.
The 12F683 has new peripherals that the 12F675 doesn't have, such
as the CCP. If the CCP is in any way non-standard, the built-in CCS
functions won't work for it. You'd have to write your own. In fact,
when CCS comes out with a new chip, it's very common for the built-in
functions to not work. CCS can only put so much in the Device Editor.
There's still a lot of custom code for each chip in the PCM.DLL file.
I haven't looked at all the functions for the 12F683 to see if they work.
Conceivably, you could buy the latest version of the compiler and some
of them might not work yet. |
|
|
mjdale2003
Joined: 10 Oct 2004 Posts: 21 Location: UK
|
osc freq |
Posted: Wed Feb 09, 2005 8:39 am |
|
|
thanks but how can i setup the clock to work at 8mhz without using the setup_osc function |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 09, 2005 3:09 pm |
|
|
The easiest way is to write directly to the OSCCON register.
You need to study the data sheet and decide on the proper
settings for the OSCCON register bits. The set it to that value.
Example:
// Define the address of the OSCCON register in the 12F683.
// This address comes from the SFR table in the data sheet.
#byte OSCCON = 0x8F
main()
{
OSCCON = 0x71; // Setup for 8 MHz with internal oscillator
// Put your other setup code here, such as comparators, analog
// or digital i/o configuration for the pins, etc.
// Put your main program here, after the setup code.
while(1);
} |
|
|
|