FemtoBasic and Sphinx
Mike Green
Posts: 23,101
I've been working with the Sphinx I/O drivers, so I thought I'd modify FemtoBasic to use them.
Advantages:
This version includes all the necessary drivers from Sphinx, so it can be run standalone. If so, you'll have to modify the TV, keyboard, and SD card I/O pins as well as the clock settings in BasicSph.spin. If you run it under Sphinx, it uses the settings in Sphinx.
There's a variation of the LOAD statement that doesn't clear the existing program first. This allows you to load libraries. Use a plus after the file name like this: LOAD "<file>"+
The FILES and DELETE statements take 'wild-cards'. DELETE asks for permission before deleting anything.
Disadvantages:
There are a lot of small changes to I/O statements that haven't been adequately tested yet. I'll post updates here. I'll also post a stand-alone C3 version. Note that this one will run under the C3 Sphinx that's already posted to the C3 software server, but the SPI SRAM and SPI Flash won't work. The SD card I/O will work. When I post the C3 version, that will include the C3 driver for the SRAM and Flash.
Updated 2011-03-16 23:48 - Fixed REM bug - ***** See Message #4 *****
Updated 2011-03-17 10:17 - Uploaded correct archive
Updated 2011-03-17 12:24 - Added support for SPI SRAM and SPI Flash
Updated 2011-03-17 13:53 - C3 version posted
Updated 2011-03-18 11:30 - C3 and non-C3 versions combined using BST conditional compilation
Advantages:
This version includes all the necessary drivers from Sphinx, so it can be run standalone. If so, you'll have to modify the TV, keyboard, and SD card I/O pins as well as the clock settings in BasicSph.spin. If you run it under Sphinx, it uses the settings in Sphinx.
There's a variation of the LOAD statement that doesn't clear the existing program first. This allows you to load libraries. Use a plus after the file name like this: LOAD "<file>"+
The FILES and DELETE statements take 'wild-cards'. DELETE asks for permission before deleting anything.
Disadvantages:
There are a lot of small changes to I/O statements that haven't been adequately tested yet. I'll post updates here. I'll also post a stand-alone C3 version. Note that this one will run under the C3 Sphinx that's already posted to the C3 software server, but the SPI SRAM and SPI Flash won't work. The SD card I/O will work. When I post the C3 version, that will include the C3 driver for the SRAM and Flash.
Updated 2011-03-16 23:48 - Fixed REM bug - ***** See Message #4 *****
Updated 2011-03-17 10:17 - Uploaded correct archive
Updated 2011-03-17 12:24 - Added support for SPI SRAM and SPI Flash
Updated 2011-03-17 13:53 - C3 version posted
Updated 2011-03-18 11:30 - C3 and non-C3 versions combined using BST conditional compilation
zip
110K
Comments
I must have attached the wrong upload. The Attachment Manager can be confusing. Around line 1200 in BasicSph.spin, there's an older version of the following. Substitute this and it should work.
Note that the DUMP statement can dump SRAM (from $10000 to $1FFFF) and flash (from $20000 and up).
You have to update the I/O pin numbers used for the SPI devices in the constants near the beginning of BasicSph.spin and in the call to win.start in the main method. A -1 for the pin number of either SPI SRAM CS or the SPI Flash CS disables that device.
With the C3, do we suffer from the same limitation of memory in getting a 40 column or 80 column video driver working with this or could this possibly be done with the extra memory which is onboard? (fingers crossed)
OBC
The Sphinx compiler / assembler could be rewritten to use the SPI SRAM for some of its tables and that could free up enough memory for a 64 or 80 column display with the display buffer in hub RAM, but that's a lot of work.
SPI SRAM is really a trade-off of fewer pins for speed, so I guess you and I will have to wait for the next generation to accomplish this. Where additional pins can be easily given up to external ram.
OBC
Yes, that fixed the problem. Thank you!