Catalina C compared to GCC for Prop Info request
richaj45
Posts: 179
Hello:
I am wondering if someone has used both Catalina C and Parallax GCC for the Prop-I and can compare the pluses and cons between them?
I just don't know which one to dig into.
Thanks you
rich
I am wondering if someone has used both Catalina C and Parallax GCC for the Prop-I and can compare the pluses and cons between them?
I just don't know which one to dig into.
Thanks you
rich
Comments
Hi rich,
That's a pretty broad question. It depends partly on what Propeller platform you have and what you intend to do with it. For instance, Catalina has better support for most of the external memory "add-on" boards available for the P1, but if you don't intend to use XMM then that doesn't matter.
A little more information would be useful.
Ross.
I haven't used Catalina at all in the last 3 years, and I would bet that Ross has never used SimpleIDE or Propeller GCC.
So, your only responses so far most likely will not be able to provide any kind of objective answer to your question ;-)
I'll offer this though:
The Parallax Education Propeller C program uses SimpleIDE, Propeller GCC, and the Parallax Simple Libraries (authored almost entirely by Parallax). Education has many tutorials, and more are coming. Parallax is serious about providing solutions supported by Propeller C to the educational community from high school advanced placement college prep programs through university level courses. There is lots of competition in that market, and the decisions made by Parallax are the result of their well worn experience. I've heard many good things from the education crew, and I've begged them share the stories with everyone ... maybe some day they will. Parallax thinks it can win with their solution (it is what they specify), and we should wish them well by supporting their efforts with testing and offering useful suggestions.
True. Which tells you (I guess) that you can do pretty much anything you might need with either one!
Another area where Catalina is particularly useful is in its "out of the box" support for most Propeller platforms (or you can add your own), and it's fully integrated versions of many of the basic OBEX objects you typically need to get started.
Here is a partial list:
- Keyboard & Mouse
- TV (hi-res, lo-res)
- VGA (hi-res, lo-res)
- SD Card & FAT file system
- SPI and I2C devices (e.g. EEPROMs)
- Floating point (i.e. using the Parallax floating point OBEX objects, not software emulations)
- Graphics (TV and VGA)
- Sound
- Serial Comms (single port or four port, small buffer or large buffer versions)
- Proxy drivers (keyboard, mouse, screen and SD Card, for multi-CPU platforms)
- Real-Time Clock
- External Memory (C3, Hydra, Hybrid, TriBlade, Morpheus, Propeller Platform, RamBlade, Propeller Memory Card, RamPage, RamPage2, SuperQuad, HX512)
- Gamepad
Ross.If you are only interested in C, then both are fine options. There are some minor differences here and there, but in general they are both great options and well supported.
Utility
simpletools.h - Tools that simplify I/O, timing, memory, and communication
mstimer.h - Tracks milliseconds elapsed in another cog.
Text Devices
simpletext.h - Tools for communicating with devices that transmit and/or receive characters and text strings. Includes half duplex serial drivers for Simple Terminal and other serial devices. Supports all device libraries in the Text Devices folder with stdio-like functions that feature smaller program size footprints.
serial.h - Functions for connecting to half duplex serial devices, for use with libsimpletext.
fdserial.h - Functions for connecting to full duplex serial devices, for use with libsimpletext.
Audio
wavplayer.h - Plays 16-bit, 32 ksps, mono .wav files (Propeller Activity Board/Propeller BOE).
Convert
adcDCpropab.h - Propeller Activity Board A/D conversion for voltage measurements
adcACpropab.h - Propeller Activity Board A/D conversion for signal measurements
dacctr.h - Propeller Activity Board D/A for setting voltages
abvolts.h - Test library for setting and measuring voltages with the Propeller Activity Board's D/A and A/D sockets
Display
vgatext.h - Display text with a VGA Monitor.
An LCD example lives in .../Documents/SimpleIDE/Learn/Examples/Devices/Display, library coming soon.
Motor
servo.h - Servo control library
servodiffdrive.h - Convenience functions for robot control with differential drive servos
For DC motor control, see ...Documents/SimpleIDE/Learn/Examples/Devices/Motor/DC.
Protocol
simplei2c.h - Contians I2C building blocks that the simpletools library's i2c_out and i2c_in functions use. Great for making custom I2C functions and libraries.
Robotics
abdrive.h - Tools for ActivityBot navigation with encoders + servos.
abcalibrate.h - Self-calibration functions for the ActivityBot.
Sensor
compass3d.h - For measurements with the 3-axis HMC5883L compass.
mx2125.h - For measurements with the 2-axis mx2125 accelerometer.
ping.h - For measurements with the Ping))) Ultrasonic Distance Sensor.
Additional library information is here.
Get the Latest Learn Folder
More examples and libraries get added to the Learn folder all the time. So make sure to download the latest before getting started. Just go to:
http://learn.parallax.com/propeller-c-set-simpleide/update-your-learn-folder.
From there, just follow the instructions with red checkmarks. Then, you'll be equipped with latest example programs and libraries for use with the tutorials on:
http://learn.parallax.com/propeller-c-tutorials.
For more info on the Propeller C Education program, go here:
http://learn.parallax.com/propeller-c.
For info on this Learn folder's Simple Libraries, go here: Simple Libraries Folder Index
Typos, comments, or suggestions? Email: learn@parallax.com.
Update History
Updates 4/11/2014
- The simpletools library no longer starts a floating point coprocessor at the start of the application. All floating point functionality is still supported, processing just happens in the same cog.
- i2c_out and i2c_in char *regAddr parameter changed to int memAddr.
- itoa removed, use sprint(charArray, "%d", intVal) to make int to ASCII conversions.
- st_msTicks and st_usTicks global variables are pre-initialized to the number of system clock ticks in a millisecond and microsecond for convenience in library development.
- Variables named us and ms are initialized to the same values for user applications.
- Function endianSwap added to simplify communication with devices that send/receive byte data in big endian format.
- Digits versions of put/get and write/read added to simpletext library for transmitting and receiving values with fixed numbers of digits. .
- Floating point output functions in simpletext library updated to handle nan (not a number) and +/- inf (infinity).
- printi, dprinti, scani, dscani, sprinti, sscani functions added to simpletext library for supporting non-floating point with less program space.
- Multicore folder added to ...Documents\SimpleIDE\Learn\Examples\.
- New Protocols and Multicore folders in ...Documents\SimpleIDE\Examples\.
- New TV Remote and 3-Axis Accelerometer libraries and examples in ...Documents\SimpleIDE\Examples\Simple Devices\.
Updates 2/27/2014- abvolts library added. This library is for introductory tutorials and has been added to the Learn folder for community testing and feedback.
Updates 2/13/2014- cog_run and cog_end functions added to libsimpletools to streamline launching function code into another cog.
- vgatext library modified to work with the simpletext library. You can now use any simpletext output call with a text_t parameter to dsipaly text messages with the VGA. See the VGA Text Display activity for examples.
- \Robotics\ActivityBot folder added to ...Learn\Simple Libraries.
- ActivityBot folder added to ...Learn\Examples.
Updates 11/6/2013- start_fpu_cog and stop_fpu_cog documentation added to libsimpletools.
Updates 11/1/2013- More corrections to ee_put* for contiguous data crossing address/128 boundary.
Updates 10/31/2013- simpletools square_wave bug that prevented frequency changes fixed.
Updates 9/4/2013- Updated stack array to static in mstimer.c.
Updates 7/9/2013- i2c_in and i2c_out functions added to simpletools library.
- simplei2c library added with basic i2c building blocks that were used to create the simpletools library's i2c_in and i2c_out functions.
- EEPROM and compass libraries now use i2c_in and i2c_out instead of two different Propeller GCC I2C variants, which reduces program memory requirements.
Updates 6/15/2013- Folder added.../SimpleIDE/Learn/Simple Libraries/Text Devices. In addition to libraries that support communication with text based hardware devices, this folder has libsimpletext, which has compact functions for sending and receiving text to/from Simple Terminal and other devices.
- All sser_ and fdser_ functions removed from libsimpletools.
- libsimpletools now includes simpletext from Text Devices. In addition to replacing sser_ functions, it has a variety of print/scan put/get and read/write functions for communicating with Simple Terminal and other serial devices. fdser_ functions are replaced by using the Add Simple Library button to add libfdserial from the Text Devices folder.
- 7-segment LED examples added to ...SimpleIDE/Learn/Examples/Circuits.
- A 0.8 second delay was added to the first serial message sent to Simple Terminal by functions in the simpletext library. This prevents Windows machines from potentially mistaking the serial message as legacy serial peripheral identifying strings. Since the delay is now automatic, all pause(1000) calls were removed from the start of example programs.
- All example programs updated to use print from simpletext in place of printf from stdio. This significantly reduces the program size penalty for displaying floating point types.
First Release 5/7/2013As Roy said: PropellerGCC is great for C++. If you're interested in C++ then take a look at libpropeller. It's a PropellerGCC C++ library designed for efficiency.
I have a Hydra board with the original external SRAM card. Is that something that Catalina supports?
If so, you have one very happy camper here. The Hydra hasn't seen much use, but I may need something with extra RAM in the near future.
Of course! The Hydra was always my platform of choice for development, because it supports everything!
As shipped, you can only use the first 64Kb of the HX512 SRAM board as XMM RAM, due to limitations in the firmware loaded into that board. But there is updated firmware (included with Catalina) that can be used to access the whole 512K RAM via a fast parallel interface.
The only difficult bit is that a special cable is required to reprogram the firmware in the HX512. I built mine based on the instructions included with the HX512, but with some errata (see here). Or I believe you can buy one for about $50. Or you can see if someone has one you can borrow (you only need the cable once!).
Ross.
Well.... an immediate boost of 64Kb is 3x if you include hubram. Building a cable to get the whole 512Kb is appealing. I actally editted the draft of the 512Kb docs for Andre.., so I have a bit of an idea how that goes.
Runs on Windows OR Linux..... I am happy.
I actually don't program in C - it was done by my partner.
I have not looked at, nor used GCC. It was not available when we commenced our coding.
FWIW our C source file is ~6,000 lines. We have 512KB SRAM and SD card with lots of database files.
My own learning level feels more comfortable with C versus C++, but I have also been pushed into reading other people's C++ code to learn how to create an ambitious project of my own.
There is a nagging feeling in the back of my mind that 32Kb of hubram isn't going to be enough and that CMM is going to run a bit slow. So, I may need more memory and I just happen to have the Hydra. I had not been aware of the RAMBlade ... $40-50 USD assembled and complete is quite reasonable for the huge boost. I was aware of the TriBlade, but unsure that I'd complete a build as some parts were hard to get in Taiwan.
It never ceases to amaze me that the Propeller can morph into a very different kind of tool; one minute it is a video game platform, another and it becomes a ram memory manager unit with high through put, and in another it becomes a multiple channel logic analyzer.
Add in the diversity of programming language options and you learn substantially more by contrasting them in actual use. Not exactly with the mainstream commercial big boys want to allow you to do. You just learn too much to be blindly loyal because your stuff in their corporate knowledge base.
$40-50 for a RAMBlade3 seems a better investment than $50 for a programing cable for the Hydra's 512Kb SRam card.
I am tending to lean toward Catalina since it sounds like it has a good library, i know you to contact to add support for my own external ram design, and i don't want C++.
I just need to bring it up on my MAC.
Very good discussion and it is this type of interchange that make the Prop a good choice of a microcontroller.
cheers
rich
There was another option that I tried some time ago, to make it work with standard firmware.
It's proven and I did some benchmarks back then, but only as a modification of Andre's Spin+PASM code, not for catalina.
Also, while it's probably useless for direct byte access, it should perform reasonably well with cache if you read/write 256B pages (or multiple of that).
Lower 64KB are accessed as usual, past the 64KB limit It goes like this:
as you can see, its something like O(2*(n-256)+2) operations to seek for page n, with n in [256..2047].
Contrast that with the original PASM routine from Andre, which used to walk single bytes when past 64KB limit.
I guess you meant "insight".
Only guessing mind you
Now i wonder which on it should have been. <grin>
rich
Eye bee shore yew ah write their.
On the MAC, you have to compile Catalina from source. It just takes a few minutes and one command, but you have to have the correct tools installed first - see the documentation for more details, and let me know if you run into any problems.
Ross.
SimpleIDE has a compiled Apple install and supports both C and C++ in GCC.
So if you feel that compiling from source is beyond you, that might eliminate an install obstacle. But sooner or later, you will likely figure out that compiles from source are not that hard, regardless of OS -- Windows, Linux, or Apple.
So i downloaded the tar file to my MAC.
After extraction i see a "build_all" bash script in the "source" directory.
Can i assume i just execute that script from a command line?
An then were will the software be installed and how would i do a clean sweep uninstall?
Those would be the two question i always think about when i load software.
cheers,
rich
The instructions for building Catalina under OSX are in the Catalina Reference Manual (pp 110). Here is a quick summary:
Make sure you have the following installed (I recommend using macports to do this, since I know this works - but there are other ways if you know OSX well)
- gcc-g++ (version 4.4 or later)
- bison
- flex
- libtool
- unzip
Note that you DON'T need the boost stuff, unless you want to use the srecord utilities (and if you don't know what these are, you don't need them!).Then go to the directory you unpacked the Catalina distribution into (note that I recommend using pax to unpack the distribution on OSX instead of tar, but if you used tar as root you should be ok. If you run into file permission problems, start again but this time unpack Catalina using pax).
Then from a bash shell:
This will build Catalina "in situ". It can then be run from here as well. Just set the LCCDIR environment variable to that directory (e.g. in your bash profile), and then you can use Catalina from anywhere, just by first executing the command:
Personally, I think it's great to have two good options, especially when they are both free!
Not really. Both Catalina and PropGCC seem to have found their own target audiences, and they don't seem to overlap much.
Ross.
I found gcc 4.8 on macports.
Any advantage to getting the newest rev of gcc?
BTW i did not find "gcc+g++" as an actual search item. Is it correct to assume the gcc48 macports contains all i need?
thanks for helping
rich
Hi Rich,
You want at least gcc44 (4.4.7). Later ones may work, but I'd recommend against gcc48 because last time I looked at it it had problems.
Ross.
So i used mac port to download gcc47 and it error-ed out.
It is trying to find py26 and py27 in the macport path and it is not there.
I did a port upgrade all and lots of activity later it is still errors out.
So i have something broken in mac ports but i hesitate to reinstall as there are two port packages that are used other places.
These computers are not easy to use, by any stretch of the imagination.
If you have any suggestion, i would appreciate it.
Maybe i just need to get a good Windows 7 box. (Do they exist)
cheers,
rich
+1
Good catch!
Now you are agreeing with @RossH also? People already talk about him and @Heater..
is it the Easter thing?
anyways - I like it...
Enjoy!
Mike