ninjanick
Joined: 25 May 2004 Posts: 25
|
PIC16F628A and PCW 3.190 |
Posted: Wed Feb 23, 2005 12:35 am |
|
|
I'm trying to program a PIC16F628A. Looking at the datasheet, the 628A has an internal oscillator and analog ports, however pic16f628a.h doesn't include a setup_oscillator command nor does it have any defines for the analog setup. Is there a new .h file? Do I have to edit the part to make it work? |
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 23, 2005 8:49 am |
|
|
The 16F628A has the basic oscillator selections which are set in the
Config Word. CCS lets you set them in the #fuses statement.
Look at the top of the 16F628A.H file for the allowable settings.
These will be HS, XT, etc. Look in the data sheet, in the section
on "Special Features of the CPU", at the chart for "Register 14-1".
This will show the settings that the .H file refers to.
The setup_oscillator() function is only used with chips that have
a more complex oscillator module. It may allow different clock
speeds or switching between internal and external clocks, etc.
The data sheets for this type of PIC will have an entire section
on the Oscillator. It won't be just part of "Special Features".
Look at the 16F88 for an example.
With regard to the analog section, the 16F628A doesn't have an
A/D converter. It does have analog pins, but they're for use with
the built-in comparator. You should use the setup_comparator()
function to configure it. |
|