Show Posts
Pages: 1 ... 58 59 [60] 61 62 ... 109
886  Using Arduino / Storage / Re: SD Card filesystem poblem on: September 11, 2012, 12:22:07 pm
Do you get corrupt files if you don't comment out the remove()?

If you still have the problem with remove(), is is likely something is writing over SdFat memory. 

Remove() needs to do lots of writes to the SD and would likely cause file-name problems if SdFat memory is overwritten.
887  Using Arduino / Storage / Re: SD Card filesystem poblem on: September 10, 2012, 05:10:21 pm
I am the author of SdFat which is also the base for SD.h. 

I have found most bugs that result in junk file-names are due to overwriting SdFat internal memory.  The SD cache often has a directory block with 16 directory entries so you get lots of junk names if it is over written.

Check loop indices, array dimensions, strings with no zero byte termination, bad pointers, and any other causes of overwriting memory.
888  Using Arduino / Storage / Re: Sd works in example append but fails in integration. on: September 10, 2012, 05:00:12 pm
SdFat only supports FAT 8.3 names.  This name has nine characters before the dot so is not valid.

char name[] = "GardenLog.TXT"
889  Development / Other Hardware Development / Re: Teensy 3.0 on: September 08, 2012, 12:16:41 pm
I wasn't very clear, I am sure you can generate a hex file with any Cortex M4 tool chain.

Here is my question.   How easy is it to load an arbitrary hex file?

I read this also
Teensy 3.0 features an off-chip bootloader design.  On Teensy 2.0 and all Arduino(R)** brand boards, the bootloader consumes a small portion of the available flash memory.  On most boards, the bootloader executes briefly before your own program.  By storing the bootloader in a separate chip, your code can use all of the flash memory.  Your code can also run immediately after a reset event, without bootloader interference.

I wonder how you start the boot loader?

My guess is that the button copies the boot-loader into RAM.  The boot-loader can then program all flash.

Perhaps the boot-loader uses FlexMemory.  I don't have a clear understanding of FlexMemory.

The next question is how do you send the hex file to the boot-loader?
890  Development / Other Hardware Development / Re: Teensy 3.0 on: September 08, 2012, 09:17:17 am
You should be able to use any tool chain that supports Cortex M4 processors.  

The only problem could be how Paul's boot-loader works on Teensy 3.0.  You need a hook to load you hex file.

The easy way is to use what ever Paul has packaged with his software.  His stuff is always easy to use and reliable.

I am hoping to make ChibiOS a library for Teensy 3.0 using his tools.  That way I can use his tools and have a RTOS.

I did that with the Arduino IDE for AVR processors.

I really like Freescale's documentation.  Here is a good overview of true bare metal use of the device
891  Using Arduino / Storage / Re: Bug in SD library ?! on: September 08, 2012, 08:57:54 am
This bug has been around for a long time. 

It is now in the issues list
892  Using Arduino / Sensors / Re: OPamp on: September 07, 2012, 10:33:58 am
Sorry I didn't understand you wanted to learn op-amp use.

I you just want typical bathroom scale accuracy the Arduino is fine.  You won't need much amplification to get that level of accuracy.

The sensor in the scale is probably a half bridge like this

Sparkfun has this link

The video uses a full bridge sensor but you just need two resistors and/or a pot to complete the bridge.  The video uses a true instrumentation amplifier, an AD620, which is expensive but easy to use.

18 - 24 bit delta-sigma ADCs are a better fit for this type application.  A delta-sigma ADC requires less signal conditioning circuitry, less amplification, and has greater resolution than the Arduino SAR ADC.

There are lots of app notes like this on the web:
893  Using Arduino / Storage / Re: Small SDCard library on: September 06, 2012, 04:29:50 pm
You might want to look at my Fat16 library

It's smaller than my SdFat library but only supports FAT16 on standard SD cards.
894  Using Arduino / Sensors / Re: OPamp on: September 06, 2012, 04:23:50 pm
The Arduino ADC just isn't a good choice for measuring a bridge, even with an amplifier.

The MCP3422 was designed as a single part solution for low voltage differential measurements.
The part costs a little over $3.00.  Here are typical applications:
Temperature Sensing with RTD, Thermistor, and Thermocouple

Bridge Sensing for Pressure, Strain, and Force

Weigh Scales
895  Development / Other Hardware Development / Re: Teensy 3.0 on: September 06, 2012, 08:09:09 am
I have been using lots of Cortex boards including M4 boards and this is the most elegant board I have seen.

I pledged and can't wait to see the Teensy 3.0.

The Freescale Kinetis processor is an excellent choice.  It's amazing to see that 64 pin part on such a tiny board.  It truly is Teensy.

I hope this mean it will be open enough so I can port a RTOS like ChibiOS to it.
Teensy 3.0, an affordable 32 bit ARM Cortex-M4 board, for development in Arduino or C/C++.

I have been using ChibiOS and really like having the same RTOS on all boards.
896  Using Arduino / Sensors / Re: OPamp on: September 06, 2012, 07:22:11 am
I assume the load cell has no amplifier.  If it has typical ratings, a MCP3422 or MCP3424 would work well.

The LSB (Least Significant Bit) at full gain corresponds to about 2 microvolts.

This is an 18-bit ΔΣ ADC with Differential Inputs. It has these features:

On-Board Programmable Gain Amplifier (PGA) with gains of 1, 2, 4 or 8.

On-Board Voltage Reference (VREF) Accuracy: 2.048V ± 0.05%.

I2C interface.

Here is an old post with some test code
897  Using Arduino / Storage / Re: SdFat update on: September 03, 2012, 05:38:15 pm
SdFat has been totally rewritten since the version used with the SD.h wrapper so it is not practical to update the version of SdFat used in SD.h.

The Arduino company is responsible for SD.h and has never contacted me so I don't know if they have plans to update to the new SdFat.
898  Using Arduino / Sensors / Re: Static Accuracy Tests of the Arduino Internal ADC. on: September 02, 2012, 08:55:31 am
The biggest error is usually around change over in the MSB. Do you see evidence of that in the 4000 readings?

No, the change from 511 to 512 is not an unusual step.  One of the big challenges in fabricating an ADC is to make that true so the part will meet the DNL spec.

To maintain a DNL (Differential Non-Linearity) of under 1/2 LSB, the bin from 511 to 512 must not be less than 0.5 LSB or more than 1.5 LSB wide.

You will gain a small bit of accuracy by fits with more parameters than a single line but I don't consider the improvement worth the effort.

In the past, most ADCs used resistor ladders.  Precision ADCs were expensive because it was necessary to laser trim the larger valued resistors to meet the DNL requirement.

Modern high precision ADCs use capacitor arrays.  It is easier to maintain the proper tolerance in fabrication of capacitors with lithography.  The array has caps with values C, C/2, C/4, C/8, ...

Since the large caps have a large area on the chip, it is easier achieve the required tolerance so laser trimming is not requied. 
899  Using Arduino / Sensors / Re: Static Accuracy Tests of the Arduino Internal ADC. on: September 01, 2012, 05:31:01 pm
After more thought, I am puzzled why Atmel specifies the formula
v = (Vref/1024)*n

for converting an ADC value, n, to voltage v.

This formula, that I sometimes use, is no better.

v = (Vref/1023)*n

An ideal 10-bit ADC returns the value n for voltages between (Vref/1024)*n and Vref/1024)*(n+1).

It seems like you should use the average value of voltage for bin n.  The formula for the average bin voltage is:
v = (Vref/1024)*(n + 0.5)

The Arduino ADC is anything but ideal so I calibrate it, as above, for accurate measurements. 

The problem with calibration is that non-linearity is a ragged function so you can't just do a few measurements to get a good calibration.

I measure the response of the ADC for over 4000 voltages.  I use a linear fit to these measurements.  This gives very good results for almost all ATmega chips.

That brings up the question of how can you select the best chip based on a few measurements?

ADC theory articles often show smooth curves for integral non-linearity but for real parts the plot is a very ragged/jagged line.  A calibration based on just a few measurements is an improvement but nowhere near optimal.

A comment on the S/H impedance measurements.  These measurements should not be relied on for real situations.  Stray capacitance becomes a key factor for high impedance sensors. 

High impedance sensors are not likely to output high frequency signals so you can improve accuracy by adding a 2-20nf cap between the sensor's analog pin and ground.

When the ADC MUX switches to this pin, the charge in the pin cap will be used to charge the S/H cap. The S/H cap is about 14pf so the S/H voltage will be accurate to 1% if you use a 2nf cap and 0.1% for a 20nf cap.

Of course the best solution is to use a good op-amp and filters to condition the signal from high impedance sensors.
900  Using Arduino / Storage / Re: SD won't init with brand new Leonardo + Ethernet Shield Rev3 on: August 31, 2012, 06:03:46 pm
See this topic,113058.0.html.
Pages: 1 ... 58 59 [60] 61 62 ... 109