Shop OBEX P1 Docs P2 Docs Learn Events
C4! (i.e. Catalina on the Credit Card Computer) — Parallax Forums

C4! (i.e. Catalina on the Credit Card Computer)

RossHRossH Posts: 5,547
edited 2011-04-02 16:56 in Propeller 1
All,

The third update to Catalina 2.9 for the C3 is attached to this post. To install the update, just unzip it in the Catalina\target directory of your Catalina 2.9 installation (it will not work with earlier versions).

This latest update adds debugger support - both blackbox and blackcat now work with the C3, in all memory models (LMM, XMM SMALL, XMM LARGE). This update also includes the previous two updates:
  • The second update added SD Card support - so not only Catalina, but also Catalyst can now run on the C3.
  • The first updated added VGA support.
Of course, without Flash RAM support (still to come), you are still limited to programs that will fit into either the 32kb of Hub RAM (LMM mode), or the 32kb of Hub RAM plus the 64kb of SPI RAM (XMM mode) - so most of the large Catalyst application program will not yet run. But Catalyst itself works ok, and it can be used to load other Catalina programs (as well as SPIN programs). But before building Catalyst, please download the attached update.

You build and install Catalyst by going to the Catalina\Catalyst folder and typing:
build_all C3
payload -e core/Catalyst.binary
Then copy all the other programs in the Catalina\Catalyst\bin file to your SD card.

Here are a few examples of using the test_suite.c demo program on the C3:
cd demos
catalina -lci -test_suite.c -D C3
payload test_suite
It works! TV output and keyboard input! :smile:

If you look carefully at this command (and if you uploaded the previous update for the C3) you'll note that I have updated all the C3 targets so that the mouse is now excluded by default. This saves a lot of typing! To include the mosue, instead exclude the keyboard (via the NO_KEYBOARD) option. Or exclude both by specifying both the NO_KEYBOARD and NO_MOUSE options.

So, now what about VGA?
catalina -lci test_suite.c -D C3 -D HIRES_VGA
payload test_suite
It works! VGA output and keyboard input! :smile:

Lets try using a PC terminal emulator instead of the local display and keyboard:
catalina -lci -test_suite.c -D C3 -D PC
payload test_suite
It works! Input & output using the Parallax Serial Terminal! :smile:

Now lets try executing a Catalina program from SPI RAM. Don't forget that first we have to compile the XMM loader for the C3 (it's located in the utilities folder):
cd ..\utilities
build_all C3
cd ..\demos
Then we can compile and load the program itself - first with the XMM (SMALL) memory model:
catalina -lci test_Suite.c -D C3 -D NO_MOUSE -x2
payload ..\utilities\XMM test_suite
It works! Catalina executing code from SPI RAM with data in Hub RAM! :smile:

Then again with XMM (LARGE) memory model:
catalina -lci test_Suite.c -D C3 -D NO_MOUSE -x5
payload ..\utilities\XMM test_suite
It works! Catalina executing code from SPI RAM with data in XMM RAM! :smile:


Now, lets try out the latest features by trying a program that uses the SD Card. To try out the test_stdio_fs.c demo program:
catalina test_stdio_fs.c -lcix -D C3 -M64k -x2
payload ..\utilities\XMM test_stdio_fs
It works! Catalina using the SD Card and the C stdio file system! :smile:


To try out the debugger, use the example program in Catalina\demos\debug. Goto to this directory and type the follwing commands:
build_all C3
payload ..\..\utilities\XMM example
blackbox example -p[I][B]n[/B][/I]
It works! Catalina using a source level debugger from the PC to the C3! :smile:
Note that the n specified in the -p option of the blackbox command must specify the port number your C3 is connected to - this will be printed out by the payload command.


Here's an updated summary of what's currently working and what's not:
===================================================

Working drivers : Keyboard, Mouse, TV (HiRes & LoRes), VGA (HiRes & LoRes), Clock, Float_A, Float_B, SD Card
Working HMI plugins: ALL (VGA, TV, PC, PROPTERMINAL)
Working Kernels: ALL (LMM - NORMAL, ALTERNATE & THREADED, XMM - SMALL & LARGE)
Working libraries: ALL (libc, libci, libgraphics, libthreads, libm, libma, libmb, libcx, libcix)

Not Working Yet: SPI Flash, A/D converter.

I'll update this thread as I fix some of the issues, and get all the C3 devices working. Then I'll update the full Catalina 2.9 release.

Ross.

Comments

  • Ahle2Ahle2 Posts: 1,179
    edited 2011-01-24 02:34
    You need to set P15 high to enable the VGA output. ;)

    /Ahle2
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-24 03:19
    Woot!

    For my own purposes later I'm going to post the link back to the C3 manual http://forums.parallax.com/showthread.php?128711-Unleashing-the-C3-Book-Manual which among other things contains the schematic including the hardware enable circuit for VGA.

    Keep those posts coming Ross!
  • RossHRossH Posts: 5,547
    edited 2011-01-24 03:35
    Hi Ahle2, Dr_Acula,

    Thanks for the info. For some reason it doesn't seem to work. Probably something stupid. I'll try again tomorrow.

    Ross.
  • AndreLAndreL Posts: 1,004
    edited 2011-01-24 04:09
    Very cool. On the VGA thing, you just have to set that IO pin to output then set it LOW I believe to enable VGA. Then check where I put the port, I think its actually the same pins as the demo board in this case. Sorry, its 6:00am, been up 40-50 hours working, getting a little nutty :) But, this is exciting. Your stuff along with all David Betz languages and work is going to really be cool. He is about a week or so from a general release of BASIC for the C3, and a number of other language related products for it, he is writing a little user manual.

    Maybe we should name the like C3.C for "C", C3.S for spin, C3.B for basic, etc. for applications and what their runtime is :)

    Anyway, back to work on my NEXT propeller product -- muhhhahahahahaha :)

    Andre'
  • David BetzDavid Betz Posts: 14,519
    edited 2011-01-24 04:47
    AndreL wrote: »
    Your stuff along with all David Betz languages and work is going to really be cool. He is about a week or so from a general release of BASIC for the C3, and a number of other language related products for it, he is writing a little user manual.
    Ummm.... Well, I would say I'm quite close to releasing a version of ZOG that will work with the C3. One of the sample programs I'll include with ZOG is a very minimal Basic interpreter that compiles to bytecodes. Like FemtoBasic, it runs on the C3 and has an old-school line editor for entering programs. It isn't a practical version of Basic though. It's more a proof of concept that I can get my bytecode system running on the Propeller. There is a lot of work remaining to make it useful. It serves as a nice example of a non-trivial C program running under ZOG though. I should try compiling it with Ross's new version of Catalina for the C3. I'm sure it will be much faster than the ZOG version. I'll have to wait for Catalina to be able to run code from the SPI flash though. The executable for this Basic interpreter compiled for the ZPU (the instruction set used by ZOG) is a little over 64k and that doesn't include the uninitiliazed data.
  • Ahle2Ahle2 Posts: 1,179
    edited 2011-01-24 06:02
    I'm sorry Ross :(
    Active Low

    /Ahle2
  • RossHRossH Posts: 5,547
    edited 2011-01-24 14:43
    Aha!

    I thought Andre must be doing something really clever with the basepin processing inside the VGA driver to enable his VGA display, and couldn't figure out why I couldn't reproduce it even when I copied his C3 code exactly. It seemed like he was just initializing the VGA display and then using it.

    From his C3 test program ...
    ' initialize VGA terminal
      term_vga.start(%10111)   
     ...
      ' test out VGA hardware, display some characters, test buffer chip
      term_vga.Out( $00 )
      term_vga.newline  
      ...
    
    Simple, no? - No!. This morning it finally occurred to me to look a few lines further down in the same program - and there it is:
    ' ... then enable VGA (leave LOW)
      DIRA[STATUS_LED_BUS_MUX] := 1 ' set to output
      OUTA[STATUS_LED_BUS_MUX] := 0
    
    Simple - Yes!. I'll post updated Catalina VGA targets this evening.

    Ross.
  • RossHRossH Posts: 5,547
    edited 2011-01-25 02:55
    All,

    Attached to the top post of this thread is an interim update to Catalina 2.9 for the C3. To use this update, just unzip it into your Catalina\target directory. No need to rebuild Catalina - just recompile your C3 programs.

    This file contains new target files that fix a couple of the issues with Catalina 2.9 on the C3:
    • The VGA driver (and VGA HMI plugins) now work correctly (HiRes and LoRes)
    • The XMM (LARGE) memory model now works correctly.
    Next I'll tackle the SD Card. The SPI Flash RAM support will be last, as I'I need to find some extra space in the XMM Kernel to support that - but we'll get there!

    I'll keep the top post in this thread updated as I go.

    Ross.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-25 03:38
    Nice work. You are making amazing progress getting all the pieces working.
  • AndreLAndreL Posts: 1,004
    edited 2011-01-26 00:21
    Don't forget my A/D converter on there :)

    Andre'
  • RossHRossH Posts: 5,547
    edited 2011-01-26 02:53
    AndreL wrote: »
    Don't forget my A/D converter on there :)

    Andre'

    I tend to do drivers as I need to use them myself - so now I'll have to think of a good application!

    Ross.
  • DrNowDrNow Posts: 6
    edited 2011-01-26 03:05
    How about use an A/D converter to check the main input voltage?
  • RossHRossH Posts: 5,547
    edited 2011-01-26 03:08
    DrNow wrote: »
    How about use an A/D converter to check the main input voltage?

    You mean I just plug mains voltage into the A/D converter? Like this? .... PZZZT$#@%$#!%!!!
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-01-26 05:05
    Yes good point Andre' support for the peripherals will be most useful. Indeed, if support is available with Catalina it could help make Catalina more popular as a programming language.

    BTW, as a complete aside, lake Boga is full with the floods http://www.adelaidenow.com.au/news/breaking-news/swan-hill-prepares-for-flood-emergency/story-e6frea73-1225995079819 and I hope the Catalina museum is ok as it is right on the shore of the lake http://www.murrayriver.com.au/lake-boga-flying-boat-museum-980/
  • AndreLAndreL Posts: 1,004
    edited 2011-01-26 07:38
    The thing to remember is that these small systems have no OS (not counting things like CP/M and these other OS projects), and no API services that most programmers are used to having access to in the libraries or languages they use. So, to get the masses to use things, you really have to build things in to talk to all the peripherals really easily. For example, on the C3, you could have a SPI function that you can use to access anything you want in any particular language, but its nice if a low level set of peripheral access commands, functions are built it or part of an external API (in C's case). Like, all these BASIC like languages definitely need all the peripherals built into the language like flash, sd, A/D, sound, game controllers, tile graphics (pick a graphics engine), mouse, keyboard, etc.

    I just always think back to what started the entire computer revolution and it was BASIC running on the Apple, Atari, C64, and TRS-80. Everything was built in and we could write anything. Then as we got smarter, we could use ASM and write our own drivers and functions. But, a 10 year old could literally write a game on an Atari 800 in BASIC -- make that happen and people will really get into something.

    Andre'
  • Martin HodgeMartin Hodge Posts: 1,246
    edited 2011-01-26 08:02
    AndreL wrote: »
    Don't forget my A/D converter on there :)

    Andre'

    Such a driver would also work very well on the ASC!
  • RossHRossH Posts: 5,547
    edited 2011-01-26 13:51
    Dr_Acula wrote: »
    BTW, as a complete aside, lake Boga is full with the floods http://www.adelaidenow.com.au/news/breaking-news/swan-hill-prepares-for-flood-emergency/story-e6frea73-1225995079819 and I hope the Catalina museum is ok as it is right on the shore of the lake http://www.murrayriver.com.au/lake-boga-flying-boat-museum-980/

    A Catalina is a flying boat! It may be the safest place to be :lol:
  • RossHRossH Posts: 5,547
    edited 2011-01-30 05:36
    All,

    The second update to Catalina 2.9 to add support for the C3 is attached to the first post of this thread. This update adds SD Card support - so not only Catalina, but also Catalyst can now run on the C3. It also removes the need to always specify the NO_MOUSE option when compiling programs for the C3.

    More details, including examples, are given in the first post of this thread (and an example of using the SD card is given near the end of that post).

    Ross.
  • AndreLAndreL Posts: 1,004
    edited 2011-01-30 12:44
    Very cool --

    Andre'
  • RossHRossH Posts: 5,547
    edited 2011-02-01 04:20
    All,

    The third update to Catalina 2.9 for the C3 is attached to the first post of this thread. This update adds blackbox and blackcat debugger support.

    More details, including examples, are given in the first post of this thread (and an example of using the debugger is given near the end of that post).

    Ross
  • RossHRossH Posts: 5,547
    edited 2011-04-02 16:56
    All,

    Just to tidy up this thread - Catalina 3.0 has now been released (see this thread) with full support for both the 64kb SPI RAM and the 1Mb SPI Flash available on the C3.

    You can now execute code out of the SPI Flash, using the SPI RAM for data and the Hub RAM as stack space. You can automatically execute programs loaded into Flash at boot time.

    You use the SPI Flash just like any other XMM RAM, with seamless integration into the Catalyst SD Card loader and the Payload serial loader.

    There is also a caching XMM driver to speed up execution when using slow serial memory as XMM RAM.

    Ross.
Sign In or Register to comment.