I am tring to set the oscillator frequency when using the fuse INTRC_IO for the 16F819. I am not sure how to write to OSCCON to set the frequency. Another question is when I am running in stand-alone am I able to use RB4 as an I/O?
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515034
allen_m Guest
Re: 16F819 setting frequency for internal oscillator
Posted: Wed Jun 04, 2003 1:54 pm
:=I am tring to set the oscillator frequency when using the fuse INTRC_IO for the 16F819. I am not sure how to write to OSCCON to set the frequency. Another question is when I am running in stand-alone am I able to use RB4 as an I/O?
To set OSCTUNE do the following in the definition / preamble area
#byte OSCCON = 0x8F; // set the address
Then early in main set it to the frequency you wish ...
OSCCON = 0x70; // 8MHz operation
Re RB4, yes you can use it as IO (by standalone I assume you mean no I2c or SPI).
Allen M.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515037
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