to Technical: spiout documentation error?

womai

Senior Member
The Picaxe Basic manual says about the spiout command:

- sclk is a variable/constant (0-7) which specifies the i/o pin to use as clock.
- sdata is a variable/constant (0-7) which specifies the i/o pin to use as data.

That did not work on my 28X1 - the reason being that actually it's not I/O pins (i.e. portc) but regular output-only pins (portb). Guess that should be fixed. I haven't tried it (my SPI slave doesn't have an SDO) but I suspect the sdata pin on the spiin command must be a portc pin though?

Wolfgang
'
 

Technical

Technical Support
Staff member
why are just portc i/o pins - all input and/or output pins are i/o pins as far as we are concerned.

But yes, this command requires these two pins to be outputs. sdata must be an input pin for spiin
 

womai

Senior Member
> why are just portc i/o pins - all input and/or output pins are i/o pins as far as we are concerned.

That is only true for the underlying Micropic, not for the Picaxe. If you look at the Picaxe "Get Started" manual, page 26 (Picaxe 28 pinouts), it says for the 28X1 "Output x" (x = 0..7) for the port B pins, but "In x/Out cx" for the port C pins. So if the Basic manual talks about "I/O pins" that seems to clearly indicate portc. Especially as afaik there is no non-hack way to make the portb pins inputs.
 
Top