P
Paul Keinanen
- Jan 1, 1970
- 0
Grant Edwards wrote:
The Modula2 derived IEC (6)1131 Structured Text (ST) is quite popular
in PLC programming,
Paul
Grant Edwards wrote:
Eric said:David Brown <[email protected]> writes:
Many Ada compilers are fully compliant with the standard, though they
may also offer extensions. Ada with the admittedly optional representation
specs is perfectly well suited to embedded programming, without needing
any non-standard extensions. Arguably it is a more suitable language than
C, since C still leaves many important things as implementation-defined.
Sure. But then it isn't "Pascal", it's "someone's nonstandard language
based on Pascal", so you can't use it to claim that Pascal is suitable
for low-level programming.
If the claim was that brand XYZ "Extended Pascal" is suitable for low-level
programming, I'd have no argument.
I don't claim that any of them were "made just for fun". I also don't
claim that none of Wirth's languages are suitable for low-level programming.
I only claim that Pascal is not suitable for low-level programming, and
that it was designed as a teaching language. I doubt that Wirth himself
would disagree.
"with" is very useful - it can make some kinds of code a lot clearer,
and it is easy for the compiler to optimise it (for example, if you have
a "with" block on a record in an array indexed by a global, the compiler
can easily use a pointer for all the accesses.
Without "with", a C compiler may have to be conservative and re-calculate
the pointer).
Yes,
and you can also get the size of arrays passed to functions (arrays
are a different type from pointers).
I don't know - why would you want variadic functions in a strongly typed
and strongly structured language?
Higher level concepts that Pascal has are proper enumerated types,
integer range types (both of which give much better compile-time
checking), and local procedures and functions (which improve modularity
and structure).
Sets are another very useful higher level concept.
When I've been working with Delphi for a while, and go back to C
programming, I find I miss the better type support (enumerated types,
subranges, and sets) most.
What string support does Pascal have? Lack of a string type
is a major deficiency (of the original standard Pascal).
While I like null terminated strings when programming in an assembly
language, does it really belong to a high level language ?
Imagine you get a capture edge, on what should be 5FFFF.Ulf said:Interrupt on Timer wraparound (Higher Interrupt priority than Capture)
Timer = Timer + 1
Interrupt on Capture
Capture[15:0] = H/W Timer
Capture[31:16] = S/W Timer
If you cannot prioritize interrupts, then there would be a problem.
(or even close to that)
During the Capture INT propogation delays, the timer ticks over and
fires its int, which now takes priority, and when the capture Sw finally
gets to Capture[31:16] it gets 6FFFF as the answer.
Now do you see the aperture problem ?
Capture is one of those things that really needs hardware.
if you want to use the string as a buffer for binary data it's not
useful, but for most other purposes it's just fine,
Everett M. Greene said:Ulf Samuelsson said:Keep a presentation on what to improve on peripherals which
I provide to the MCU product lines.
This is now ~150 pages, and a significant part is on timers.
The designers must love to see you coming with your punch
list! They probably also love you hampering[sic] about
timers...
Jim Granville said:Ulf said:Jim Granville said:Have you actually tried doing this ?
As soon as you expand a capture system with SW, you have serious
aperture problems. There is a window between the HW register, and SW
register, where they are out of sync. You also have TWO interrupts
racing, one on the capture edge, and another trying to keep the MSB up to
date.
Interrupt on Timer wraparound (Higher Interrupt priority than Capture)
Timer = Timer + 1
Interrupt on Capture
Capture[15:0] = H/W Timer
Capture[31:16] = S/W Timer
If you cannot prioritize interrupts, then there would be a problem.
Imagine you get a capture edge, on what should be 5FFFF.
(or even close to that)
During the Capture INT propogation delays, the timer ticks over and fires
its int, which now takes priority, and when the capture Sw finally
gets to Capture[31:16] it gets 6FFFF as the answer.
Now do you see the aperture problem ?
Capture is one of those things that really needs hardware.
Good, looks like that just got some more content
What propogation delay does this have ? is this aperture free ?
(or at least aperture locked, so I guess a SW patch could apply to
fix a known fixed phase error)
All the data says is HiResolution mode exists, but does NOT say what
happens to the pin sampling, or if that is CPU or Timer clocked.
Can the pins sample faster than the CPU clock (ideally, at the x4 clock?)
Ulf said:"Jim Granville" <[email protected]> skrev:
.... snip ...
True, I do hamper a lot about timers internally...
I've always thought that Ada looked like a pretty good embedded
programming language (which is, after all, what it was intended
for). However, my one experience with Ada for an embedded
system was so incredibly awful that I still have nightmares
about it. It was under VAX/VMS, and you couldn't just do
cross-development like you could with other languages (using
normal files, standard text editors, source control, etc.).
You had to log into some horrible stand-alone Ada shell
database environment torture chamber. You couldn't use your
normal programming editor or source control or
build/documentation tools. Just copying an external source
file into or out of the Ada development environment/database
was painful. I thought moving from Unix to VMS was bad, but
the Ada development environment was worse than programming
using an ASR-33 and paper tape. At least with paper tape, you
got all the fun paper dots to play with (though the big oil
stains that the reels of tape left everywhere were unpleasant).
I don't remember much about the Ada environment other than it
was something either the DoD or the Navy wanted to torture
people with.
Jim Granville said:Ulf Samuelsson wrote:
Sounds good.
Would simply moving to 32 bit registers not be less silicon than all the
event logic ? (ignoring the other benefits of event logic, for a moment)
.. this can be something else to add to your list?
(Oh, and add having a simple queue/buffer to capture registers, to allow
very narrow pulse measurement.
So do the pins sample at the CPU speed, which places another
restriction on the designer ?
Since the silicon can go >> 100MHz, it's not sensible to limit
timers on frequency or time measurements to something much lower.
The ideal here is 100MHz Frequency or 10ns edge precisions, with
a core ticking over at 1MHz, or even slower...
Jim Granville said:Depends on the process, but you have already established the Xmega timer
can run at 128 MHz.
Q: Can it hook into the Event System at that speed ?
True. Harder to solve on 8 bit uC, but most 32 bit cores have more
core-peripheral elasticity already, and more buffered peripherals in
general (FIFOs are common) so much of the needed framework is
in place.
You mentioned the xmega is already part way there, on PWM modes alone.
Not much effort to extend that to capture/counter modes too.
Provided that you don't want your code to be portable. Presumably if you
wanted your code to be portable, you would write it in Pascal, and then
you couldn't do the low-level stuff.
Jim Granville said:Now I am lost. If you are running PWM, then you surely need ALL
bits for a compare, so the granularity should be 7.8ns, and
smallest pulse is 7.8ns
If your system is doing that, I'd call that a 128MHz, 16 bit counter.
ie able to sync count and do 16 bit compare, at 128Mhz
- or are you saying that is not the
case with the xmega, when PWM clocked at 128Mhz ?
OK. So that makes a 100MHz NXP device (with 32 bit timers), 3 times as
precise.
Yes.
-jg
Eric said:.... snip ...
I'm not a big fan of C, but it's certainly suitable for low-level
programming. My criticisms of C are at the other end of the
spectrum. I write a lot of C code because that's what my clients
want, and in the case of Free Software, that's what people are
likely to be able to run.
I prefer strongly-typed languages. I actually do like Pascal,
and over the years I've written a lot of code for clients in UCSD
Pascal, Turbo Pascal, etc., but I wouldn't recommend it to
clientis now, especially for low-level work. I like Ada better;
functionally it is almost a superset of Pascal, but it is
significantly better in many regards including support for
low-level programming. However, my clients generally don't want
Ada, partly because it is supported on fewer target platforms,
and partly because they'd have a harder time finding other
engineers to maintain it.
Ulf Samuelsson said:FYI: Todays press announcement
San Jose, CA, October 29, 2008.Atmel® Corporation (Nasdaq: ATML), today announced that, after careful consideration, its Board of
Directors has unanimously determined that the October 1, 2008, unsolicited proposal from Microchip Technology Inc. (NASDAQ: MCHP)
and ON Semiconductor Corporation (NASDAQ: ONNN) is inadequate in multiple respects, including value, conditionality and
complexity, and is not in the best interests of Atmel's stockholders.
--
Best Regards,
Ulf Samuelsson
This is intended to be my personal opinion which may,
or may not be shared by my employer Atmel Nordic AB
Jim Granville said:Ulf said:FYI: Todays press announcement
San Jose, CA, October 29, 2008.Atmel® Corporation (Nasdaq: ATML), today announced that, after careful consideration, its Board of
Directors has unanimously determined that the October 1, 2008, unsolicited proposal from Microchip Technology Inc. (NASDAQ: MCHP)
and ON Semiconductor Corporation (NASDAQ: ONNN) is inadequate in multiple respects, including value, conditionality and
complexity, and is not in the best interests of Atmel's stockholders.
...and a few weeks later, seems it is still all on !?
[Nov 12: SAN JOSE, Calif. -- Despite receiving a rejection slip, Microchip Technology Inc. and On Semiconductor Corp. remain
committed in their proposed and unsolicited acquisition of Atmel Corp.
And there is a major surprise in the latest announcement: Microchip now claims it owns approximately 4.1 percent of Atmel's
outstanding common stock. ]
-jg