Loading...
  Show Posts
Pages: 1 ... 54 55 [56] 57 58 ... 74
826  Development / Other Software Development / Re: Multithreading on Arduino? on: October 10, 2011, 08:43:58 am
pito,

You can use existing libraries and device code with a RTOS.  You just need to use the proper task structure with queues, semaphores, and mutexes to get sharing to work.

Currently I am playing with FreeRTOS and ChibiOS/RT.  I like ChibiOS/RT for ARM but FreeRTOS is a better choice for avr Arduino.

Using a preemptive kernel takes knowledge/skill for proper use so it's not for beginners.
827  Development / Other Software Development / Re: Multithreading on Arduino? on: October 09, 2011, 04:31:54 pm
Guess you were talking storage.  I can get about 830 KB/sec to external SRAM or 1200 ns/byte.  Internal SRAM has a 62.5 ns cycle time.  The limit for Arduino is mostly due to the max SPI rate of 8 MHz which is 1000 KB/sec.

For huge I like Dataflash.  A 8-pin SOIC with SPI interface can store up to 16 megbits of data and costs under $2.50 from DigiKey.

I started developing/using open source software over 40 years ago so understand its nature.

When I needed reliable I went with systems like VxWorks from Wind River Systems, a company founded by two of my friends.

Arduino is open source.  Look at the Arduino core and notice that it could never pass certification for use in a critical embedded system.  So why worry so much about the stuff you use with it?  You don't use Arduino hardware/software for serious critical applications.

What company do you buy your production-quality Arduino software from?

828  Development / Other Software Development / Re: Multithreading on Arduino? on: October 09, 2011, 01:47:19 pm
Arduino is open source so why not use other open source software with Arduino.  There are several open source RTOS-es that work fine.  FreeRTOS is used in lots of hobby projects and runs on avr.

Adding SPI SRAM is not very effective.  avr SPI is very slow programed I/O.  You can do a lot with the ATmega 1284, 16 KB SRAM.

ARM Arduino boards will be a better solution for larger apps.
829  Development / Other Software Development / Re: Floating point format on: October 09, 2011, 01:33:39 pm
Arduino is little endian.  The float and double types are both 32-bit IEEE floating point.
830  Development / Other Software Development / Re: Multithreading on Arduino? on: October 09, 2011, 11:13:26 am
I am sure that RTOS-es will be used on ARM Arduinos.  It would be nice if some thought was given to the core software so it would work well with the old style Arduino setup(), loop() or with an optional RTOS.

Leaflabs includes FreeRTOS as a library for their STM32 Arduino-like board.

Leaflabs has done a great job with their libmaple for the STM32 ARM processors.
831  Using Arduino / Storage / Re: SDFat / openNext does not return all the directory entries within Webduino on: October 04, 2011, 07:14:53 am
Is there a reason why you didn't use ls() like this?
Code:
  sd.ls();

Try putting a rewind before the loop like this.
Code:
  sd.vwd()->rewind();
  while (myFile.openNext(sd.vwd(), O_READ)) {
    myFile.getFilename(name);
    cout << name << endl;
    myFile.close();
  }
This is needed if there are any file operations before the loop.

If there are file operations on a directory between openNext calls, you need to restore the position of the directory like this:
Code:
  uint32_t pos = 0;
  while (1) {
    sd.vwd()->seekSet(pos);
    if (!file.openNext(sd.vwd(), O_READ)) break;
    pos = sd.vwd()->curPosition();
   ...
   // position of vwd() is changed by some operation
   ...
    file.getFilename(name);
    cout << name << endl;
    file.close();
  }
  cout << "Done" << endl;
}
832  Using Arduino / Storage / Re: Good way to detect that a SD card has been removed on: September 29, 2011, 03:35:47 pm
Looks like the "MC version" does not define the ARDUINO macro.  I have been using it to make mods to support both 0022 and the new Arduino 1.0.

This appears to fail in the MC version:
Code:
#if ARDUINO < 100
#include <WProgram.h>
#else  // ARDUINO
#include <Arduino.h>
#endif  // ARDUINO
833  Using Arduino / Storage / Re: SD.exists(filename) freezes on: September 28, 2011, 02:53:16 pm
Your cutout doesn't hang when I try it. 

Also this does not generate valid file names
Code:
filename[4]=char(filename_counter);
So it will always exit the loop after the first test for "TEST1.TXT".

834  Using Arduino / Storage / Re: Good way to detect that a SD card has been removed on: September 28, 2011, 06:32:19 am
Code:
  root.close();
835  Using Arduino / Storage / Re: Good way to detect that a SD card has been removed on: September 27, 2011, 06:59:58 pm
You need to close root before opening it again.  Root is just another file.
836  Development / Suggestions for the Arduino Project / Re: Arduino ARM - hooks for Maple and other boards? on: September 27, 2011, 10:13:46 am
Magician,

I use the USART to program the STM32 Stamp.

STM32 chips have a ROM loader that can be selected by holding a pin, BOOT0, high at reset time.
Quote
The bootloader is stored in the internal boot ROM memory (system memory) of STM32
devices. It is programmed by ST during production. Its main task is to download the
application program to the internal Flash memory through one of the available serial
peripherals (USART, CAN, USB, etc.). A communication protocol is defined for each serial
interface, with a compatible command set and sequences.
Here are more details:
www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/APPLICATION_NOTE/CD00167594.pdf

TonyD,

The STM32F4 Discovery board looks fun.  I have on on order from DigiKey for under $20 and it should ship within a month.
Quote
STM32F407VGT6 microcontroller featuring 32-bit ARM Cortex-M4F core, 1 MB Flash, 192 KB RAM
168 MHz/210 DMIPS Cortex-M4 with single cycle DSP MAC and floating point unit






837  Using Arduino / Storage / Re: Good way to detect that a SD card has been removed on: September 26, 2011, 03:31:51 pm
I have been making mods to SdFat to improve the ability to change SD cards so be sure to use the latest version of SdFat.  Some changes may only be in the 20110917 beta version http://code.google.com/p/beta-lib/downloads/list.

Memory loss will not be a problem.  SdFat uses no memory from the heap - no calls to malloc/free.  Part of my religion about embedded systems.

Before initializing the new SD, close any files.  close() will return fail but will set the state of the file closed.  SdFat, like most filesystems, does not allow open of an already open file object.  This tends to catch missing close bugs.

Clear writeError for files that were open for write
Code:
  file.writeError = false;

Now initialize the SD card just like you did before the error.

If you have problems let me know.  Many people will be using multiple cards.  SdFat now supports multiple card sockets so people want to change cards so I need to improve this capability.

For best results, the card detect switch is required but you may do O.K. without it.
838  Development / Suggestions for the Arduino Project / Arduino ARM - hooks for Maple and other boards? on: September 26, 2011, 01:59:50 pm
The Arduino Due will have an Atmel SAM3U processor. 

The Arduino team said in the announcement "We plan a final and tested release by the end of 2011".

The Atmel SAM3U processors are O.K. but there are a lot of other interesting ARM processors.

Will the Arduino ARM environment be modular enough to support other "Arduino-compatible format boards" like Maple?

This is not as easy as with AVR work-alike boards.  ARM processors from different vendors may have a ARM Cortex core but the chip's peripherals are very different. 

Clearly vendors of work-alike ARM boards will need to do a lot more software to use the Arduino ARM IDE.

Maple uses STM32 processors and has some very nice hardware http://leaflabs.com/store/.

There are other inexpensive STM32 boards.   

The $10 STM32LVDISCOVERY board is nice http://www.st.com/internet/evalboard/product/250863.jsp.  Clearly ST is subsidizing the cost of this board.  Lots of websites have tutorials using this board with GNU software.

Several projects use this board http://www.xduino.com/hardware/.  I bought several here http://www.futurlec.com/ET-STM32_Stamp.shtml  for about $25 each.  Fururlec doesn't have a very good rep though.

839  Using Arduino / Storage / Re: Good way to detect that a SD card has been removed on: September 26, 2011, 01:09:45 pm
jcarrr,

Just pulling the card may work for you.  You may lose some data but you can limit that by calling sync() in SdFat or flush() in SD.h.  Call it every few seconds of after writing some key data.

A call to sync()/flush() forces all data to the SD and updates to file's directory entry.  This is what close() does.

When you pull a card, all data since the last sync() will be lost, even if it was written to the card, since the directory entry has the filesize and is only updated by sync()/flush() or close().

File system error-checking tools may find problems.  Space that was allocated after the last sync() call will be lost.  Error-checking tools will put these allocation units in a lost/found directory.

I would copy all data from a card that has been pulled during operation and reformat it using the SD association's format tool https://www.sdcard.org/consumers/formatter_3/ before using it again.
840  Using Arduino / Storage / Re: Good way to detect that a SD card has been removed on: September 24, 2011, 08:07:19 pm
No hope in a new version of SdFat.  I am the author.  You can't tell from the SPI bus.

People try some file a operation and check for an error but it is not reliable.  SdFat may get info from the cache and not return an error.
Pages: 1 ... 54 55 [56] 57 58 ... 74