PDA

View Full Version : Pic16f88



jcleaver
- 28th March 2007, 03:09
TRYING TO USE THE INTERNAL OSC ON THIS CHIP

ANYONE KNOW THE CORECT SYNTAX?
DEVICE pic16F88, INTRC_OSC_NOCLKOUT

DOES NOT WORK

THANKS

skimask
- 28th March 2007, 04:10
TRYING TO USE THE INTERNAL OSC ON THIS CHIP

ANYONE KNOW THE CORECT SYNTAX?
DEVICE pic16F88, INTRC_OSC_NOCLKOUT

DOES NOT WORK

THANKS

If you can't get it to work internally, then at least try to get it to work with an external clock. Then work towards getting the internal to work. It might be somehow stuck on one of the lower speeds (32khz or whatever) and you're not waiting long enough.
Write a 'blink the led' code...make it work on the external, then switch...see what happens...

paul borgmeier
- 28th March 2007, 05:38
http://www.picbasic.co.uk/forum/showthread.php?t=3374&highlight=16f88

flotulopex
- 28th March 2007, 09:27
These are the settings I use everyday:
' Oscillator
' EXTRC_OSC_CLKOUT, EXTRC_OSC_NOCLKOUT, EXTRC_OSC, INTRC_OSC_CLKOUT
' INTRC_OSC_NOCLKOUT, INTRC_OSC, EXTCLK_OSC, EC_OSC, HS_OSC, XT_OSC, LP_OSC
@ DEVICE PIC16F88, INTRC_OSC_NOCLKOUT

' Program Code Protection
' Set to PROTECT_OFF for Development Copy
' Set to PROTECT_ON for Release Copy
@ DEVICE PIC16F88, PROTECT_OFF

' Watchdog Timer
@ DEVICE PIC16F88, WDT_ON

' Power-On Timer
@ DEVICE PIC16F88, PWRT_ON

' Master Clear Options (Internal)
@ DEVICE PIC16F88, MCLR_ON

' Brown-Out Detect
@ DEVICE PIC16F88, BOD_ON

' Low-Voltage Programming
' If set to ON, RB3 is no longer available!!! see d.-s.
@ DEVICE PIC16F88, LVP_OFF

' Data Memory Code Protect
' Set to CPD_OFF for Development Copy
' Set to CPD_ON for Release Copy
@ DEVICE PIC16F88, CPD_OFF

' DEBUGGER
@ DEVICE PIC16F88, DEBUG_OFF

' CCPM1 choice:
' Set OFF for function on RB0 (default)
' Set ON for function on RB3
@ DEVICE PIC16F88, CCPMX_OFF
Fuses ending with "ON" or "OFF" can be set vice-versa.

peterdeco1
- 28th March 2007, 09:44
I use this on my 'F88 program and it works without any problem.

OSCCON = $60 'set int osc to 4mhz
ANSEL = 0 'ANALOG INPUTS ALL DIGITAL
ADCON0 = 0 'AD MODULE OFF
CMCON = 7 'COMPARATORS OFF
@ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_ON

jcleaver
- 28th March 2007, 16:12
pic works fine with external osc

still having issues with internal pic manual seem to indicate it has 2 internal osc commands and three osc speed with 8 the defualt but does not list the
commands

1. LP Low-Power Crystal
2. XT Crystal/Resonator
3. HS High-Speed Crystal/Resonator
4. RC External Resistor/Capacitor with
FOSC/4 output on RA6
5. RCIO External Resistor/Capacitor with
I/O on RA6
6. INTIO1 Internal Oscillator with FOSC/4
output on RA6 and I/O on RA7
7. INTIO2 Internal Oscillator with I/O on RA6
and RA7
8. ECIO External Clock with I/O on RA6

4.5 Internal Oscillator Block
The PIC16F87/88 devices include an internal oscillator
block which generates two different clock signals;
either can be used as the system’s clock source. This
can eliminate the need for external oscillator circuits on
the OSC1 and/or OSC2 pins.
The main output (INTOSC) is an 8 MHz clock source
which can be used to directly drive the system clock. It
also drives the INTOSC postscaler which can provide a
range of six clock frequencies from 125 kHz to 4 MHz.
The other clock source is the internal RC oscillator
(INTRC) which provides a 31.25 kHz (32 µs nominal
period) output. The INTRC oscillator is enabled by
selecting the INTRC as the system clock source or
when any of the following are enabled:
• Power-up Timer
• Watchdog Timer
• Two-Speed Start-up
• Fail-Safe Clock Monitor

seems to have somethjing to do with the " fosc : " seting but have never seen this used


also i want to use the internal ad convertor

thanks for any help

flotulopex
- 28th March 2007, 20:31
Look at the OSCCON register (it's in your post!).

You'll be able to select the desired frequency.

Pic_User
- 28th March 2007, 20:46
See if this forum thread helps.
http://www.picbasic.co.uk/forum/showthread.php?p=15901

-Adam-

flotulopex
- 28th March 2007, 22:27
TRYING TO USE THE INTERNAL OSC ON THIS CHIP

ANYONE KNOW THE CORECT SYNTAX?
DEVICE pic16F88, INTRC_OSC_NOCLKOUT

DOES NOT WORK

THANKS

You're absolutely right, it won't work as you wrote it.

1) you must state the "@" in front of the word "DEVICE...";

2) show you code; if you need some help, give some valuable info;

3) SHOUTING never helps... and isn't motivating others to help you;

4) here is a complete fuse initialisation - don't edit, just copy/paste it because this works!!!. It is not the shortest example but, at least, you can see every fuse declaration separately.

@ DEVICE PIC16F88,INTRC_OSC_NOCLKOUT
@ DEVICE PIC16F88,PROTECT_OFF
@ DEVICE PIC16F88,WDT_OFF
@ DEVICE PIC16F88,PWRT_ON
@ DEVICE PIC16F88,MCLR_ON
@ DEVICE PIC16F88,BOD_OFF
@ DEVICE PIC16F88,LVP_OFF
@ DEVICE PIC16F88,CPD_OFF
@ DEVICE PIC16F88,DEBUG_OFF
@ DEVICE PIC16F88,CCPMX_OFF

If you then want your PIC to work at 4MHz, add this:

OSCCON = %01100000 '4MHz

The advantage of SHOUTING is that some people can take their glasses off to read this post :D