I'm using the linux compiler for the 18X device and having trouble understanding some errors it gives me:
1) A program containing the following:
symbol sdi = 5 ' 9852 serial data in (on sdio pin)
low sdi
out_32:
For b13 = 0 To 15 ; shift out MS 16 bits
sdi = bit15 ; from the MSB
pulsout sclk, us10 ; pulse sclk
w0 = w0 * 2 ; shift the word left one place
Next
Gives this error
PICAXE-18X Enhanced Compiler. Version 0.4
sdi = bit15 ; from the MSB
^
line# 110, col# 8
Error: syntax error
--------------------------------------------
2) A program containing the following:
symbol sdi = outpin5 ' 9852 serial data in (on sdio pin)
low sdi
out_32:
For b13 = 0 To 15 ; shift out MS 16 bits
sdi = bit15 ; from the MSB
pulsout sclk, us10 ; pulse sclk
w0 = w0 * 2 ; shift the word left one place
Next
Gives this error
low sdi
^
line# 43, col# 5
Error: This command requires '5' not the variable 'pin5'!
---------------------------------------------
3) This compiles ok:
symbol sdi = 5 ' 9852 serial data in (on sdio pin)
low sdi
out_32:
For b13 = 0 To 15 ; shift out MS 16 bits
outpin5 = bit15 ; from the MSB
pulsout sclk, us10 ; pulse sclk
w0 = w0 * 2 ; shift the word left one place
Next
-----------------------------------------------
I'm trying to be symbolic about this, and 3) isn't doing that. I can see that 1) could be expected not to work as the symbol replacement in the For loop says "5 = bit15". I'm surprised that 2) isn't ok.
Any ideas, have I misunderstood something?
TIA
Chris
1) A program containing the following:
symbol sdi = 5 ' 9852 serial data in (on sdio pin)
low sdi
out_32:
For b13 = 0 To 15 ; shift out MS 16 bits
sdi = bit15 ; from the MSB
pulsout sclk, us10 ; pulse sclk
w0 = w0 * 2 ; shift the word left one place
Next
Gives this error
PICAXE-18X Enhanced Compiler. Version 0.4
sdi = bit15 ; from the MSB
^
line# 110, col# 8
Error: syntax error
--------------------------------------------
2) A program containing the following:
symbol sdi = outpin5 ' 9852 serial data in (on sdio pin)
low sdi
out_32:
For b13 = 0 To 15 ; shift out MS 16 bits
sdi = bit15 ; from the MSB
pulsout sclk, us10 ; pulse sclk
w0 = w0 * 2 ; shift the word left one place
Next
Gives this error
low sdi
^
line# 43, col# 5
Error: This command requires '5' not the variable 'pin5'!
---------------------------------------------
3) This compiles ok:
symbol sdi = 5 ' 9852 serial data in (on sdio pin)
low sdi
out_32:
For b13 = 0 To 15 ; shift out MS 16 bits
outpin5 = bit15 ; from the MSB
pulsout sclk, us10 ; pulse sclk
w0 = w0 * 2 ; shift the word left one place
Next
-----------------------------------------------
I'm trying to be symbolic about this, and 3) isn't doing that. I can see that 1) could be expected not to work as the symbol replacement in the For loop says "5 = bit15". I'm surprised that 2) isn't ok.
Any ideas, have I misunderstood something?
TIA
Chris