Autor Tema: Configurar el PLL del 16f727  (Leído 5413 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado martpic

  • PIC12
  • **
  • Mensajes: 54
Configurar el PLL del 16f727
« en: 02 de Octubre de 2009, 23:12:29 »
Holaa Amigos.... Un amigo me regalo 3 pic 16f727 en el cual quiero configurar el oscilador interno... Pero tengo q configurar el PLL y ponerlo en 1 para q trabaje con oscilador interno a 4MHZ... Pero PICC no tiene para configurar en los fuses al pll y no se como hacerlo.....



Me podrian ayudar dando ideas de como configurar...

« Última modificación: 02 de Octubre de 2009, 23:21:54 por martpic »

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Re: Configurar el PLL del 16f727
« Respuesta #1 en: 02 de Octubre de 2009, 23:26:03 »
Quien dijo que CCS no tiene para configurar ese fuse?? :mrgreen:

Aqui un poco de codigo, justo de ese micro...

Código: C
  1. #include <16LF727.h>
  2.  
  3. #include "captouch.h"
  4.  
  5. #FUSES HS                        //Cristal de 8 Mhz
  6. #FUSES NOWDT                     //Sin Watch Dog Timer
  7. #FUSES NOPROTECT                 //Código abierto
  8. #FUSES PLLEN                     //Habilita PLL
  9. #FUSES NODEBUG                   //No Debug
  10. #FUSES NOMCLR                    //NO Master Clear pin
  11. #FUSES NOBROWNOUT                //No brownout reset
  12. #FUSES NOPUT                     //No Power Up Timer
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.

Desconectado martpic

  • PIC12
  • **
  • Mensajes: 54
Re: Configurar el PLL del 16f727
« Respuesta #2 en: 02 de Octubre de 2009, 23:38:30 »
Hola... Gracias por la pronta respuesta pero en la version q tengo la 4.065 le agrego eso de PLL y me sale error.... Que version CCS Manejas??????

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Re: Configurar el PLL del 16f727
« Respuesta #3 en: 02 de Octubre de 2009, 23:44:06 »
4.088 y 4.093 :lol:
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.

Desconectado martpic

  • PIC12
  • **
  • Mensajes: 54
Re: Configurar el PLL del 16f727
« Respuesta #4 en: 02 de Octubre de 2009, 23:50:32 »
Y no sabrias como modificar el PLL en CCS????
Una pregunta has podido hacer algun teclado TOUCH con este pic???????

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Re: Configurar el PLL del 16f727
« Respuesta #5 en: 03 de Octubre de 2009, 00:06:00 »
Creo que aqui explica como activar el PLL a gusto...

Código: [Seleccionar]
#USE DELAY

--------------------------------------------------------------------------------

 

Syntax:
 #use delay (clock=speed)

#use delay (clock=speed, restart_wdt)

#use delay (clock=speed, type)

#use delay (clock=speed, type=speed)

#use delay (type=speed)
 
 
Elements:
 speed is a constant 1-100000000 (1 hz to 100 mhz).  This number can contains commas. This number also supports the following denominations: M, MHZ, K, KHZ

 
type defines what kind of clock you are using, and the following values are valid: oscillator, osc (same as oscillator), crystal, xtal (same as crystal), internal, int (same as internal) or rc.  The compiler will automatically set the oscillator configuration bits based upon your defined type.  If you specified internal, the compiler will also automatically set the internal oscillator to the defined speed.

 
restart_wdt will restart the watchdog timer on every delay_us() and delay_ms() use.

 
 
Purpose:
 Tells the compiler the speed of the processor and enables the use of the built-in functions: delay_ms() and delay_us().  Will also set the proper configuration bits, and if needed configure the internal oscillator.  Speed is in cycles per second.  An optional restart_WDT may be used to cause the compiler to restart the WDT while delaying.  When linking multiple compilation units, this directive must appear in any unit that needs timing configured (delay_ms(), delay_us(), UART, SPI).

 
In multiple clock speed applications, this directive may be used more than once.  Any timing routines (delay_ms(), delay_us, UART, SPI) that need timing information will use the last defined #use delay().  For initialization purposes, the compiler will initialize the configuration bits and internal oscillator based upon the first #use delay().

 
 
Examples:
 //set timing config to 32KHz, restart watchdog timer

//on delay_us() and delay_ms()

#use delay (clock=32000, RESTART_WDT)

 
//the following 4 examples all configure the timing library

//to use a 20Mhz clock, where the source is an oscillator.

#use delay (clock=20000000)             //user must manually set HS config bit

#use delay (clock=20,000,000)           //user must manually set HS config bit

#use delay(clock=20M)                   //user must manually set HS config bit

#use delay(clock=20M, oscillator)       //compiler will set HS config bit

#use delay(oscillator=20M)              //compiler will set HS config bit

 
//application is using a 10Mhz oscillator, but using the 4x PLL

//to upscale it to 40Mhz.  Compiler will set H4 config bit.

#use delay(clock=40M, oscillator=10M)       

 
//application will use the internal oscillator at 8MHz.

//compiler will set INTOSC_IO config bit, and set the internal

//oscillator to 8MHz.

#use delay(internal=8M)
 
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.

Desconectado martpic

  • PIC12
  • **
  • Mensajes: 54
Re: Configurar el PLL del 16f727
« Respuesta #6 en: 03 de Octubre de 2009, 00:26:17 »
Gracias... pero creo q ahi configurab ya partiendo de un oscialdor externo.... triste... Voy aver si consigo la otra version de CCS.....

Desconectado MGLSOFT

  • Moderadores
  • DsPIC33
  • *****
  • Mensajes: 7912
Re: Configurar el PLL del 16f727
« Respuesta #7 en: 03 de Octubre de 2009, 00:33:47 »
Huy, estoy ciego...!!!
Recien ahora leo que decias del oscilador interno!!!

Tu aplicacion tiene comunicaciones seriales??
Si es asi no te lo aconsejo usar...
Todos los dias aprendo algo nuevo, el ultimo día de mi vida aprenderé a morir....
Mi Abuelo.

Desconectado martpic

  • PIC12
  • **
  • Mensajes: 54
Re: Configurar el PLL del 16f727
« Respuesta #8 en: 03 de Octubre de 2009, 00:40:52 »
Estoy practicando para ver si hago algo con TOUCH y no se q tan esencial sea el PLL....?

Desconectado Nocturno

  • Administrador
  • DsPIC33
  • *******
  • Mensajes: 18286
    • MicroPIC
Re: Configurar el PLL del 16f727
« Respuesta #9 en: 03 de Octubre de 2009, 03:17:42 »
Según el fichero de definiciones del CCS el oscilador interno se configura con estos dos fuses, el primero de ellos te permite utilizar los pines del oscilador y el segundo no: INTRC_IO,INTRC

Desconectado martpic

  • PIC12
  • **
  • Mensajes: 54
Re: Configurar el PLL del 16f727
« Respuesta #10 en: 03 de Octubre de 2009, 10:38:03 »
Hola... Utilice la otra version de CCS y ahi si pude configurar sin ningun problema el fuses pllen.... Gracias por las molestias.... :-/