Forum: Mikrocontroller und Digitale Elektronik dsPIC30F6010A + OSCCON write protection


von clemy (Gast)


Lesenswert?

Hallo,

ich habe einen dsPIC30F6010A und will den internen FRC oszillator mit 
PLL x16 verwenden.

Wenn man im CCSC compiler als FUSE FRC_PLL16 eingibt kommt folgender 
Fehler:

"The configuration bits are invalid and might cause problems if 
programmed. do you want them to set them to the default value?"

config field FOSFPR

yes / no"

bei "no" bleibt bleibt PLL deaktiviert, bei "yes" tut sich nichts.

D.h. will ich die Register selbst setzen.

OSCCON ist eine 16 bit register.

Im Datenblatt
http://ww1.microchip.com/downloads/en/devicedoc/70150a.pdf
auf S.155 steht folgendes:

"To write to the OSCCON high byte, the following
instructions must be executed without any other
instructions in between:

Byte Write “0x78” to OSCCON high
Byte Write “0x9A” to OSCCON high"


Meine Frage: wie kann ich von einem 16 Bit Register nur das high byte 
beschreiben?

danke,

lg clemy

von Lehrmann M. (ubimbo)


Lesenswert?

entweder einzeln mittels Bitmanipulation:
http://www.mikrocontroller.net/articles/Bitmanipulation

oder im Endeffekt das gleiche einfach eine |=

OSCCON |= 0b1111000000000000;           // = 0x78 im high byte


ich tu noch bisschen rumschauen - mit << und >> kann man da sicherlich 
auch was machen.

von clemy (Gast)


Lesenswert?

danke für deine hilfe,

leider funktioniert es so nicht.

kann es sein das folgende deklaration richtig ist:

#word OSCCON = 0x0742   //Oscillator Control Register

#byte OSCCONL = 0x0742
#byte OSCCONH = 0x0743



Da im p30f6010A.inc file folgendes steht:
         .equiv OSCCONL, _OSCCON
         .equiv OSCCONH, _OSCCON+1



lg clemy

von clemy (Gast)


Lesenswert?

die lösung:

ccsc compiler auf 4.111 updaten und unter

#fuses FRC_PLL16 schreiben.

so simpel...

lg

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.