Show Posts
Pages: 1 ... 61 62 [63] 64 65 ... 107
931  Community / Bar Sport / Re: Curiosity - way too cool. Sunday. on: August 06, 2012, 02:32:19 pm
I can't believe JPL.  Most U.S. Mars missions have involved JPL and 14 of the 19 U.S. missions succeeded.

Only 2 of the 21 Mars missions by other countries have succeeded.  The score is now Earth 16 Mars 24.

http://mars.jpl.nasa.gov/msl/multimedia/images/?ImageID=4181

Not bad for a 27 year old RTOS on an old 200 MHz PowerPC 750 (Mac G3).  Curiosity has two RAD750 processors, one primary and one backup.  It's normal for computing technology to be way out of date when space missions fly.

JPL used the VxWorks RTOS on this mission.  I did a project in 1985 with VxWorks. 

Two of my colleagues quit the Lawrence Berkeley National Lab where we worked, formed Wind River Systems, and developed VxWorks.  I contracted with them for the first release of VxWorks and used it in a small project.

932  Using Arduino / Storage / Re: 1284p and SD datalogging on: August 06, 2012, 12:07:37 pm
Read this first http://arduino.cc/it/Reference/Libraries.  SdFat is a Contributed Library.

Also read this arduino.cc/en/Guide/Environment.  It explains where things are.

Once again, install the SdFat folder in the libraries sub-folder of your sketchbook folder.

Quote
To install third-party libraries, create a directory called libraries within your sketchbook directory. Then unzip the library there. For example, to install the DateTime library, its files should be in the /libraries/DateTime sub-folder of your sketchbook folder.

Please learn the basics of Arduino.  There are many articles on installing libraries.  Google for "installing arduino libraries".
933  Development / Other Software Development / Re: New fast digital I/O and Software SPI libraries on: August 05, 2012, 08:21:10 pm
Embedded programming standards don't have statements like:
Quote
would it not be suitable if users of the code are made fully aware of the behavior.

To often one user's code is another user's library and stuff like this gets lost and tragedies happen.

Nothing really matters with Arduino since it is a case study in bad practice and I often follow with bad practice in my Arduino libraries and programs since they are just toys.  I have some limits with Arduino and a factor of 30 in execution speed was too much.

Here is a typical coding standard for a critical system, The F35 Joint Strike Fighter http://www.jsf.mil/downloads/documents/JSF_AV_C++_Coding_Standards_Rev_C.doc.
934  Using Arduino / Storage / Re: 1284p and SD datalogging on: August 05, 2012, 07:40:16 pm
Looks like the SdFat folder is not in the libraries folder of your Arduino folder.

In my case on Windows 7 this is C:\Users\bill\Documents\Arduino\libraries\SdFat.

The SdFatAppend.pde is a very old example for backward compatibility tests.

Newer examples are in the SdFat/examples folder.

On Windows 7 this is C:\Users\bill\Documents\Arduino\libraries\SdFat\examples.

The new version is append.ino in the examples/append folder.
935  Using Arduino / Storage / Re: 1284p and SD datalogging on: August 05, 2012, 06:59:11 pm
SD.h is based on an very old version of SdFat.  I wrote SdFat but no longer support the version used as the base for SD.h.

You might want to try the latest version of SdFat.  Except for Software SPI, it uses the pin definitions in the Arduino hardware/variants folders so no edits should be needed for hardware SPI.

You probably won't use Software SPI.  For the 1284P, Software SPI uses the Sanguino pin map.

SdFat is here http://code.google.com/p/sdfatlib/downloads/list.
936  Development / Other Software Development / Re: New fast digital I/O and Software SPI libraries on: August 05, 2012, 06:43:18 pm
I don't like macro implementations and macros are not needed to use to use digitalWrite() or another function when the pin number is not a constant.

I produce an error when pin number is not a constant because most professional embedded programming standards consider having a function change execution speed by a factor of 30  when an argument is a constant to be poor practice.

You could do this to have a fast/slow digital write:
Code:
static inline __attribute__((always_inline))
void fastSlowWrite(uint8_t pin, bool value) {
  if (__builtin_constant_p(pin)) {
    fastBitWriteSafe(pinMap[pin].port, pinMap[pin].bit, value);
  } else {
    digitalWrite(pin, value);
  }
}

This compiles as 692 bytes and write is fast.
Code:
#include <DigitalPin.h>
const uint8_t PIN = 13;
void setup() {
  pinMode(PIN, OUTPUT);
  fastSlowWrite(PIN, 1);
}
void loop() {}
This compiles as 872 bytes and write is slow.
Code:
#include <DigitalPin.h>
uint8_t var = 13;
void setup() {
  pinMode(var, OUTPUT);
  fastSlowWrite(var, 1);
}
void loop() {}

I made DigitalPin a wrapper since it insures the static and class functions behave the same.  I almost used separate implementations since the template insures the pin number is a constant an much of the static function stuff is not needed.
937  Using Arduino / Storage / Re: Arduino Mega 2560 W5100 Ethernet Shield and SdFat library on: August 05, 2012, 10:13:58 am
Pulling pin 10 high is worth a try since SdFat does not set pin 10 high on the Mega. 

SdFat pulls pin 10 high on 328 boards to avoid problems but it can't do that on the Mega since SS is not pin 10 on the Mega.

It could be that the W5100 overpowers one SD on the SPI bus but not the other SD.

It's a problem with the cards SPI controller if you still get this.
Quote
SD errorCode: 0XA
SD errorData: 0X9
938  Development / Other Software Development / New fast digital I/O and Software SPI libraries on: August 05, 2012, 07:18:50 am
I posted new fast I/O libraries as DigitalPinBeta20120804.zip http://code.google.com/p/beta-lib/downloads/list.

The libraries support standard 168/328 Arduino, Mega, Leonardo, Teensy, Teensy++, and Sanguino.

The DigitalPin class provides very fast inline functions. DigitalPin is a template class and pin numbers must be specified at compile time. 

For 328 pins and low address Mega pins read(), toggle(), and write() execute in two cycles or 125 ns for a 16 MHz CPU.  This is about thirty times faster than digitalWrite() which executes in about 4 usec.

The main member functions for the DigitalPin class are:
Code:
void config (bool mode, bool level);
void high ();
void low ();
void mode (bool pinMode);
bool read ();
void toggle ();
void write (bool value);

The library also contains these static inline functions similar to digitalRead()/digitalWrite().  Pin number must be a constant.
Code:
static bool fastDigitalRead (uint8_t pin);
static void fastDigitalToggle (uint8_t pin);
static void fastDigitalWrite (uint8_t pin, bool level);
static void fastPinConfig (uint8_t pin, bool mode, bool level);
static void fastPinMode (uint8_t pin, bool mode);

There is also a Software SPI class that runs at about 2 MHz.  It is a template class with compile time pin numbers and SPI mode.  Modes 0 - 3 are supported MSB first.  LSB first would be easy to implement.

The member functions are:
Code:
void begin ();
uint8_t receive ();
void send (uint8_t data);
uint8_t transfer (uint8_t txData);

There is also a class, DigitalIO, with run-time pin numbers.  It is much slower than the  above DigitalPin class but is 3 - 4 times faster than the Arduino digitalRead()/digitalWrite() functions.
939  Development / Suggestions for the Arduino Project / Re: How about adding digitalToggle(pin)? on: August 04, 2012, 04:25:45 pm
I posted a new version of fast I/O libraries with toggle() as DigitalPinBeta20120804.zip http://code.google.com/p/beta-lib/downloads/list.

The libraries support standard 168/328 Arduino, Mega, Leonardo, Teensy, Teensy++, and Sanguino.

The DigitalPin class provides very fast inline functions. DigitalPin is a template class and pin numbers must be specified at compile time. 

For 328 pins and low address Mega pins read(), toggle(), and write() execute in two cycles or 125 ns for a 16 MHz CPU.

The main member functions for the DigitalPin class are:
Code:
void config (bool mode, bool level);
void high ();
void low ();
void mode (bool pinMode);
bool read ();
void toggle ();
void write (bool value);

The library also contains these static inline functions similar to digitalRead()/digitalWrite().  Pin number must be a constant.
Code:
static bool fastDigitalRead (uint8_t pin);
static void fastDigitalToggle (uint8_t pin);
static void fastDigitalWrite (uint8_t pin, bool level);
static void fastPinConfig (uint8_t pin, bool mode, bool level);
static void fastPinMode (uint8_t pin, bool mode);

There is also a Software SPI class that runs at about 2 MHz.  It is also a template class with compile time pin numbers and SPI mode.  Modes 0 - 3 are supported MSB first.  LSB first would be easy to implement.

The member functions are:
Code:
void begin ();
uint8_t receive ();
void send (uint8_t data);
uint8_t transfer (uint8_t txData);
940  Development / Other Hardware Development / Re: Pitolino - a small data logging gadget on: August 04, 2012, 02:56:50 pm
florinc,

I just posted a new version of the fast I/O libraries as DigitalPinBeta20120804.zip  http://code.google.com/p/beta-lib/downloads/list.

Standard 168/328, Mega, Teensy, Leonardo, Teensy++, and Sanguino are supported.
941  Using Arduino / Storage / Re: Arduino Mega 2560 W5100 Ethernet Shield and SdFat library on: August 04, 2012, 02:51:57 pm
I don't think a MMCmicro card will fit a microSD socket.

I looked at the status and the the reason ACMD41 failed is "com CRC error".  This should never happen since CRC is disabled by default for SPI access.

I have seen a similar problem with one card, an Eye-Fi card.

The latest SdFat supports CRC but it slows access.

Try editing SdFatConfig.h and make this change
Code:
#define USE_SD_CRC 2
942  Using Arduino / Storage / Re: Arduino Mega 2560 W5100 Ethernet Shield and SdFat library on: August 04, 2012, 01:10:09 pm
The error occurs in the card identification part of initialization.  The command that fails is called ACMD41. 

Any chance you are using a MMC card?

This command ACMD41 is not supported by MMC cards and the SdFat and SD.h libraries do not support MMC cards.
943  Topics / Science and Measurement / Re: ADC accuracy on: August 04, 2012, 10:34:03 am
I didn't do the Open Music Labs work, I just used it to estimate the accuracy of a fast data logger.

I wrote a program that logs 100 ksps to an SD http://arduino.cc/forum/index.php/topic,113879.0.html.

I plan to post the logger soon, after completing work on another Arduino library for fast digital I/O and general software SPI.
944  Using Arduino / Storage / Re: Code from SD card? on: August 04, 2012, 10:15:53 am
There has been interest in a SD bootloader but little has been done.  westfw started a topic and I wrote a very small program to read from an SD.  The SD read part takes about 1200 bytes so a 2 KB loader would be possible.

Here is the topic with my code http://arduino.cc/forum/index.php/topic,89478.msg674246.html#msg674246.  The code is attached to this post (you need to be logged in to see the atachment).

Too bad westfw didn't pursue it.  He is an expert on bootloaders.
945  Development / Other Hardware Development / Re: Pitolino - a small data logging gadget on: August 04, 2012, 09:56:27 am
I don't think the labels on the board matter too much, Teensy is easy to use with port-bit labels.

Pin Numbers are a pain but they permeate Arduino software so you do need a mapping.  It would be nice if you didn't add another variant.

Are you using the mapping with D31 = A7 = PA0 or the one with D31 = A7 = PA7?

It would be helpful if the variants for 1284P had names.  You can't build fast I/O libraries using pins_arduino.h.  You need to use some compile time trick so digital read and write compile to cbi/sbi instructions.

Paul Stoffregen defined the symbol CORE_TEENSY.  This permits the Teensy to be distinguished from the Leonardo.  This define allows add both Teensy and Leonardo to be added to libraries for fast digital I/O and software SPI.

Currently I use the Sanguino mapping for 644/1284 in my fast I/O libraries.  It had PA0 = D31 but D31 was analog pin 0.
Pages: 1 ... 61 62 [63] 64 65 ... 107