Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4787

Setting 8Mhz clock speed on PIC16F684

$
0
0
Can someone kindly help me please?

I am trying to make a PIC16F684 run at 8Mhz instead of the default 4Mhz.

Problem is, test led's just keeping flashing at 10 secs...

I have MPASM ticked as the Compiler/Assembler and using PBP 2.60

Simple code below:

@ __config _INTOSCIO & _WDT_OFF

DEFINE OSC 8

OSCCON = %01110000 ' Internal 8MHz osc
'OSCTUNE = %00000000 ' not in use
ANSEL = %00000000 'Disable analog select so ports work as digital i/o.
CMCON0 = %00000111 'Disable analog comparators.
TRISA = %00000000 'Set PORTA as OUTPUT.
PORTA = %00000000 'Set PORTA pins all low.


Start

main:

HIGH PORTA.2
PAUSE 10000
LOW PORTA.2
PAUSE 2000
HIGH PORTA.2
PAUSE 10000
LOW PORTA.2
PAUSE 2000

goto main

Viewing all articles
Browse latest Browse all 4787

Trending Articles