Shop OBEX P1 Docs P2 Docs Learn Events
Programming in c and Spin language — Parallax Forums

Programming in c and Spin language

Hi,

I would like to know if it is possible to create a program in C and Spin language with the propeller C3?
Can I mix this two languages in one librairy or one program?

If anyone has a hint, I would appreciate

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2015-11-20 15:49
    There are some ways to create programs that are combinations of pieces in both Spin and C, but it's not simple. Usually people want to combine library objects that were written in Spin along with their program written in C. That's probably the most difficult because these objects tend to use features of the language that are the most difficult to translate. That said, there is a program to translate from Spin to C++ and people have used it to translate some library objects to C++. There's another unrelated program to translate from C to Spin. Actually mixing Spin and C in one library or one program ... not really. They use different run-time interpreters that make very different assumptions about how memory is organized. The compiled programs are in completely different formats, etc.
  • I've gathered a list of all the different ways to combine Spin, C, and C++ in this thread: http://forums.parallax.com/discussion/157563/combining-spin-and-c

    If you have any specific questions about any one method, just ask.
  • Thanks David. I missed SpinWrap. The C3 is not very different from other Propeller boards. It includes SRAM and Flash memories (among other things) that are selected using a counter to save I/O pins ... a technique different from other boards. C can use this memory for storing parts of your program and needs to know the board type to know how to access the memories.
Sign In or Register to comment.