MCP (Master Control Program) simple spin example launcher for beginners
Kilo140
Posts: 3
Hi All,
This is my first posting. Myself and a few friends are having a great time with Propsticks and making our own demo/proto boards. For common interfaces we maintain compatability with the Parallax demo board so we can share demos etc.
One thing all beginners want to do is run up as many demo programs on different cogs at once to get some sense of what the chip can do. My answer is the MCP (Remember Tron?).
I tried to launch spin code by including objects from other files and demo's into mcp but could not launch them with cognew as it appears the code must reside in the object (file)·that is calling cognew. To work around this, I created a level of indirection where I include the OBJ definition for thexternal file in mcp, then create a PRI private definition which just calls the entry point of the external OBJ files. This allows me take lots of examples as posted here, and launch them all with MCP into differing cogs by essentially calling the demo OBJ in its spin file. I also define a sign-on message on composite video which lists each demo as it starts and displays the cog assigned. (-1 if out of cogs) Cogs 1-2 are used for video, and cog0 starts out life as MCP and then after launching all the cognews, falls into the excellent Digital Storage Scope just posted.
This means you may lanch up to 5 demos, and be left with the digital scope on the TV screen to monitor all their I/O pins.
Hope this is of use to someone starting out like us. Top file is mcp2.spin and is liberally commented.
Many thanks to those whose demos I have included in the archive for the purposes of supplying the MCP example working.
Phil
This is my first posting. Myself and a few friends are having a great time with Propsticks and making our own demo/proto boards. For common interfaces we maintain compatability with the Parallax demo board so we can share demos etc.
One thing all beginners want to do is run up as many demo programs on different cogs at once to get some sense of what the chip can do. My answer is the MCP (Remember Tron?).
I tried to launch spin code by including objects from other files and demo's into mcp but could not launch them with cognew as it appears the code must reside in the object (file)·that is calling cognew. To work around this, I created a level of indirection where I include the OBJ definition for thexternal file in mcp, then create a PRI private definition which just calls the entry point of the external OBJ files. This allows me take lots of examples as posted here, and launch them all with MCP into differing cogs by essentially calling the demo OBJ in its spin file. I also define a sign-on message on composite video which lists each demo as it starts and displays the cog assigned. (-1 if out of cogs) Cogs 1-2 are used for video, and cog0 starts out life as MCP and then after launching all the cognews, falls into the excellent Digital Storage Scope just posted.
This means you may lanch up to 5 demos, and be left with the digital scope on the TV screen to monitor all their I/O pins.
Hope this is of use to someone starting out like us. Top file is mcp2.spin and is liberally commented.
Many thanks to those whose demos I have included in the archive for the purposes of supplying the MCP example working.
Phil
Comments
Well it had to happen. One of my friends pointed out that my initial upload was for PAL composite video. This would not have looked like much to those who are stateside and/or NTSC. Fine for here in Australia etc.
So since I was aiming at beginners or fast startup, I have uploaded two seperate versions here for out-of-the box use. One for NTSC and one for PAL. No new functionality added as yet. All that is different are the LSB of video mode bit in tv_text and tv.
Cheers,
Phil