-
pic12f683 setup
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
-
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
-
1 Attachment(s)
Maybe someting more..
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=118354561 4">
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.