#chip 10F200
#option Explicit
OSCCAL.FOSC4 = 1
FOSC4 = 1
Dim AssignBotValueTOVar as Byte = FOSC4
If OSCCAL.FOSC4 = 1 Then
NOP ' do code
End If
If FOSC4 = 1 Then
NOP ' do code
End If
InitTimer1 Timer_FOsc4, PS1_8
ASM expanded to BIT addresses to show actual register.bit address.
GCBASIC compiler has a bug for PIC10F200
OSCCAL.FOSC4 = 1 modifies CAL0 (bit 1) instead of bit 0
I checked the generated .asm file and found the bug.
Thank you.
Use OSCCAL.0 = 1 as a workaround.
i will look into a method to resolve.
Replace your timer.h with the attached. \gcstudio\gcbasic\include\lowlevel folder.
This isolates the CONSTTANT FOSC4 if a register.bit called FOSC4 exists.
This only impacts the 10F2xx chips. 6 microcontrollers.
This now generates the correct ASM
ASM expanded to BIT addresses to show actual register.bit address.
I have also added an inspection in the CDF output file.
Using the old compiler ( same that you have ) you would see.
With the new timer.h and the compiler updated to report ambigous bits, you will see.
I hope this helps.
Thanks for your interest and for taking your time.