- 12V Akku mit 280 Ah bauen         
Ergebnis 1 bis 2 von 2

Thema: PIC18F14k50: LFINTOSC schwingt nicht.

  1. #1
    Neuer Benutzer Öfters hier
    Registriert seit
    08.06.2010
    Beiträge
    26

    PIC18F14k50: LFINTOSC schwingt nicht.

    Anzeige

    LiFePo4 Akku selber bauen - Video
    Dieser Code funktioniert, der PIC arbeitet mit 31250 Hz:

    Code:
            OSCCONbits.SCS1 = 1;
    
            OSCCONbits.IRCF0 = 0;
            OSCCONbits.IRCF1 = 0;
            OSCCONbits.IRCF2 = 0;
    
            OSCTUNEbits.INTSRC = 1;
    
            //INTSRC: Internal Oscillator Low-Frequency Source Select bit
            //1: 31.25 kHz device clock derived from 16 MHz HFINTOSC source (divide-by-512)
            //0: 31.00 kHz device clock derived directly from LFINTOSC internal oscillator
    Dieser Code funktioniert nicht, der PIC rührt sich nicht, obwohl die Bedingungen erfüllt wurden:

    Code:
            OSCCONbits.SCS1 = 1;
     
            OSCCONbits.IRCF0 = 0;
            OSCCONbits.IRCF1 = 0;
            OSCCONbits.IRCF2 = 0;
    
            OSCTUNEbits.INTSRC = 0;
    
            //INTSRC: Internal Oscillator Low-Frequency Source Select bit
            //1: 31.25 kHz device clock derived from 16 MHz HFINTOSC source (divide-by-512)
            //0: 31.00 kHz device clock derived directly from LFINTOSC internal oscillator
    Hier noch meine Config:

    Code:
    #pragma config FOSC   = IRC      //POR => Internal RC oscillator.
    #pragma config PLLEN  = OFF      //PLL is ENABLED.
    #pragma config CPUDIV = NOCLKDIV //No CPU System Clock divide.
    #pragma config HFOFST = OFF      //Warten bis System-clock stabil.  
    #pragma config PCLKEN = OFF      //Primary clock is under software control.
    #pragma config FCMEN  = OFF      //Fail-Safe Clock Monitor disabled.
    
    #pragma config PWRTEN = ON       //Power-UP-Timer enabled.
    #pragma config MCLRE  = ON       //MCLR pin enabled, RA3 input pin disabled.
    
    #pragma config BOREN  = ON       //Brown-out Reset enabled.
    #pragma config BORV   = 30       //VBOR set to 3.0V  
    /*
    #pragma config BORV   = 27       //VBOR set to 2.7V  
    #pragma config BORV   = 22       //VBOR set to 2.2V  
    #pragma config BORV   = 19       //VBOR set to 1.9V  
    */
    
    #pragma config IESO   = OFF //Oscillator Switchover mode disabled.
    #pragma config LVP    = OFF //Low Voltage ICSP.
    #pragma config STVREN = OFF //Stack full/underflow will not cause Reset.
    #pragma config WDTEN  = OFF //Watchdog Timer OFF.
    
    #pragma config BBSIZ  = OFF //1kW boot block size.
    #pragma config EBTR0  = OFF //Block 0 not prot. from table reads exec. in other blocks.
    #pragma config EBTR1  = OFF //Block 1 not prot. from table reads exec. in other blocks.
    #pragma config EBTRB  = OFF //Boot block not prot. from table reads exec. in other blocks.
    
    #pragma config WRT0   = OFF //Block 0 not write-protected. 
    #pragma config WRT1   = OFF //Block 1 not write-protected.
    #pragma config WRTB   = OFF //Boot block not write-protected.
    #pragma config WRTC   = OFF //Configuration registers not write-protected.
    #pragma config WRTD   = OFF //Data EEPROM not write-protected.
    
    //CPn-Bit's schützen vor externen Read/Write angriffen.
    #pragma config CP0    = OFF //OFF: Block 0 not code-protected.
    #pragma config CP1    = OFF //OFF: Block 1 not code-protected.
    #pragma config CPB    = OFF //OFF: Boot block not code-protected.
    #pragma config CPD    = OFF //OFF: Data EEPROM not code-protected.
    
    #pragma config XINST  = OFF //Instruction set extension & Indexed Addr. mode disabled.
    Danke für die Hilfe.

  2. #2
    Neuer Benutzer Öfters hier
    Registriert seit
    08.06.2010
    Beiträge
    26
    Hab' den Fehler eben selbst gefunden:

    Code:
    while (OSCCONbits.IOFS == 0) ;    //Warten bis Frequenz stabil.
    Diese Abfrage kann man nur für HFINTOSC machen. Der PIC lief, aber hat sich an dieser Zeile aufgehängt.

    Immerhin weiss ich jetzt, dass HFINTOSC tatsächlich abgeschaltet ist.
    Geändert von BioSniper (23.05.2011 um 16:40 Uhr)

Ähnliche Themen

  1. Quarz schwingt nicht--M2560
    Von Bauteiltöter im Forum AVR Hardwarethemen
    Antworten: 13
    Letzter Beitrag: 02.01.2009, 14:12
  2. Quarz schwingt nicht richtig
    Von KST im Forum AVR Hardwarethemen
    Antworten: 11
    Letzter Beitrag: 21.06.2007, 09:33
  3. Atmega128L - 32.768kHz Quarz schwingt nicht
    Von TRM2000 im Forum AVR Hardwarethemen
    Antworten: 0
    Letzter Beitrag: 22.09.2006, 21:55
  4. ATmega8535-16JI externer Quarz schwingt nicht ?
    Von Europasolar im Forum AVR Hardwarethemen
    Antworten: 2
    Letzter Beitrag: 12.08.2005, 14:56
  5. 16Mhz Quarz schwingt von einem Tag auf anderen nicht korrekt
    Von Frank im Forum AVR Hardwarethemen
    Antworten: 7
    Letzter Beitrag: 03.06.2004, 21:04

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

12V Akku bauen