no i didn't - just could get the BS to work using uart. but I did get it working just fine with some bit banging the SPI.
------------- code below here is for bit banging SPI ---------
' {$STAMP BS2}
' {$PBASIC 2.5}
' setup o/i pins
dataready PIN 15
busy PIN 14
spi_sck PIN 13
spi_miso PIN 12
spi_mosi PIN 11
spi_ssel PIN 10
reset PIN 9
' INSTRUCTIONS
'>O 1R>boot<CR>
'<!00<CR>
' loop
'>R 1^>1<CR>
'<!00<CR>
'<X$00000001<CR> ------ result is 1 when something was read, note this is the left that was actuall read ---
'<!00<CR>
' end loop when result is ---- start end of file -----
'>R 1^>1<CR>
'<!00<CR>
'<^$00000000<CR> ----- result is 0 when nothing left to read -----
'<!00<CR>
'end of file result ----- finish end of file result -----
'>C 1<CR>
'<!00<CR>
'>Z H<CR>
'<!00<CR>
''''''''''' begin main loop ''''''''''''
cmd VAR Byte(10)
counter VAR Byte
GOSUB func_Reset
DO WHILE dataready=1
GOSUB func_ReadByte
DEBUG STR inbyte\1
LOOP
DO
DEBUG "cmd: "
DEBUGIN STR cmd \10 \13
'DEBUG STR ? cmd
FOR counter = 0 TO 9
IF cmd(counter)<>0 THEN
outbyte=cmd(counter)
GOSUB func_WriteByte
ENDIF
NEXT
outbyte=13
GOSUB func_WriteByte
'PAUSE 500
DO
DEBUG "."
LOOP WHILE (dataready=0)
DO WHILE dataready=1
GOSUB func_ReadByte
IF inbyte<>255 THEN
DEBUG STR inbyte\1
ENDIF
LOOP
LOOP WHILE cmd<>"."
DEBUG "Finished",CR
STOP
'''''''''''''' uALFAT subroutines ''''''''''
func_Reset:
' reset to spi interface
HIGH reset ' reset pin
HIGH spi_ssel ' spi_ssel# (active low ) set high to activate SPI
HIGH spi_sck ' spi_sck set high to active SPI
PAUSE 5
LOW reset ' toggle reset
PAUSE 5
HIGH reset ' bring reset back
PAUSE 5
RETURN
' results from ReadByte function will be stored in this variable
inbyte VAR Byte
outbyte VAR Byte
func_ReadByte:
LOW spi_ssel ' activate chip select (active low)
'PAUSE 100
DO: LOOP WHILE (dataready=0)
HIGH spi_mosi ' force 0xFF to uALFAT
HIGH spi_sck ' idle high
bits VAR Byte
FOR bits = 0 TO 7
LOW spi_sck ' ok to read data after this line
'PAUSE 2
' read in the response
inbyte = inbyte<<1
inbyte = inbyte | spi_miso
HIGH spi_sck
NEXT
RETURN
func_WriteByte:
LOW spi_ssel
' check the busy line
DO : LOOP WHILE (busy=1)
FOR bits = 0 TO 7
IF outbyte.BIT7=0 THEN
LOW spi_mosi
ELSE
HIGH spi_mosi
ENDIF
outbyte =outbyte<< 1
LOW spi_sck
PAUSE 2
HIGH spi_sck
NEXT
RETURN