serial cog loader
rjo__
Posts: 2,114
in Propeller 2
This is so simple I couldn't believe it myself:)
And if it weren't for Rayman's work and Chip's loader, I would never have seen it!!
Thanks guys.
the test object is the compiled version of this
the loader expects a byte containing the cog number, then three bytes representing the byte count ... and then the raw output of the obj file. I don't stop the cog first... so if you want you can get all of the empty cogs blinking by repeatedly loading the same file.
Makes me happier than.... you know:)
And if it weren't for Rayman's work and Chip's loader, I would never have seen it!!
Thanks guys.
getSerialobj call #rcv_char mov whichcog,rx_char call #rcv_char setbyte numbytes,rx_char,#2 call #rcv_char setbyte numbytes,rx_char,#1 call #rcv_char setbyte numbytes,rx_char,#0 wrfast #0,#0 .nextbytes call #rcv_char wfbyte rx_char djnz numbytes,#.nextbytes coginit whichcog,##0 ret
the test object is the compiled version of this
dat orgh 0 ' ' ' blink ' org blink cogid x 'which cog am I? setb dirb,x 'make that pin an output notb outb,x 'flip its output state add x,#16 'add to my id shl x,#18 'shift up to make it big waitx x 'wait that many clocks jmp #blink 'do it again x res 1
the loader expects a byte containing the cog number, then three bytes representing the byte count ... and then the raw output of the obj file. I don't stop the cog first... so if you want you can get all of the empty cogs blinking by repeatedly loading the same file.
Makes me happier than.... you know:)
Comments