Hello, i have an AP8 and this work perfect with the internal oscilator, but a need use the cristal oscilator. I make a routine to configurate pctl,pmsh,pmsl,pmrs,pmds and pbwc register but doesn´t work. The routine is:
mov #%00111001,config1
mov #%00000001,config2
mov #%00000001,pctl ;programo P=$0, E=$0
mov #%00000001,pmsh ;programo N=$F5 con pmsh y pmsl
mov #%11101001,pmsl ;programo N=$F5 con pmsh y pmsl
mov #%01000000,pmrs ;programo L=$40
mov #%00000001,pmds ;R=$1
bset 5,pctl ;enciendo el PLL con el bit PLLON=1
bset 7,pbwc ;pongo en modo automático en PLL con el bit AUTO=1
waitPLL:
brclr 6,pbwc,waitPLL ;salta a waitPLL si el bit LOCK=0
;( frecuencia incorrecta o variable)
bset 4,pctl ;sino sigue y engancha a frecuencia del PLL
Los parámtros P,N,L,E son para Fbus=2MHz, GCMVCLK=GCMPCLK=8MHz
What is the problem?