Shop Learn
Catalina - Page 5 — Parallax Forums

Catalina

1235»

Comments

  • RossHRossH Posts: 4,776
    edited 2021-10-21 22:51

    Main things were getting the clock high enough (add "-C MHZ_260" to build settings).
    and, get coginit right in the .c driver file: //Note: Need to change coginit to _cogstart_PASM at end of this file

    Very nice. I'm sure @ersmith will fix the _cogstart_PASM issue.

    In the meantime, you don't need to edit any files, just add the missing definition to your catalina command.

    For instance, here are the commands I used to convert the Spin to C and then compile it ...

    spin2cpp.exe --p2 --ccode VGA_Simple1a.spin2
    catalina -p2  -lci -C P2_EVAL -C MHZ_260 test_spin2cpp.c -D "coginit=_cogstart_PASM"
    

    Ross.

  • ersmithersmith Posts: 5,114

    @RossH : Thanks for your suggestions! I've added a #define __SPIN2CPP__ to the generated code, and put in a few more Catalina defines in the P1 case (as you say, it's too late to do much about propeller.h, but at least propeller2.h is mostly standard and we can make that work with all the compilers).

  • RossHRossH Posts: 4,776

    @ersmith said:
    @RossH : Thanks for your suggestions! I've added a #define __SPIN2CPP__ to the generated code, and put in a few more Catalina defines in the P1 case (as you say, it's too late to do much about propeller.h, but at least propeller2.h is mostly standard and we can make that work with all the compilers).

    Thanks. I've added _waitsec(), _waitms() and _waitus() as proper functions to Catalina's P1 and P2 libraries, including your suggestion about looping to allow arbitrarily long wait times. I'll issue a new release soon.

    Ross.

  • RossHRossH Posts: 4,776
    edited 2021-10-23 03:56

    ** post deleted ** - I've just realized this is not necessary!

  • RossHRossH Posts: 4,776

    Catalina 4.9.2 has been released. See the first post in this thread.

    @ersmith - this release adds spin2cpp.h, which should make it easier to add any new #defines you need to make spin2cpp work with Catalina.

  • RaymanRayman Posts: 12,322

    Ross, I'm not seeing the default P2 clock frequency being defined in the docs.
    But, I think it is 160 MHz, right?

  • RossHRossH Posts: 4,776

    @Rayman said:
    Ross, I'm not seeing the default P2 clock frequency being defined in the docs.
    But, I think it is 160 MHz, right?

    On the P2 the default is 180MHz - this is defined by the platform-specific constants specified in catalina_platforms.inc.

    I could arrange for these to be configurable on the command line, but there are so many fields to specify for the P2 clock and if they are not specified correctly then the program won't even start, so currently I have only added the two special cases that are needed by the VGA driver - i.e. MHZ_200 and MHZ_260.

    I will have a think about whether I should allow for the individual clock fields to be specified on the command line, but we would still have to have sensible defaults defined anyway. I took the view that it was better for the platform makers to specify what values are appropriate for their platforms. This was certainly the case on the P1, where different platforms used different crystals to overclock the P1 chip.

    In any case, I will update the documentation to make this clearer in the next release. Thanks.

    Ross.

  • RaymanRayman Posts: 12,322

    I think Chip came up with a scheme to auto-select the best clock settings based on the frequency.
    Think that's how Spin2 and FlexC work...

  • RossHRossH Posts: 4,776

    @Rayman said:
    I think Chip came up with a scheme to auto-select the best clock settings based on the frequency.
    Think that's how Spin2 and FlexC work...

    I'll look into it. But if they can't get the exact frequency requested, what values do they use? I guess I would have to do the same for consistency.

  • evanhevanh Posts: 12,045
    edited 2021-10-26 04:10

    @RossH said:
    I'll look into it. But if they can't get the exact frequency requested, what values do they use? I guess I would have to do the same for consistency.

    It has an allowable error - https://forums.parallax.com/discussion/comment/1486815/#Comment_1486815

  • evanhevanh Posts: 12,045
    edited 2021-10-26 08:10

    Doh! Turns out I had put a last minute bug in my outer testing routine. It wouldn't even compile. Fixed now.

  • RossHRossH Posts: 4,776

    Thanks, @evanh. I'll put something compatible into the next release.

    Every time I think I've gotten to the end of my "to do" list, people keep adding stuff! :)

    Ross.

  • RossHRossH Posts: 4,776
    edited 2021-11-10 01:23

    All

    I've just uploaded Catalina 4.9.3 to SourceForge. See the first post in this thread for details. Among other things, it adds the ability to specify the clock frequency on the command line (Propeller 2 only).

    Ross.

  • RossHRossH Posts: 4,776

    All

    I've just uploaded Catalina 4.9.4 to SourceForge. See the first post in this thread for details. The main thing this release adds is a new serial HMI option that saves a cog (Propeller 2 only). It also allows the serial baud rate to be specified on the command line (again, Propeller 2 only) and fixes a couple of very minor issues.

    Ross.

Sign In or Register to comment.