I tried to use the pic 10F202, but I found some problems.
'
I was not able to define the I/O, I tried in different ways like:
DIR PORTIO0.0 OUT
DIR IO0.0 OUT
DIR b'00001000'
but I always got errors in compiled.lst
'
I was not able to set register OPTION.
So I thought to use assembler to overcome the two problems:
movlw b'00001000'
tris 0x6
movlw b'00001000'
option
the assembler code at output is:
;Start of the main program
movlw B'00001000'
TRIS 0X6
movlw B'00001000'
OPTION
BASPROGRAMEND
sleep
goto $
--------------------
Keywords TRIS and OPTION are in the first column as labels so I am again in trouble.
The last problem is that GCbasic puts in compiled.asm the following code:
;Interrupt routine
ORG 4
INTERRUPT
;Interrupt code will be inserted here in a later version
retfie
but 10F202 doesn't have the interupt so in the file compiled.lst I have the following lines:
00021
00022 ;Interrupt routine
0004 00023 ORG 4
0004 00024 INTERRUPT
00025 ;Interrupt code will be inserted here in a later version
Error [174] : Unknown opcode "retfie"
00026 retfie
00027
Regards
Stefano
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Those bugs should be fixed in the latest version (0.9.1.1) which I've just uploaded. "option" and "tris" are now recognized as valid assembly commands, and the "retfie" is only present on chips which can support interrupts. DIR now works on 10 and 12 chips.
The DIR command cannot control individual bits on most smaller chips (including the 10F202). To use it, this is the syntax:
DIR GPIO b'00001100'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried to use the pic 10F202, but I found some problems.
'
I was not able to define the I/O, I tried in different ways like:
DIR PORTIO0.0 OUT
DIR IO0.0 OUT
DIR b'00001000'
but I always got errors in compiled.lst
'
I was not able to set register OPTION.
So I thought to use assembler to overcome the two problems:
movlw b'00001000'
tris 0x6
movlw b'00001000'
option
the assembler code at output is:
;Start of the main program
movlw B'00001000'
TRIS 0X6
movlw B'00001000'
OPTION
BASPROGRAMEND
sleep
goto $
--------------------
Keywords TRIS and OPTION are in the first column as labels so I am again in trouble.
The last problem is that GCbasic puts in compiled.asm the following code:
;Interrupt routine
ORG 4
INTERRUPT
;Interrupt code will be inserted here in a later version
retfie
;********************************************************************************
but 10F202 doesn't have the interupt so in the file compiled.lst I have the following lines:
00021
00022 ;Interrupt routine
0004 00023 ORG 4
0004 00024 INTERRUPT
00025 ;Interrupt code will be inserted here in a later version
Error [174] : Unknown opcode "retfie"
00026 retfie
00027
Regards
Stefano
There appear to be some bugs in GCBASIC relating to 10F chips! I'll fix them within the next couple of days - thanks for telling me about them!
Those bugs should be fixed in the latest version (0.9.1.1) which I've just uploaded. "option" and "tris" are now recognized as valid assembly commands, and the "retfie" is only present on chips which can support interrupts. DIR now works on 10 and 12 chips.
The DIR command cannot control individual bits on most smaller chips (including the 10F202). To use it, this is the syntax:
DIR GPIO b'00001100'
Thank you Hugh, I appreciate very much your effort to improve GCBasic. I really like GCbasic a lot.
Regards
Stefano