"Out-of-the-box" gcc memory model / hardware?
__red__
Posts: 470
I'm building a simple "hackerspace-branded" board to introduce hacking with the propeller. Given that a number of my students will be familar with C and arduino I wanted to give them the opportunity to use gcc.
As I understand it, to get to reasonable-sized applications you need external memory. My question is a simple:
What the is 'default' / 'out-of-the-box' / 'simplest' configuration for larger memory model hardware?
Thanks,
Red
As I understand it, to get to reasonable-sized applications you need external memory. My question is a simple:
What the is 'default' / 'out-of-the-box' / 'simplest' configuration for larger memory model hardware?
Thanks,
Red
Comments
I'm not sure I agree that you need external memory. The default configuration for PropGCC is to use hub memory for code and data (LMM mode). Another hub-only mode is CMM (compressed memory model) which lets you fit about twice as much code in, which is enough for many interesting projects.
For bigger (external) memory there are a variety of options. A lot of our development is done on C3 boards, so having SPI flash and/or RAM like the C3 would probably be a good choice.
Eric
I agree with all of this except that I'd suggest you not emulate the C3's chip select mechanism, just use a simple CS pin for the flash and/or SRAM chip.
Edit: Even though I don't recommend the counter-based CS scheme that the C3 uses, you can certainly and probably should share the rest of the SPI pins between the flash and SRAM chip if you choose to support both
There is a cache driver that is provided with PropGCC that allows a SPI flash chip to be used as external memory by just configuring the pins used for CS, MISO, MOSI, and CLK. You don't need to write any code.
Red, it's a timely effort! I'm under a bit of a gag order on the forums, but I think we should immediately connect off-line via e-mail so I can lend you even more support and make your project go quicker. We have a special opportunity for you at the moment, and I'm not selling you anything. . .
And to the memory model question, I'm using a PropBOE with XMMC External Flash Code Main RAM Data.
Drop me an e-mail, below.
Thanks,
Ken Gracey
Four reasons.
1) Limiting factor with so many of my propeller projects in the past has been the number of pins, but experiments are going very well with multiple propeller chips and abstracting the idea of a propeller with as many pins and cogs as one wants.
2) I just ran a really large complex Spin program (Kyedos) through Spin2cc and there were no errors. I think that means that every bit of code in the obex may now be available for C programmers.
3) Microchip have recently released larger SPI ram chips.
4) Ken Gracey is up to something and I want to find out what!!
So - my hardware is very simple - 4 pins for TV, 2 for keyboard, 4 for SD card and 4 for a SPI ram chip.
For the very simplest experiment, one could leave out the SD card, keyboard and TV and debug through the download port.
I want to put the program in the SPI ram chip. I'll start with a 32k chip and the chip is in a socket so it will be easier to drop in chips with larger memory as needed.
I just uninstalled PropGCC and SimpleIDE as the versions I had were from late last year.
Download the simpleIDE package https://sites.google.com/site/propellergcc/downloads/windows-download 77mb
Run the setup program. I've accepted all the defaults except I checked the box that added a desktop icon. It is installing at the moment. The default workspace folder is "C:/Documents and Settings/Administrator/My Documents/SimpleIDE" and just to remind me where things are, I'm going to copy that folder onto the desktop and put the icon next to simpleIDE,
Ok, we have a demo hello world on the screen. Bottom left corner are a whole lot of boards that one can use (even one of mine, the Dracblade). Hit the light blue triangle at the top of the screen and it will compile and run. Change boards and change to LMM and change to c++ and all runs fine. I'm going to be putting the C program in external ram, so when this is working, the memory model will be XMMC and it will be caching the program from the ram. But first, need to connect add the ram which is an 8 pin 23K256 chip.
Addit: At this point I am going to cheat, as I happen to know that the config files for the boards are contained in the directory c:\propgcc\propeller-load. I've told windows that .cfg files should be opened with notepad so it is quick to scan through these files.
David Betz in post #3 said
But I think I need a driver for a SPI ram chip (23K256), not an SPI flash chip.
I'm a bit stuck at this point. Any help would be most appreciated.
The purpose is to built something simple. A single 23k256 sram spi 8pin chip. Connect to any 4 propeller pins and in any order. Just need to decode the .cfg file and I am really hoping we will be able to test this on some hardware and get it working.
The purpose is to built something simple. A single 23k256 sram spi 8pin chip. Connect to any 4 propeller pins and in any order. Just need to decode the .cfg file and I am really hoping we will be able to test this on some hardware and get it working.
Ok, add a single 23K256 spi sram chip. There are 8 pins on that chip. Pin 7 and 8 are 3v3. Pin 4 is Gnd. Pin 3 is not connected. You can connect the other 4 pins to any propeller pins you like. I chose to connect pin 1 (CS) to propeller pin 4, pin 5 (MOSI) to propeller pin 5, pin 6 (CLK) to propeller pin 6, and pin 2 (MISO) to propeller pin 7.
Go to directory c:\propgcc\propeller-load. Open the file quickplayer.cfg. I changed it to this
where cache param1 is mosi, miso, clk and then the last byte is 01 which is the protocol byte.
cache param2 is the cs pin and the other values are zero.
Note these pin numbers are in hex, so pin 16 would be 10.
The open SimpleIDE, and at the bottom left corner, board type is quickplayer, compiler type is C++, Memory model is XMMC and optimisation is for size.
The hit the blue 'compile' triangle and it should download and run. You can confirm it really is running from ram by powering down, removing the ram chip and then trying to download.
This really is super simple. One 8 pin chip and larger C programs can be run. And there are larger ram chips available in the same package, so just put the ram chip in a socket and it is easy to fix if running out of code space.
Good idea. I copied quickplayer.cfg into a new file (could be any name, I chose sram_spi.cfg) and pasted it in the same directory. It comes up in the list of board types, but not in alphabetical order (it is at the start). However it is there so this is by far the neatest solution.
I hope this helps our original poster.