Tech Support > Computer Hardware > Microprocessors > another bizarre architecture
another bizarre architecture
Posted by John Larkin on January 31st, 2007


This looks really weird to me...

http://www.maxim-ic.com/appnotes.cfm...te_number/3960

Does it resemble anything you've ever seen? It looks truly ghastly to
program. For example, allowing printf() to use floats adds 3500 bytes
to a program binary.

John

Posted by larwe on January 31st, 2007


On Jan 31, 2:03 pm, John Larkin
<jjlar...@highNOTlandTHIStechnologyPART.com> wrote:
MAXQ is aimed at very low power consumption applications. They have
been trying desperately to sell it to us. Unfortunately for any real
project we've considered, MSP430 is indistinguishable from MAXQ power-
wise. We have a lot of investment in ARM, AVR and MSP430; MAXQ is just
"yet another proprietary microcontroller" with no really compelling
feature. No sale.


Posted by Jan Panteltje on January 31st, 2007


On a sunny day (Wed, 31 Jan 2007 11:03:03 -0800) it happened John Larkin
<jjlarkin@highNOTlandTHIStechnologyPART.com> wrote in
<vap1s2ttifuhnct6n0101qvn1uhn504jpc@4ax.com>:

That last example:
Remember Z80 compare increase and repeat?
And that was one instruction.
It also has otir (out increase and repeat).
Well, OK, I guess their system works.....
But I sort of do not see the advantage.
It is faster then PIC io... but many processors allow direct access
to io / or memory [mapped io], also with indexes.
Anyways you can program your own in FPGA, opencores.org has a processor
generator.
Each his own processor :-) OK, now to write all the assemblers and compilers.

Posted by Vladimir Vassilevsky on January 31st, 2007




John Larkin wrote:

Just another small 16-bitter. From Maxim, which sounds like never use it.

It looks truly ghastly to
Coding at low level is a task of compiler. BTW, do they provide decent
tools for MAXQ?

For example, allowing printf() to use floats adds 3500 bytes
I'd say this is not unusual for the printf() overhead.


Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com

Posted by Jim Stewart on January 31st, 2007


John Larkin wrote:

It looks more like writing a cpu's microcode
than traditional assembly language. Which
might be fun if you're into that sort of thing.



Posted by Paul E. Schoen on January 31st, 2007


"John Larkin" <jjlarkin@highNOTlandTHIStechnologyPART.com> wrote in message
news:vap1s2ttifuhnct6n0101qvn1uhn504jpc@4ax.com...
This is a lot different than the PIC code I am used to. However, there must
be some advantage to it. I don't see where you get your reference to the
printf() function, however. That would be a function of a C compiler.

Paul



Posted by Mike Harrison on January 31st, 2007


On 31 Jan 2007 11:06:49 -0800, "larwe" <zwsdotcom@gmail.com> wrote:

And it's from Maxim.... usually a distinct disadvantage, availabilitywise


Posted by Rich Grise on January 31st, 2007


On Wed, 31 Jan 2007 11:03:03 -0800, John Larkin wrote:

Yes, it does resemble something I've seen - microcode. ;-) It actually
looks like something I'd enjoy playing with. :-)

And yes, I'd expect a printf() to use that many bytes - printf() is a
freakin' monstrosity in any case. What does puts() compile to? I'd think
it wouldn't take a very big loop to turn a float into a string.

Cheers!
Rich



Posted by larwe on January 31st, 2007


On Jan 31, 2:16 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
Rowley and IAR have C compilers - I've played with the IAR one and it
seems to be exactly like their other compilers with no obvious
problem. Also Phyton (but I never heard of them before). Maxim
supplies a free IDE with assembler. Very standard sort of arrangement.

Agreed, very standard.


Posted by Jim Granville on January 31st, 2007


John Larkin wrote:
They have one of the strangest ways of documenting opcodes I have seen,
which I think makes it looks stranger that it really is.
It does mean users have a learning curve to climb, unless you
want to operate purely, and only, in C - which places its own
restrictions on what you can do.

They claim low power, but the MAXQ2000 has a very poor mA/MHz offset,
- yes, it's OK at 20MHz, but only drops Icc a few %, as the clock drops
to 1MHz - so at lower clocks, it quickly looks plain lousy.
Hard to believe someone pitching a low power uC, would make that
mistake.

They seem to be targeting the DataACQ markets, so the core specs
matter less than the peripherals - eg there are (very) few uC offering
16 bit ADCs + LCD + 16*16 to 40 bit MAC, so if you really need those
features, the core will be a "don't care".

As a general mechant uC ?, nope...

-jg


Posted by John Devereux on January 31st, 2007


John Larkin <jjlarkin@highNOTlandTHIStechnologyPART.com> writes:

Its been out for a while now - I don't see advantage over more
established cores like MSP430 and ARM. And lots of disadvantages.

Then don't do that! The full printf is quite powerful (and complicated
internally). An integer-only version can be made quite compact and is
still quite powerful. If you are determined to use floating point you
can pass the integer and fractional parts as separate parameters to
the function, using a format string that combines them visually.

--

John Devereux

Posted by Spehro Pefhany on February 1st, 2007


On Wed, 31 Jan 2007 19:49:58 GMT, the renowned Rich Grise
<rich@example.net> wrote:

It is extremely simple.
http://www.koders.com/c/fid611486951...677E7CD79.aspx

Don't be a puts(). You have to convert binary to ASCII, denormalize,
deal with leading and trailing zeros, decimal points, and so on.


Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com

Posted by John Larkin on February 1st, 2007


On Wed, 31 Jan 2007 19:56:21 -0500, Spehro Pefhany
<speffSNIP@interlogDOTyou.knowwhat> wrote:


Monkeys with typewriters. Most of the functions say nothing about what
they do, and many are effectively or entirely comment-free. This is
the Microsoft philosophy: the only documentation is the code itself.

Fixed-point 64-bit to formatted ascii string is maybe a page of
assembly for the 68K. Might run over a page with zero supression and
commas every 3 digits.

John



Posted by larwe on February 1st, 2007


On Jan 31, 2:47 pm, Mike Harrison <m...@whitewing.co.uk> wrote:

The company I work for is big enough (and Maxim is desperate enough)
that Maxim would make a supply shortage someone else's problem, not
ours - as long as the foundry was physically operational

But I hear you. The problem is, all vendors are the same. Vendor A
screws up five things in a row and goes on the "design 'em out!"
shitlist. Vendor B comes in with replacement products, and all is
sweetness and light. Three years later, Vendor B screws up five things
in a row and goes on the "design 'em out!" shitlist. Vendor C comes in
with replacement products, and all is sweetness and light...
{ ... } ... repeat until you run out of vendors and then Vendor A
comes in with replacement products, Purchasing kisses and makes up
with their rep, and all is sweetness and light...

.... for another three years.


Posted by Alex Colvin on February 1st, 2007


I used to work with New England Digital (no relation to DEC) Able
computers. The first commercial single-instruction computer. Built out of
MSI circuitry and used as a signal processor in the first commercial
digital synthesizers.

http://world.std.com/~alexc/able.html

One of these days I'd love to do it in VHDL, although I bet Cameron
already has.

--
mac the naïf

Posted by Jan Panteltje on February 1st, 2007


On a sunny day (Wed, 31 Jan 2007 17:04:14 -0800) it happened John Larkin
<jjlarkin@highNOTlandTHIStechnologyPART.com> wrote in
<oje2s2hjisrbo8soro56n0bqbp1p8lp15h@4ax.com>:

No, you have to be able to read 'C'!!!!!!
I sort of like that link, maybe it is because I used DJ Delorie's C compiler
djgpp on MS DOS many many years ago...
:-)
http://en.wikipedia.org/wiki/DJGPP

Posted by John Larkin on February 1st, 2007


On Thu, 01 Feb 2007 10:49:09 GMT, Jan Panteltje
<pNaonStpealmtje@yahoo.com> wrote:

To even tell what the intent of a 100-line function is? The fact that
the comments are so few, and generally misspelled, suggest that what's
going on here is beyond simple inarticulateness.

Face it: the current state of software is an unholy mess, and the
paradigm doesn't work. Windows source code looks like this.

John



Posted by Robert Adsett on February 1st, 2007


On Feb 1, 11:53 am, John Larkin
<jjlar...@highNOTlandTHIStechnologyPART.com> wrote:
I use C, it's now probably my 'mother tongue' for programming and I
have to agree with John on this. The comments are too sparse and
worse in the one other function I looked at (to see if more complex
functions were done better), the file header comment was completely
wrong. It's the sort of file where if you already know what's
happening and what it's supposed to do you can follow it but if you
are new to it or have been away for a long enough period to have
forgotten then you will be in for a hard time. The functions assume a
lot of knowledge that is not in the files and there are no pointers
external references containing the missing information.

Robert


Posted by Jan Panteltje on February 1st, 2007


On a sunny day (Thu, 01 Feb 2007 08:53:47 -0800) it happened John Larkin
<jjlarkin@highNOTlandTHIStechnologyPART.com> wrote in
<bg64s295gsdagcf66pmb3go7e1480c9rrj@4ax.com>:

OK, I will face it, I have heard your argument before, but I happily write
many hundreds of lines of C code without additional explaining text before
each line (that is what you want).
Long ago I have learned: Write your code so it is readble, so not something like:


double pnurk(double a, souble b)
{
double c;

c = b / a;

return b / a;
}


but:

BOOL calculate_current(double resistance, double voltage, double *current)
{
if(debug)
{
fprintf(stderr,\
"calculate_current: arg resistance, voltage\n",\
resistance, voltage);
}

if(resistance < 0.0)
{
fprintf(stderr,\
"My-Program: calculate_current():\n\
Your resistance is negative (%.2f), you must be kidding right? Aborting.\n",\
resistance);

return SUCKS;
}

*current = voltage / resistance;

if(debug)
{
fprintf(stderr, "calculate_current(): calculated current=%.2f\n", *current);
}

return OK
}

Sorry could not resist.


So in a program you can then know what it does.
Of course the example is very simple, but if you are consistent
most of the time you need no more text, use the right variable names.

And use spaces.....

return a/b*c%25+15; // sucks

In the link we were talking about it is 100% clear to me at least what happens.
If you have a look at gcc, and libc.info (the reference in Linux) you can
look up all these functions.
I cannot say anything about the MS soft... MS is C++ so, and so silly that
Visual Studio.
I program in Linux with 9 rxvt terminals, libc.info open in one of these, with
the source in a normal text editor in an other rxvt, and run the code in a third
rxvt.
And switch between the virtual screens with ctrl-cu left-right-up-down.
rarely run out of (9) rxvts.
No mouse, only mouse when I test GUI stuff, and even then started from rxvt.

Anyways I do not see your problem, but you are no programmaer I think, so I
had very very hard time myself in the begining (>20 years ago) to understand
C code... mathematical shock to see != and == etc.. :-)


Posted by Vladimir Vassilevsky on February 1st, 2007




Jan Panteltje wrote:


What a shamefull nonportable, unsafe and murky piece of code.

This is a way to go:

CURRENT calculate_current(VOLTAGE voltage, RESISTANCE resistance)
{
CURRENT current;

if(fabs(resistance) < VERY_SMALL_NUMBER)
{
throw BAD_RESISTANCE;
}
else
{
current = voltage/resistance;
}
return current;
}



Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com


Similar Posts