Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: Hilfe zum 908AP32? Kategorie: Programmierung ASM (von Dietmar, Homepage - 20.10.2005 0:56)
 Als Antwort auf Hilfe zum 908AP32? von Andreas - 19.10.2005 21:53
Dietmar nutzt:  CC1-M-Unit V1.1, Advanced CC1-Unit, Open-Micro, Open-Mini

Hallo Andreas

vermutlich bist Du auf den gleichen Fehler gestoßen, der mir vor einigen Monaten aufgefallen war. Der Kontroller 68HC908AP32 resettet sofort, wenn auf PLL-Clock (CGMPCLK, VCO-Clock, CGMVCLK) mit mehr als 4 MHz umgeschaltet wird. Bei der Suche nach dem Fehler habe ich sukzessive an verschiedenen Pins Kondensatoren hinzugefügt. Es ist wohl so, daß in der Schaltung in Bild 10-1 ein 100-nF-Kondensator am Pin VREG fehlt. Größer als dieser Wert sollte aber auch nicht eingesetzt werden, siehe Mask Set Errata. Aufgefallen war mir auch, daß das CGMXFC-Filter an verschiedenen Stellen im Manual unterschiedlich dimensioniert wird. Zumindest mit 4 MHz klappen offenbar alle (beide) Schaltungsarten.

Hier mein Sourcecode um im Forced Monitor Mode von 2,4576 MHz auf 8,003584 MHz umzuschalten:

; PLL related Registers

PCTL equ $0036   ;PLL Control Register
PLLIE equ 7       ;PLL Interrupt Enable Bit
PLLF  equ 6       ;PLL Interrupt Flag Bit
PLLON equ 5       ;PLL On Bit
BCSB  equ 4       ;Base Clock Select Bit
PRE1  equ 3       ;Prescaler Program Bit \ for
PRE0  equ 2       ;Prescaler Program Bit /  P
VPR1  equ 1       ;VCO Power-of-Two Range Select Bits \ for
VPR0  equ 0       ;VCO Power-of-Two Range Select Bits /  E

PBWC equ $0037   ;PLL Bandwidth Control Register
AUTO  equ 7       ;Automatic Bandwidth Control Bit
LOCK  equ 6       ;Lock Indicator Bit
ACQ   equ 5       ;Acquisition Mode Bit

PMSH equ $0038   ;PLL Multiplier Select Register High (4 Bits) \ for
PMSL equ $0039   ;PLL Multiplier Select Register Low (8 Bits)  /  N

PMRS equ $003A   ;PLL VCO Range Select Register - for L

PMDS equ $003B   ;PLL Reference Divider Select Register (4 Bits) - for R


; ---------------------------------------------------------------------------
; Mittels PLL (Phase Locked Loop) vom Quarztakt von 32,768 kHz auf rund
; 8 MHz Bustakt (mit 0,448 Promille nomineller Abweichung) kommen.
; ---------------------------------------------------------------------------

; The BCS bit in the PLL control register (PCTL) selects which clock drives
; CGMOUT. The divided VCO clock cannot be selected as the base clock
; source if the PLL is not turned on. The PLL cannot be turned off if the
; divided VCO clock is selected. The PLL cannot be turned on or off
; simultaneously with the selection or deselection of the divided VCO
; clock. The divided VCO clock also cannot be selected as the base clock
; source if the factor L is programmed to a 0. This value would set up a
; condition inconsistent with the operation of the PLL, so that the PLL
; would be disabled and the oscillator clock would be forced as the source
; of the base clock.
                 
set8MHz:  

  ; im Forced-Monitor-Mode laeuft der Kontroller mit fBUS = 2,4576 MHz

  bclr BCSB,PCTL     ;auf XTAL-Clock (fXTAL) umschalten, fBUS = 8 kHz
  bclr PLLON,PCTL    ;PLL ausstellen
 
  ; an dieser Stelle sind PLLON und BCSB geloescht
 
  mov #$02,PCTL      ;P=0, E=2
  mov #$03,PMSH      ;N=$03d1=977
  mov #$d1,PMSL
  mov #$40,PMRS      ;L=$40
  mov #$01,PMDS      ;R=1

  bset PLLON,PCTL    ;PLL anschalten
  bset AUTO,PBWC     ;automatischer Modus
set8MHz_1            ;warten, bis CGMVCLK (PLL-Clock) eingelockt ist
  brclr LOCK,PBWC,set8MHz_1

  ; der folgende Befehl laesst den Kontroller resetten, wenn am VREG-Pin
  ;   kein keramischer 100-nF-Kondensator liegt...

  bset BCSB,PCTL     ;auf PLL-Clock (CGMPCLK, VCO-Clock, CGMVCLK) umschalten

  ; Der Bustakt betraegt nun N*fXTAL/4 = 977*32,768 kHz/4 = 8,003584 MHz.
  ;   (Falls der Quarz mit exakt 32,768 kHz schwingen wuerde.)

  rts


Viel Glück
Dietmar

Meine Homepage: http://ccintern.dharlos.de

 Antwort schreiben

Bisherige Antworten:

Re: Hilfe zum 908AP32? (von Andreas - 20.10.2005 1:40)