osccon statement causes compile to hex failure

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
gtc
Posts: 69
Joined: Mon Mar 23, 2015 5:34 am
Has thanked: 30 times
Been thanked: 15 times
Contact:

osccon statement causes compile to hex failure

Post by gtc »

Flowcode v6.1.2.0

Chip: PIC 12F617 (Internal 4/8MHz oscillator)

Adding the C code:
osccon = 0x70; // 8MHz clock speed

... causes the BoostC compiler to fail with the infamous and always unhelpful "error code 1" message.

The osccon statement is being inserted correctly into the generated C code.

If I disable the C Code icon, the hex compilation completes without error.

(PS: The comment "// 8MHz clock speed" makes no difference on the failure outcome whether it is present or not)

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: osccon statement causes compile to hex failure

Post by kersing »

Where in the data sheet did you find the OSCCON register?


(Hint, this chip is missing this register, clock related settings are available in the configuration)
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

gtc
Posts: 69
Joined: Mon Mar 23, 2015 5:34 am
Has thanked: 30 times
Been thanked: 15 times
Contact:

Re: osccon statement causes compile to hex failure

Post by gtc »

Thanks, that would explain it. :D

Guess I'm too used to PIC16F chips!

Post Reply