PDA

View Full Version : pic12f683 setup



erice1984
- 2nd July 2007, 02:23
I am confused when tryin to decode the datasheet and understand what is going on with with this stuff

DEFINE OSC 4
Do I have to do anything else besides set this in the code to get 4MHz Clock? I want to use the internal clock


CMCON, ANSEL, OPTION_REG, INTCON, GPIO, TRISIO

I have no idea what to do with any of these except GPIO = %000000 to set all pins low and is read from right(GPIO.0) to left(GPIO.5)

Same with TRISIO read right to left, and is used to set pins either input or outputs

Thanks
-Eric

Johan
- 2nd July 2007, 04:01
Hi Eric,

To use internal oscilator OSCCON = $ 60
ANSEL is to choose which one is your ADC input ( 1 = ADC )
CMCON / OPTION_REG are usually set as default

I am too new to PBP / PIC programming. Datasheet can be confusing for us beginner, fortunately here you find experienced gurus and they are willing to share :)

I am still studying the datasheet and yesterday I managed to put characters on LCD

I suggest you to print it, so you can study it everywhere

Johan

flotulopex
- 4th July 2007, 11:48
erice1984,

You may need to set another OSCCON value to make it work with the internal oscillator.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1833&stc=1&d=1183545614">
Either you set OSCCON's register bit 0 to "1" and so force the use of the internal oscillator, or you set the "INTOSC" fuse of the configuration word.