Show Posts
Pages: 1 [2] 3 4 ... 6
16  Development / Suggestions for the Arduino Project / Re: Does Arduino have a future? on: July 27, 2014, 05:31:32 am
The architecture of AVR or cortex CPUs is essentially the same as those of 50 years ago, and in that time people have been wrestling with the problem of bare-metal vs OS.

Unfortunately, there is no way to create OS-like functionality without incurring some overhead.  The more independence of processing that you want, the more overhead you need. This is an inevitable feature of several processes sharing a single CPU core, memory and peripherals.

Fortunately, the hardware guys keep making faster chips, so we get round the problem that way. The alternative is to have independent cores, e.g. like the Parallax Propeller. But I am pretty sure there is no software trick to get the best of both worlds.

There is a niche at the bottom end for bare metal systems, and I think the basic Arduino will continue to provide an entry level type system for that. It's also clear there is demand for systems with rich environments like Raspberry Pi. The price/performance of those will continue to improve, and the price get closer to that of Arduino, if not already there.

What will probably not change is the middle ground, between bare metal and feature rich OS like Linux. For example, I would like to add TCP/IP, web server, USB host with support for wi-fi dongle to my bare metal project. That's a big chunk of code. There is no obvious off the shelf solution, or "go to" RTOS which supports all that out of the box.

The problem is that there are thousands of RTOS to choose from, but drivers and middleware for them is lacking. I think this is one area where diversity doesn't help, and a single standard would allow people to develop drivers and middleware instead of re-inventing the RTOS.

Perhaps the Japanese had the right idea with ITRON, but a government funded standard seems like anathema to the western way of doings. ITRON is claimed to be the most widely used OS (units shipped), but few people have heard of it.

Ironically, an old version of Unix might be a good real time OS, at least for 32 bit devices. It has a simple clean architecture and is well known.

The gap between 16MHz 8 bit AVR, and a 500MHz 32 bit ARM with 4MB RAM (roughly where Linux becomes runnable) is too big to be bridged with a single RTOS. It should be possible to scale from say 50MHz ARM with 32KB upwards on a single RTOS, but chips with a few kB of RAM will be too resource constrained to run anything more than a very basic RTOS if at all.

So I think Arduino will continue as a cheap and simple way to interface to electronics, systems like Beaglebone will reach the price point of Arduino, and the problem of the middle ground between bare metal and Linux will continue.

Perhaps the answer is dual function boards like Arduino Tre and UDOO, with a fast interface between the low and high level CPUs.
17  Products / Arduino Due / Re: About Serial.print() function for DUE on: July 26, 2014, 11:04:11 am
These measurements are misleading. At 115200, the speed of transmission is exactly the same for Mega and Due.

The difference in Due is that the write blocks, so you waste time waiting. So if you have other stuff to do, it could be made more efficient, but you won't be able to transmit faster. The Mega appears faster because it has not actually sent the data, it has just put the data into a buffer.

In the worst case on Mega, if the transmit buffer is full, then you still end up waiting.

However, I can't see any good reason why the Due should not support a transmit buffer, I think it would be quite easy to add. With the new availableForWrite function, the user can maximise the amount of processing done while waiting for comms, and perhaps minimise latency between transmissions.

I will have a go at creating a patch.
18  Products / Arduino Due / Re: Due for very low power applications? on: July 21, 2014, 07:35:54 pm
I would try to start with a design that is designed for low power, but it might be simpler and almost as good to control the Due power with a small extra circuit. This type of thing is described here

Atmel and Microchip do some low power 8 bitters which could act as power controller. If you have the electronics-fu you could probably get down to nA or something, but for 1-2uA having a micro is a lot more flexible to run timers, wake on int, shutdown request etc.

Of course the Due would need to store its state before powering off, there are a number of ways to do that.
19  Products / Arduino Due / Re: Problems programming the Due on: July 21, 2014, 04:41:30 pm
This is puzzling. I don't think that adc12_sam3u.c should even be in the build, because as the name suggests it is for SAM3U not SAM3X. adc.c is the file for the SAM3X.

Poking about in hardware\arduino\sam\system\libsam, it seems that the makefiles support SAM3U and SAM3X targets. I guess this stems from the time when they weren't sure to use SAM3U or SAM3X.

I can't see that the gcc make files would work at all, but the IAR project excludes adc12_sam3u. The implication is that Arduino must use IAR to build the due_x library?

tldr; just delete adc12_sam3u.c !

Edit: I think I was looking in the wrong place, the make files for libsam_sam3x8e_gcc_rel.a are in hardware/arduino/sam/variants/arduino_due_x. But, I still can't see how the library is built from there. I would like to figure this out, because I want to create a patch to enable the watchdog!
20  Products / Arduino Due / Re: Problems programming the Due on: July 21, 2014, 01:55:39 pm
From the date of the fiddling script, it was written sometime in 2013-09 and the Due library has certainly changed since then. It would be good to know which version of IDE Willy used at the time, but I can't see that written anywhere.

The file that make fails on is adc12_samu.c in libsam/source. The offending line is possibly "#if SAM3U_SERIES" if SAM3U_SERIES is not defined. (It's not good coding style).

Finding the source of the error might be rather difficult, but a workaround might be to define SAM3U_SERIES and see what happens. It would help to know what the previous IDE used was and compare the differences.

I've had similar problems with standalone Due projects that used to work with one IDE version then stop working on another, I don't think there is a way to avoid that until the IDE has stabilized.
21  General Category / General Discussion / Re: Compilation on: July 20, 2014, 07:03:23 am
If you want to have a go at building a computer from scratch, have a look at some of the home-built computers, like this one

Not a practical way to build a computer, but the result is almost like kinetic art.

22  General Category / General Discussion / Re: Good career options for arduino enthusiasts, and similar tech minded people? on: July 20, 2014, 06:45:21 am
In my experience, there are few opportunities for that sort of person. The type of stuff people generally do hobby-wise is really tip of the iceberg compared to industrial scale projects, and there must be a very small number of companies trying to produce "fun" type electronic gizmos.

Having a hobby interest is good because it demonstrates an interest in the subject, but for nearly all jobs you need the depth of expertise that college provides. In fact you usually need more, but college shows you have an ability to study stuff you may not be interested in. Unfortunately most jobs are 20% interesting and 80% boring stuff you have to do. Endless days in the lab testing...

23  Using Arduino / Motors, Mechanics, and Power / Re: Stepper motor jitter on: July 20, 2014, 02:23:26 am
The AF_Stepper class does not appear to implement acceleration profiles? If you are stopping without acceleration, then the moving mass will cause some oscillation about the final step point.  In the worst case it could lead to missed steps.

It appears that using this library microstepping doesn't work with single steps, the library starts and stops on a full step. You would need to perform a multiple of the microstep interval (16 may be the default) per call to get proper results.

Which version of the motor shield have you got? The V1 motor shield and library are pretty basic, you may struggle to get precise operation from it. The v2 board looks better, but a4988 driver or similar and accelstepper might be a better option.
24  Using Arduino / Motors, Mechanics, and Power / Re: Powering a stepper - questions on: July 17, 2014, 03:07:10 pm
You can disable the stepper driver with the Enable signal, that turns off the motor outputs. Of course that means the stepper can move freely, there is a small amount of detent so if the carriage is horizontal it is unlikely to move.

I am guessing the positioning is not critical (i.e. +/- 1mm).

I agree with MarkT, a DC motor with encoder is not that expensive and a lot less power.
25  General Category / General Discussion / Re: Is it possible dynamically create the name of a function? on: July 16, 2014, 02:05:28 pm
I'll say the answer is sort of yes. You can't create function names to call at run-time, but you can have a function pointer in a variable, and assign values at run time, which does something similar to what you are asking.

Here is a simple example

int j;

void func0(int arg)
   Serial.print("func 0: ");
   Serial.println (arg);

void func1(int arg)
   Serial.print("func 1: ");
   Serial.println (arg);

void setup()
  Serial.begin (115200);

void loop() {
   void (*fp)(int);

   fp = func0;

   fp = func1;     
26  General Category / General Discussion / Re: Compilation on: July 16, 2014, 01:43:48 pm
It's a good question.

Bootstrapping, it's called. Nowadays everything can be done with cross-compilation. You can also build emulators, so you can write and debug code in a virtual machine environment before any target hardware is built. We used to do this when I worked on mainframes.

So at the root, when you have no compiler, no assembler, no OS to drive keyboard/screen - how do you get the code running ?
You can write an OS or compiler in assembly language. Without an assembler, you have to translate the assembler to octal (or hex) machine code - there were programmers who could do this in their head, and didn't need to look up codes in the handbook.

Now you have code in octal or hex, how do you get that into the computer? The answer is a switch panel. You enter the address, the data, and press store, and the value is written to RAM (or core store smiley ) This is how we bootstrapped our mainframes. The bootloader was entered by hand, after power up. Some engineers memorized the whole sequence (it was not many instructions).

The bootloader would then read code from a paper tape say, to fill RAM with a longer bootloader or mini-OS to drive more peripherals. The paper tape can be created with a dumb electromechanical machine, or in the days of punched cards you could do it with a hand punch.

Other ways of getting code into memory were hand weaving -

The same method was used for mini computers and early microcomputers e.g.
27  Products / Arduino Due / Re: DUE Watchdog usage on: July 15, 2014, 02:10:00 pm
So I think, that the new weak function should be named WDT_Initialze(), to avoid confusion.

Are there any readers here, which work on the that layer of libraries? 

I don't, but I think that would be a very useful patch! I'd like to use the watchdog in some code I am doing.

I guess to get it included requires a git pull request and some polite badgering on the Arduino dev list. smiley
28  Products / Arduino Due / Re: aruino due board file on: July 15, 2014, 02:02:35 pm
i have attched the clear picture .please if you have latest board file .pplease send me

I found the same thing, but actually it is the other way round : the board file on the web is the latest version, you have an older version of the board.

The Due went through a number of minor changes, unfortunately these are not documented anywhere I have found, and there is no revision number on the board.

The reason I looked into this, is that on older boards the serial comms is faulty at baud rates higher than 115200, around the time that problem was fixed IC10 was moved.
29  Products / Arduino Due / Re: Arduino Due Memory Usage on: July 15, 2014, 01:46:15 pm
C is quite strict about types. it will perform calculations in the type of the arguments, depending on certain rules.

So if you use integer parameters it will do an integer divide, even if the result is going to be stored in a float. If you include an integer variable or constant in an expression which  you want to assign to a float, either cast or declare all the arguments as a float type, or a shortcut that often works is to make the first one a float, then the whole expression is done as a float.

To make an integer constant a float constant, add a "f", or ensure there is a decimal point.
The cast "(float)" works for variables.

The following should all produce 1.25 :
float Calibration = 5f/4f;
float Calibration = 5f/4;
float Calibration = 5.0/4.0;
float Calibration = 5.0/4;

And this should fix the first example:
int Temperature = 50;
int realTemperature = 60;
float Calibration;
Calibration = (float)Temperature / realTemperature

In general, best to stick to floats throughout, although some functions might return an integer for example which you may still need to cast to float.
30  Products / Arduino Due / Re: Code upload failing on: July 13, 2014, 04:58:20 am
I think that the SoftwareSerial library has not been ported to Due.

T|he Due has 3 more hardware serial ports, these are named Serial1, Serial2, Serial3. Physically they are mapped to pins 14-19, consult the pinout diagram to match up the ports. (TXD1/RXD1 is Serial1, and so on).

There is potentially one more hardware serial port available, but it is not supported by the Serial library. Beyond that would require software method.
Pages: 1 [2] 3 4 ... 6