[sdiy] Beginner questions

patchell patchell at silcom.com
Fri Feb 28 16:10:23 CET 2003



Oliver Keller wrote:

> Hi Jim,
>
> so you code in C and C++ most of the time ? Is this possible for
> programming time-critical programs - like a sequencer - too ? Didn´t do
> anything in Assembler yet, just had a glance at it during my studies. C
> would be ok, since I wrote some code already plus it´s a language with a
> structure I know.

    Yes, speed is generally no problem.  In fact, of all of the assembly code I
have written, I can think of only one case where I used assembly because I
needed speed, and that was on a DSP for a PID filter, which had to execute in
about 20 uSec.  Generally, I use assembly code only if it is not posible to do
something in C, such as doing a context swap, etc...

>
>
> Do you see any difference in performance when comparing C to C++ ? Is
> OOP eating up too much performance ?

    If you use virtual member functions, these do have a little overhead,
althoug I can't remember exactly how much, I seem to recall that accessing a
virtual function added about 6 68000 instructions to the call (for doing the
lookup that located the proper virtual function).  It depends on your
application as to what is tolerable...in general, a lot of times what you think
is time critical turns out to not be the case.

>
>
> About the choice 68xxx vs AVR cs PIC : Beside the instruction set, I think
> about availability (should be a standard) and scalability (is it possible to
> get a faster model or more features like RAM, IO etc without learning a
> complete new processor). I understand the Motorolas are very good here,
> but I can´t find them in the catalogues... So it seems to narrow down
> between PIC and AVR... BTW : What are the standard models used for 16-
> bit processing ? THere´s a lot of 8 bit stuff out there, but....

    The only 16 bit processor I ever used (the 68K I consider a 32 bit) was the
National Semiconductor HPC1600x, or something like that...Personally, the AVR
seems to out perform it by a large margin, IMHO...I have never used the HC16, so
I can't comment on it.  Again, it sort of boils down to what compilers I have in
my possesion.  Although, with the GNU C/C++, you should be able to find
something for free for almost anything.

    I should also clarify something about how I choose an instruction set...I
prefer processors that have a fully functional stack.  It sure makes life
easier.  Some processors, like the old 6502, just barely qualify (in fact, in
some ways, they don't qualify).  I like the 68000 because it really handle the
stack quite nicely...the AVR also does a fair job of handling the stack...the
PIC doesn't, or at least the version I used didn't.  I understand that some of
the newer parts have solved this problem, although, I have never verified it.

>
>
> The links gave me some good ideas, thank you again. expect some
> questions later :-)
>
> Has someone worked with MIDIshare or Jazz ? These are PC based
> applications and I thought it may be easier to plug in some hardware and
> write some code than re-inventing the wheel ...
>
> Later,
>
> Oliver

--
 -Jim
------------------------------------------------
* Visit:http://www.silcom.com/~patchell/
*-----------------------------------------------
* Come to the Pacific Southwest DIY Meet
* April 12, 2003 10am-5pm
* Santa Barbara, CA
* http://www.silcom.com/~patchell/synthdiymeet.html
* for details
*-----------------------------------------------




More information about the Synth-diy mailing list