Program a Propeller with the Spinneret
Mike G
Posts: 2,702
I just got this working so I though I would go ahead and publish what I did. Plus my wife has a list of stuff for me to do... She's not happy at all about my weekend break through, go figure!
I created a .NET console application that uploads a Propeller binary to the Spinneret and saves the file in the uploads folder. That's where this demo starts... the file has already been uploaded.
From there it's pretty easy. Well, easy is relative, I could not have done it without solid code from Chip and Kye. It took me a couple of days to figure it out! I'm not the sharpest tool in the shed.
Byte count is coming from the 10 bytes we wrote to memory from the binary upload. Then, instead of reading the binary file from a RAM buffer, read the source bytes directly from the SD card. That's about it. Now we can program a Propeller attached to the Spinneret.
Edit:
Spinneret Pin 24 - RESn on the target Prop
Spinneret Pin 25 - P31 on the target Prop
Spinneret Pin 26 - P30 on the target Prop
You could use Spinneret serial port PINs 30 and 31 to program the target Propeller.
I created a .NET console application that uploads a Propeller binary to the Spinneret and saves the file in the uploads folder. That's where this demo starts... the file has already been uploaded.
From there it's pretty easy. Well, easy is relative, I could not have done it without solid code from Chip and Kye. It took me a couple of days to figure it out! I'm not the sharpest tool in the shed.
- Copy the PropellerLoader methods to the top level object.
- Start up Kye's FAT driver
- Grab the first 10 bytes of the binary file and copy the bytes to memory. Bytes 8 and 9 contain the number of bytes we'll load into the second Propeller.
- Reset the file pointer
- Run the Connect method in Chip's PropellerLoader with a small change to the Communicate method
Byte count is coming from the 10 bytes we wrote to memory from the binary upload. Then, instead of reading the binary file from a RAM buffer, read the source bytes directly from the SD card. That's about it. Now we can program a Propeller attached to the Spinneret.
'send long count ByteCount := byte[CodePtr][8] | byte[CodePtr][9] << 8 BitsOut(ByteCount >> 2, 32) 'send bytes repeat ByteCount 'BitsOut(byte[CodePtr++], 8) BitsOut(SDCard.readByte, 8)
Edit:
Spinneret Pin 24 - RESn on the target Prop
Spinneret Pin 25 - P31 on the target Prop
Spinneret Pin 26 - P30 on the target Prop
You could use Spinneret serial port PINs 30 and 31 to program the target Propeller.
Comments
Hi Mike.
Sounds like you've had a blast with this.
Where is your .net app?
Thanks.
I can't remember if I published the SPIN method counterpart; a little verbose.
EDIT: Downloaders, make sure you point to your Spinneret URL