Jump to content

MIOS C programming examples


TK.
 Share

Recommended Posts

  • 1 month later...
  • 3 weeks later...

Hi TK,

I notice that you are putting a great deal of effort into the C functions in MIOS...

Is the intention that one day you will phase out ASM based applications? Or is the C code only for ease of use in those occasions where optimised code is not so necessary?

The reason that I ask, is that very soon I will begin code work on my sequencer, and I am wondering whether maybe I should do it in C instead of ASM, in order to comply with your plans for the future, or if I should continue to write the code in ASM....

Either way I am happy... Writing in C will make a port to Atari ST easier, writing in ASM will mean smaller (and possibly faster?) code :)

Danke!

Link to comment
Share on other sites

Hi Todd,

Is the intention that one day you will phase out ASM based applications? Or is the C code only for ease of use in those occasions where optimised code is not so necessary?

both - I'm planning to port even more applications to C in order to simplify the customization. One thing what I want to realize sooner or later is a generic "MIDI controller template" for all kind of control elements (and LCD output formats), which can be easily adapted to the host application - it's the "MIDIbox NG" idea, just in a different form - no graphical GUI or sysex dump for configuration, but C code which can be modified and enhanced easily.

I'm happy that more people are now starting to program apps by themself, so this seems to be the right path.

My long term strategy is to have some apps ready in a (more or less) processor independent language, so that the migration to another microcontroller will be easier. But this is a plan for the next 3 years, in short time the PIC18F4620 will do the job for "next generation MIDIboxes" (MBSID V2, MBSEQ V3). And if Microchip should release another pin compatible uC in the next years, it will be the successor for the MBHP as well.

The reason that I ask, is that very soon I will begin code work on my sequencer, and I am wondering whether maybe I should do it in C instead of ASM, in order to comply with your plans for the future, or if I should continue to write the code in ASM....

I would propose to start the sequencer in C. On performance issues, you can replace parts of the core functions by assembly code. If you run into greater performance (or code size) problems, then you need to write the whole app in ASM, but this will be easier, since you've propably already tried out the "general concepts" in C (rapid prototyping is faster)

For MBSEQ/MBSID/MBFM I will stay on ASM

Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks for the info TK :)

I'll start from the C skeleton and go from there. I'm sure it will be difficult to build from scratch without using any of your existing code, but I'm also sure that I will enjoy the challenge ;)

I wonder if you could tell me if there are there any kinds of functions which do not perform so well in C, which should be done in ASM instead?

I was thinking that maybe mathematical functions like divides would be faster in ASM....

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...