Interested in getting started with the Propeller -- some questions about progra
phi_
Posts: 3
I'm interested in playing around with the Propeller, mainly because it's such an intriguing architecture and seems to be quite fast as well, but there are a couple of points I need to consider, so I'd like to ask a few questions here.
I'm quite unexperienced with MCUs, so please excuse me if some questions might be weird or even stupid. I've done some (C) coding on 8-bit Harvard-architecture RISCs, though.
First of all, I'm interested in programming the Propeller, not so much in immediate applications. Primarily, this means getting into Propeller programming has to be as cheap as possible, as it's mainly about getting to know the programming languages etc. first, not so much the nice applications you can use it for. The development kits seem to be quite nice, but I honestly just don't care about 80% of their features like TV output at the moment, so it'd be just a waste if I found out I didn't like the way the Propeller is programmed after all.
Having read some of the documentation, I figure I'll just need a P8X32A, a couple of transistors (cf. Serial to Propeller), an external quartz, a serial EEPROM and the 3.3 V power supply to get started. Am I correct or do I need more? I do have an RS232 port on my PC, so I guess I won't run into problems with USB->RS232 converters. Availability of the Propeller chip here is so-so, but the development platforms are hard to get, so building a minimal setup "from scratch" would actually be more convenient as well.
I'm mainly interested in the Propeller for two reasons. First, it's a Multicore design (interesting by principle), second, a von-Neumann architecture (which allows for self-modifying code). The manual states all assembly code is directly run from cog ram, which seems to be rather small for large projects. Is it feasible to dynamically load additional program code at runtime, or should the architecture's property to keep code and data in the same ram not be exploited? Are there operations to quickly copy sequential amounts from hub ram into cog ram, or does this need to be done one word at a time?
Can the external EEPROM be larger than 32 K or will the Propeller only accept 32 K EEPROMS? (Of course, since it doesn't have more than 32 K of ram, program data will be limited to 32 K, but the remaining space could be used for logging, etc.) If so, will the EEPROM's entire contents be cleared when uploading a new program to the Propeller?
I expect to make plenty of mistakes when programming (at least until I've mastered the platform), so I'll need a decent debugger that will ideally let me view register contents and single-step through the code. What software can be recommended for this?
Thanks for answering my questions!
I'm quite unexperienced with MCUs, so please excuse me if some questions might be weird or even stupid. I've done some (C) coding on 8-bit Harvard-architecture RISCs, though.
First of all, I'm interested in programming the Propeller, not so much in immediate applications. Primarily, this means getting into Propeller programming has to be as cheap as possible, as it's mainly about getting to know the programming languages etc. first, not so much the nice applications you can use it for. The development kits seem to be quite nice, but I honestly just don't care about 80% of their features like TV output at the moment, so it'd be just a waste if I found out I didn't like the way the Propeller is programmed after all.
Having read some of the documentation, I figure I'll just need a P8X32A, a couple of transistors (cf. Serial to Propeller), an external quartz, a serial EEPROM and the 3.3 V power supply to get started. Am I correct or do I need more? I do have an RS232 port on my PC, so I guess I won't run into problems with USB->RS232 converters. Availability of the Propeller chip here is so-so, but the development platforms are hard to get, so building a minimal setup "from scratch" would actually be more convenient as well.
I'm mainly interested in the Propeller for two reasons. First, it's a Multicore design (interesting by principle), second, a von-Neumann architecture (which allows for self-modifying code). The manual states all assembly code is directly run from cog ram, which seems to be rather small for large projects. Is it feasible to dynamically load additional program code at runtime, or should the architecture's property to keep code and data in the same ram not be exploited? Are there operations to quickly copy sequential amounts from hub ram into cog ram, or does this need to be done one word at a time?
Can the external EEPROM be larger than 32 K or will the Propeller only accept 32 K EEPROMS? (Of course, since it doesn't have more than 32 K of ram, program data will be limited to 32 K, but the remaining space could be used for logging, etc.) If so, will the EEPROM's entire contents be cleared when uploading a new program to the Propeller?
I expect to make plenty of mistakes when programming (at least until I've mastered the platform), so I'll need a decent debugger that will ideally let me view register contents and single-step through the code. What software can be recommended for this?
Thanks for answering my questions!
Comments
On the COG memory, yes, you can do lots of tricks. One is to load bits of code into the COG, then run them. Another is to write a kernel in your COG, that fetches instructions from the HUB, and executes them as native instructions, fetching, executing, fetching, etc... That is called LMM, and a lot of tools and code for doing this is out there, and I think you will find that quite interesting.
Finally, since the COGs all run independent of one another, you can mix up, PASM, SPIN, LMM and have the chip doing lots of things, using the different means of running programs. SPIN, as you probably know now, is an intrepeted language, where the program exists as a byte code in the HUB, executed by the COG. SPIN programs can interface with other PASM / LMM programs using the shared HUB memory for that purpose.
When a COG is started, it's memory space is filled from the HUB, and once running, can over write that memory space, freeing it for buffers and such.
On the matter of self-modify code, it's the norm on Propeller, for indexing, as well as other things. Not only is self-modify code possible, but there are instructions that make this task straight forward, for the most part.
One thing I find quite interesting is the COG memory isn't specialized at all. There are simply memory addresses, and the program. The only "registers" in the thing are the control registers for pin states, counters and such, the PC, and flags. Your program simply uses the COG memory as storage, or program, or both as you see fit. The end result of this is a very clean, compact and flexible assembly environment.
It was noted that you don't need the EEPROM, so long as you just want to load a program and run it.
You might download GEAR, for a nice Propeller simulation. It's slow, but can directly use output from the IDE. That can give you a taste of the thing, and it's able to simulate the executing of things. I found it helpful.
Edit( Did anyone see the block of text this was last night? I posted it here from a PS3, just goofing around. Looked fine on the screen, looked fine on view after post. Came in this morning to one BIG FAT PARAGRAPH, hit edit, saw the original formatting, hit "submit", and all is good. Weird.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
Post Edited (potatohead) : 4/2/2010 7:12:45 PM GMT
You can make those batteries last ages and ages by foregoing the quartz and using the internal rc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
humanoido
*Stamp SEED Supercomputer *Basic Stamp Supercomputer *TriCore Stamp Supercomputer
*Minuscule Stamp Supercomputer *Tiny Stamp Supercomputer *Penguin with 12 Brains
*BASIC Stamp Supercomputing Book *Three Dimensional Computer *StampOne News!
*Penguin Tech *Penguin Robot Society *Toddler Humanoid Robot Project
*Ultimate List Prop Languages *Prop-a-Lot *Propalot Stuff *Prop SC Computer
*Prop IB Hypercomputer - under development *Hobby Space Program
Here was my breadboard wiring;
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Forums RSS Feed!
Gadget Gangster - Share your Electronic Projects
I originally threw together a circuit as shown by Nick McClick soldered on perf board and used the transistor programming interface you mentioned. That instantly gives you confidence that the thing works and you can program it.
Next up add a crystal, some LEDs, the TV output resistors, SD card, whatever you want step by simple step.
Despite what you say, it is dead easy to add the TV out circuit and is a great way to impress your friends for almost no effort. It also makes a great debugging output device.
I managed to create a emulation of an entire CP/M computer on the Prop using such a simple set up.
Do work you way through all the Spin/PASM examples you can find in the manual and elsewhere. Then look into the wonderful world of LMM (large memory model) and overlays for COG code.
Have fun.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Could you please point me to some ressources for that?
Also, has anyone made some comparable measurements of the Propeller's performance yet (Dhrystone, CoreMark, etc.)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
8x8 color 80 Column NTSC Text Object
Safety Tip: Life is as good as YOU think it is!
The Propeller can do multichannel speech synthesis (with pitch controls for singing) with the channels distributed within a synthesized stereo space. It can emulate a Bell-202 or CCITT V.23 modem. It can also emulate a complete Z80 computer including hard disks and display and keyboard interfaces at speeds on the order of the original device.
You can use EEPROMs up to 128K bytes in size (24LC1024B). The bootloader only uses the first 32K. Anything beyond that is untouched by the bootloader. You can attach up to 512K total in EEPROMs to the same I/O pins (28/29) whether 4 x 128K or 8 x 64K. You can also attach other types of I2C devices (like a Real Time Clock or an I/O expander) to the same I/O pins as long as you provide the necessary I/O routines.
There's no "block transfer" between the cog and hub memory except for the initial loading of the cog memory from hub memory on a COGINIT or COGNEW instruction. You can write an optimal loop that would transfer 4 bytes (one long) every 16 system clock cycles in either direction, but the cog area has to be at the beginning of the cog's memory.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
I've never had such a problem, just a thought.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Getting the propeller boards here is a bit of a hassle, not so much just getting the chip. I'd probably buy it for the equivalent of $50 if it were easily available, but since a working bare-bones Propeller platform can be created on a breadboard with next to no components I won't bother and just build it myself.
I have a working RS232 port on my computer, so usb adapter compatibility--the main reason, besides not having to modify an adapter yourself, for getting a prop plug--isn't of much concern. Because I don't have any fancy video hardware to connect it to anyway, a very minimal system will suffice for evaluating the Propeller, getting used to programming and seeing if it suits my coding style.
Post Edited (phi_) : 4/6/2010 3:42:53 AM GMT