Anyone compiled OK for Pic10F206 ? - setup_comparator
Posted: Fri Nov 26, 2004 2:08 pm
Hi
I?ve just received my first Pic10F206's and tried to compile the code below (just to get going - created by the project wizard) and it fails with error 12, highlighting the ?setup_comparator? statement.
I cannot figure out what's wrong. It seems like the compiler thinks that this device doesn't have a comparator.
Can you please let me know what I'm doing wrong please?
Thanks
Les Otter
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri Nov 26, 2004 2:47 pm
When CCS adds support for a new chip, they very frequently make
mistakes with the A/D and the comparator modules. Based on
your post, it appears that they have done this with the comparator
in the 10F206.
You should email them about this, but in the meantime, you can
setup the comparator yourself by defining the register address of
the CMCON0 register, and then writing a byte directly to that register.
Refer to the 10F206 data sheet for the correct settings for CMCON0.
Example:
Code:
#include <10F206.H>
(Put your #use delay and #fuses statements here)
#byte CMCON0 = 0x07 // Define the address of CMCON0
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